Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Tutorials
[PlusEMU] No Need for Extra Folder
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="WanknessHD" data-source="post: 395357" data-attributes="member: 3511"><p>[CODE]using System;</p><p>using System.Linq;</p><p>using System.Xml.Linq;</p><p>using System.Collections.Generic;</p><p>using System.Net;</p><p>using System.IO;</p><p>using System.Xml;</p><p>using System.Windows.Forms;</p><p></p><p>namespace Plus.HabboHotel.Global</p><p>{</p><p> public class AntiMutant</p><p> {</p><p> private Dictionary<string, Dictionary<string, Figure>> _parts;</p><p></p><p> public AntiMutant()</p><p> {</p><p> _parts = new Dictionary<string, Dictionary<string, Figure>>();</p><p> Init();</p><p> }</p><p></p><p> public void Init()</p><p> {</p><p> if (this._parts.Count > 0)</p><p> this._parts.Clear();</p><p></p><p> try</p><p> {</p><p> </p><p>XDocument Doc = XDocument.Load(PlusEnvironment.GetConfig().data["figuredata"]);</p><p></p><p> var data = (from item in Doc.Descendants("sets") from tItem in Doc.Descendants("settype") select new { Part = tItem.Elements("set"), Type = tItem.Attribute("type"), });</p><p> foreach (var item in data.ToList())</p><p> {</p><p> foreach (var part in item.Part.ToList())</p><p> {</p><p> string PartName = item.Type.Value;</p><p> if (!_parts.ContainsKey(PartName))</p><p> _parts.Add(PartName, new Dictionary<string, Figure>());</p><p></p><p> Figure toAddFigure = new Figure(PartName, part.Attribute("id").Value, part.Attribute("gender").Value, part.Attribute("colorable").Value);</p><p></p><p> if (!_parts[PartName].ContainsKey(part.Attribute("id").Value))</p><p> _parts[PartName].Add(part.Attribute("id").Value, toAddFigure);</p><p> }</p><p> }</p><p> }</p><p> catch (Exception e)</p><p> {</p><p> Console.WriteLine(e.ToString());</p><p> //Was the file found?</p><p> }</p><p> }</p><p></p><p> public string RunLook(string Look)</p><p> {</p><p> List<string> toReturnFigureParts = new List<string>();</p><p> List<string> fParts = new List<string>();</p><p> string[] requiredParts = { "hd", "ch" };</p><p> bool flagForDefault = false;</p><p></p><p> string[] FigureParts = Look.Split('.');</p><p> string genderLook = GetLookGender(Look);</p><p></p><p> foreach (string Part in FigureParts.ToList())</p><p> {</p><p> string newPart = Part;</p><p> string[] tPart = Part.Split('-');</p><p> if (tPart.Count() < 2)</p><p> {</p><p> flagForDefault = true;</p><p> continue;</p><p> }</p><p></p><p> string partName = tPart[0];</p><p> string partId = tPart[1];</p><p></p><p> if (!_parts.ContainsKey(partName) || !_parts[partName].ContainsKey(partId) || (genderLook != "U" && _parts[partName][partId].Gender != "U" && _parts[partName][partId].Gender != genderLook))</p><p> {</p><p> if (partName == "hd" && partId == "99999")</p><p> {</p><p> if (tPart.Count() == 2)</p><p> {</p><p> newPart = SetDefault(partName, genderLook);</p><p> }</p><p> }</p><p> else</p><p> {</p><p> newPart = SetDefault(partName, genderLook);</p><p> }</p><p> }</p><p></p><p> if (!fParts.Contains(partName)) fParts.Add(partName);</p><p> if (!toReturnFigureParts.Contains(newPart)) toReturnFigureParts.Add(newPart);</p><p> }</p><p></p><p> if (flagForDefault)</p><p> {</p><p> toReturnFigureParts.Clear();</p><p> toReturnFigureParts.AddRange("sh-3338-93.ea-1406-62.hr-831-49.ha-3331-92.hd-180-7.ch-3334-93-1408.lg-3337-92.ca-1813-62".Split('.'));</p><p> }</p><p></p><p> foreach (string requiredPart in requiredParts.Where(requiredPart => !fParts.Contains(requiredPart) && !toReturnFigureParts.Contains(SetDefault(requiredPart, genderLook))))</p><p> {</p><p> toReturnFigureParts.Add(SetDefault(requiredPart, genderLook));</p><p> }</p><p></p><p> return string.Join(".", toReturnFigureParts);</p><p> }</p><p></p><p> private string GetLookGender(string Look)</p><p> {</p><p> string[] FigureParts = Look.Split('.');</p><p></p><p> foreach (string Part in FigureParts.ToList())</p><p> {</p><p> string[] tPart = Part.Split('-');</p><p> if (tPart.Count() < 2)</p><p> continue;</p><p></p><p> string partName = tPart[0];</p><p> string partId = tPart[1];</p><p></p><p> return this._parts.ContainsKey(partName) && this._parts[partName].ContainsKey(partId) ? this._parts[partName][partId].Gender : "U";</p><p> }</p><p> return "U";</p><p> }</p><p></p><p> private string SetDefault(string partName, string Gender)</p><p> {</p><p> string partId = "0";</p><p> if (this._parts.ContainsKey(partName))</p><p> {</p><p> KeyValuePair<string, Figure> part = _parts[partName].FirstOrDefault(x => x.Value.Gender == Gender || Gender == "U");</p><p> partId = part.Equals(default(KeyValuePair<string, Figure>)) ? "0" : part.Key;</p><p> }</p><p> return partName + "-" + partId + "-1";</p><p> }</p><p> }</p><p></p><p> class Figure</p><p> {</p><p> private string Part;</p><p> private string PartId;</p><p> public string Gender;</p><p> private string Colorable;</p><p></p><p> public Figure(string Part, string PartId, string Gender, string Colorable)</p><p> {</p><p> this.Part = Part;</p><p> this.PartId = PartId;</p><p> this.Gender = Gender;</p><p> this.Colorable = Colorable;</p><p> }</p><p> }</p><p>}[/CODE]</p><p></p><p>When I went into hotel, my characters were fully white and chats were not showing up, but mouths were moving.</p></blockquote><p></p>
[QUOTE="WanknessHD, post: 395357, member: 3511"] [CODE]using System; using System.Linq; using System.Xml.Linq; using System.Collections.Generic; using System.Net; using System.IO; using System.Xml; using System.Windows.Forms; namespace Plus.HabboHotel.Global { public class AntiMutant { private Dictionary<string, Dictionary<string, Figure>> _parts; public AntiMutant() { _parts = new Dictionary<string, Dictionary<string, Figure>>(); Init(); } public void Init() { if (this._parts.Count > 0) this._parts.Clear(); try { XDocument Doc = XDocument.Load(PlusEnvironment.GetConfig().data["figuredata"]); var data = (from item in Doc.Descendants("sets") from tItem in Doc.Descendants("settype") select new { Part = tItem.Elements("set"), Type = tItem.Attribute("type"), }); foreach (var item in data.ToList()) { foreach (var part in item.Part.ToList()) { string PartName = item.Type.Value; if (!_parts.ContainsKey(PartName)) _parts.Add(PartName, new Dictionary<string, Figure>()); Figure toAddFigure = new Figure(PartName, part.Attribute("id").Value, part.Attribute("gender").Value, part.Attribute("colorable").Value); if (!_parts[PartName].ContainsKey(part.Attribute("id").Value)) _parts[PartName].Add(part.Attribute("id").Value, toAddFigure); } } } catch (Exception e) { Console.WriteLine(e.ToString()); //Was the file found? } } public string RunLook(string Look) { List<string> toReturnFigureParts = new List<string>(); List<string> fParts = new List<string>(); string[] requiredParts = { "hd", "ch" }; bool flagForDefault = false; string[] FigureParts = Look.Split('.'); string genderLook = GetLookGender(Look); foreach (string Part in FigureParts.ToList()) { string newPart = Part; string[] tPart = Part.Split('-'); if (tPart.Count() < 2) { flagForDefault = true; continue; } string partName = tPart[0]; string partId = tPart[1]; if (!_parts.ContainsKey(partName) || !_parts[partName].ContainsKey(partId) || (genderLook != "U" && _parts[partName][partId].Gender != "U" && _parts[partName][partId].Gender != genderLook)) { if (partName == "hd" && partId == "99999") { if (tPart.Count() == 2) { newPart = SetDefault(partName, genderLook); } } else { newPart = SetDefault(partName, genderLook); } } if (!fParts.Contains(partName)) fParts.Add(partName); if (!toReturnFigureParts.Contains(newPart)) toReturnFigureParts.Add(newPart); } if (flagForDefault) { toReturnFigureParts.Clear(); toReturnFigureParts.AddRange("sh-3338-93.ea-1406-62.hr-831-49.ha-3331-92.hd-180-7.ch-3334-93-1408.lg-3337-92.ca-1813-62".Split('.')); } foreach (string requiredPart in requiredParts.Where(requiredPart => !fParts.Contains(requiredPart) && !toReturnFigureParts.Contains(SetDefault(requiredPart, genderLook)))) { toReturnFigureParts.Add(SetDefault(requiredPart, genderLook)); } return string.Join(".", toReturnFigureParts); } private string GetLookGender(string Look) { string[] FigureParts = Look.Split('.'); foreach (string Part in FigureParts.ToList()) { string[] tPart = Part.Split('-'); if (tPart.Count() < 2) continue; string partName = tPart[0]; string partId = tPart[1]; return this._parts.ContainsKey(partName) && this._parts[partName].ContainsKey(partId) ? this._parts[partName][partId].Gender : "U"; } return "U"; } private string SetDefault(string partName, string Gender) { string partId = "0"; if (this._parts.ContainsKey(partName)) { KeyValuePair<string, Figure> part = _parts[partName].FirstOrDefault(x => x.Value.Gender == Gender || Gender == "U"); partId = part.Equals(default(KeyValuePair<string, Figure>)) ? "0" : part.Key; } return partName + "-" + partId + "-1"; } } class Figure { private string Part; private string PartId; public string Gender; private string Colorable; public Figure(string Part, string PartId, string Gender, string Colorable) { this.Part = Part; this.PartId = PartId; this.Gender = Gender; this.Colorable = Colorable; } } }[/CODE] When I went into hotel, my characters were fully white and chats were not showing up, but mouths were moving. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Tutorials
[PlusEMU] No Need for Extra Folder
Top