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 Releases
Swift Emulator Fixes
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="zMagenta" data-source="post: 220381" data-attributes="member: 4512"><p>Hello! As most people are using Swift Emulator, I thought I'd release the fixes for them here, just for the DevBest users. I will credit each fix to the rightful coder.</p><p> </p><p>--------------------</p><p> </p><p><strong>Command - :givecrystals</strong></p><p>[SPOILER]</p><p>1 - Search in <strong>HabboHotel/misc/ChatCommandHandler.cs</strong> for</p><p>[CODE]internal void giveCrystals()[/CODE]</p><p>2 - replace the void with this</p><p>[CODE]internal void giveCrystals()</p><p> {</p><p> GameClient clientByUsername = null;</p><p> Room currentRoom = this.Session.GetHabbo().CurrentRoom;</p><p> clientByUsername = ButterflyEnvironment.GetGame().GetClientManager().GetClientByUsername(this.Params[1]);</p><p> if (clientByUsername != null)</p><p> {</p><p> int num;</p><p> if (int.TryParse(this.Params[2], out num))</p><p> {</p><p> clientByUsername.GetHabbo().Crystals += num;</p><p> clientByUsername.GetHabbo().GiveUserCrystals(int.Parse(this.Params[2]));</p><p> clientByUsername.GetHabbo().UpdateDiamondsBalance();</p><p> clientByUsername.SendNotif(this.Session.GetHabbo().Username + LanguageLocale.GetValue("crystal.awardmessage1") + num.ToString() + LanguageLocale.GetValue("crystal.awardmessage2"));</p><p> this.Session.SendNotif(LanguageLocale.GetValue("crystal.updateok"));</p><p> }</p><p> else</p><p> {</p><p> this.Session.SendNotif(LanguageLocale.GetValue("input.intonly"));</p><p> }</p><p> }</p><p> else</p><p> {</p><p> this.Session.SendNotif(LanguageLocale.GetValue("input.usernotfound"));</p><p> }</p><p> }[/CODE]</p><p> </p><p>3 - Now search in <strong>HabboHotel/Habbo/Users/Habbo.cs</strong> for this</p><p>[CODE]internal void UpdateActivityPointsBalance(int NotifAmount)[/CODE]</p><p> </p><p>4 - Add above it, this</p><p>[CODE]internal void UpdateDiamondsBalance()</p><p> {</p><p> this.mClient.GetMessageHandler().GetResponse().Init(Outgoing.ActivityPoints);</p><p> this.mClient.GetMessageHandler().GetResponse().AppendInt32(1);</p><p> this.mClient.GetMessageHandler().GetResponse().AppendInt32(105);</p><p> this.mClient.GetMessageHandler().GetResponse().AppendInt32(this.Crystals);</p><p> this.mClient.GetMessageHandler().SendResponse();</p><p> }internal void UpdateDiamondsBalance()</p><p> {</p><p> this.mClient.GetMessageHandler().GetResponse().Init(Outgoing.ActivityPoints);</p><p> this.mClient.GetMessageHandler().GetResponse().AppendInt32(1);</p><p> this.mClient.GetMessageHandler().GetResponse().AppendInt32(105);</p><p> this.mClient.GetMessageHandler().GetResponse().AppendInt32(this.Crystals);</p><p> this.mClient.GetMessageHandler().SendResponse();</p><p> }[/CODE]</p><p> </p><p>5 - Add this to your <strong>bin/Debug/System/locale.ini</strong></p><p>[CODE]crystal.awardmessage1= has awarded you</p><p>crystal.awardmessage2= crystals!</p><p>crystal.updateok=Crystal balance updated successfully.[/CODE]</p><p> </p><p>6 - Add this to your <strong>bin/Debug/System/commands_register.ini</strong> file</p><p>[CODE]giveCrystals=59[/CODE]</p><p> </p><p>7 - Add this to your <strong>bin/Debug/System/commands.ini</strong> file</p><p>[CODE][giveCrystals]</p><p>giveCrystals.minrank=5</p><p>giveCrystals.description=Give Crystals</p><p>giveCrystals.prefix=</p><p>giveCrystals.input=crystals</p><p>giveCrystals.clubs=[/CODE]</p><p>[/SPOILER]</p><p> </p><p>--------------------</p><p> </p><p><strong>Core - FilterWord edit</strong></p><p> </p><p>[SPOILER]</p><p>1 - Go to <strong>core/LanguageLocale.cs</strong> and replace for this for</p><p>[CODE]using System;</p><p>using System.Collections.Generic;</p><p>using System.Linq;</p><p>using System.Text;</p><p>using System.IO;</p><p>using Database_Manager.Database.Session_Details.Interfaces;</p><p>using System.Data;</p><p>using System.Text.RegularExpressions;</p><p> </p><p>namespace Butterfly.Core</p><p>{</p><p> class LanguageLocale</p><p> {</p><p> private static Dictionary<string, string> values;</p><p> internal static bool welcomeAlertEnabled;</p><p> internal static string welcomeAlert;</p><p> </p><p> private static List<string> swearwords;</p><p> </p><p> internal static void Init()</p><p> {</p><p> values = IniReader.ReadFile(System.IO.Path.Combine(System.Windows.Forms.Application.StartupPath, @"System/locale.ini"));</p><p> InitWelcomeMessage();</p><p> }</p><p> </p><p> internal static void InitSwearWord()</p><p> {</p><p> swearwords = new List<string>();</p><p> DataTable dTable;</p><p> using (IQueryAdapter dbClient = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())</p><p> {</p><p> dbClient.setQuery("SELECT word FROM room_swearword_filter");</p><p> dTable = dbClient.getTable();</p><p> }</p><p> </p><p> string swearWord;</p><p> foreach (DataRow dRow in dTable.Rows)</p><p> {</p><p> swearWord = (string)dRow[0];</p><p> swearwords.Add(swearWord);</p><p> }</p><p> </p><p> }</p><p> </p><p> private static void InitWelcomeMessage()</p><p> {</p><p> Dictionary<string, string> configFile = IniReader.ReadFile(System.IO.Path.Combine(System.Windows.Forms.Application.StartupPath, @"System/welcome_config.ini"));</p><p> welcomeAlertEnabled = configFile["welcome.alert.enabled"] == "true";</p><p> </p><p> if (welcomeAlertEnabled)</p><p> {</p><p> welcomeAlert = File.ReadAllText(System.IO.Path.Combine(System.Windows.Forms.Application.StartupPath, @"System/welcome_message.ini"));</p><p> }</p><p> }</p><p> </p><p> private static string ReplaceEx(string original,</p><p> string pattern, string replacement)</p><p> {</p><p> int count, position0, position1;</p><p> count = position0 = position1 = 0;</p><p> string upperString = original.ToUpper();</p><p> string upperPattern = pattern.ToUpper();</p><p> int inc = (original.Length / pattern.Length) *</p><p> (replacement.Length - pattern.Length);</p><p> char[] chars = new char[original.Length + Math.Max(0, inc)];</p><p> while ((position1 = upperString.IndexOf(upperPattern,</p><p> position0)) != -1)</p><p> {</p><p> for (int i = position0; i < position1; ++i)</p><p> chars[count++] = original[i];</p><p> for (int i = 0; i < replacement.Length; ++i)</p><p> chars[count++] = replacement[i];</p><p> position0 = position1 + pattern.Length;</p><p> }</p><p> if (position0 == 0) return original;</p><p> for (int i = position0; i < original.Length; ++i)</p><p> chars[count++] = original[i];</p><p> return new string(chars, 0, count);</p><p> }</p><p> </p><p> internal static string FilterSwearwords(string original)</p><p> {</p><p> </p><p> foreach (string word in swearwords)</p><p> {</p><p> original = ReplaceEx(original, word, "bobba");</p><p> }</p><p> return original;</p><p> }</p><p> </p><p> internal static string GetValue(string value)</p><p> {</p><p> if (!values.ContainsKey(value))</p><p> {</p><p> throw new MissingLocaleException("Missing language locale for [" + value + "]");</p><p> }</p><p> return values[value];</p><p> }</p><p> </p><p> class MissingLocaleException : Exception</p><p> {</p><p> public MissingLocaleException(string message)</p><p> : base(message)</p><p> {</p><p> </p><p> }</p><p> }</p><p> }</p><p>}[/CODE]</p><p><em>The next is for people without the filter turned on.</em></p><p> </p><p>2 - Go to <strong>HabboHotel/Rooms/RoomUser.cs</strong> and search for</p><p>[CODE]//Message = LanguageLocale.FilterSwearwords(Message);[/CODE]</p><p>and remove the '//'</p><p>[/SPOILER]</p><p> </p><p>--------------------</p><p> </p><p><strong>Core - ChatLogs being logged into the DB</strong></p><p> </p><p>[SPOILER]</p><p>1 - Go to your <strong>HabboHotel/Rooms/RoomUser.cs</strong> and put this</p><p>[CODE]if (!this.IsPet && !this.IsBot)</p><p> {</p><p> using (IQueryAdapter adapter = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())</p><p> {</p><p> adapter.setQuery("INSERT INTO chatlogs (user_id, room_id, message, timestamp, user_name) VALUES (@user, @room, [URL='http://devbest.com/members/message.10634/']Message[/URL], [URL='http://devbest.com/members/time.25891/']Time[/URL], [URL='http://devbest.com/members/username.1633/']Username[/URL])");</p><p> adapter.addParameter("user", Session.GetHabbo().Id);</p><p> adapter.addParameter("room", RoomId);</p><p> adapter.addParameter("message", Message);</p><p> adapter.addParameter("time", ButterflyEnvironment.GetUnixTimestamp());</p><p> adapter.addParameter("username", Session.GetHabbo().Username);</p><p> adapter.runQuery();</p><p> }</p><p> }[/CODE]</p><p><strong>above</strong></p><p>[CODE]Message = LanguageLocale.FilterSwearwords(Message);[/CODE]</p><p>[/SPOILER]</p><p> </p><p>--------------------</p><p> </p><p><strong>Furni - One way gate fix</strong></p><p> </p><p>[SPOILER]</p><p>1 - Search in HabboEvents/Incoming.cs find</p><p>[CODE]Incoming.OneWayGate = 1151;[/CODE]</p><p>change to</p><p>[CODE]Incoming.OneWayGate = 3999;[/CODE]</p><p>[/SPOILER]</p><p> </p><p><strong>Whole Emulator Download / More information</strong></p><p> </p><p>If you do not know how to do this, you can download the fixed version. Click one of the links below. <strong><span style="color: #ff0000">Please be aware this does not contain the crystals fix!</span></strong></p><p> </p><p><a href="https://mega.co.nz/#!lg8zRACK!Y633hjgQmH-XHEPIYAnEMF39jdw4DqGcpqS9UStoM1M" target="_blank">https://mega.co.nz/#!lg8zRACK!Y633hjgQmH-XHEPIYAnEMF39jdw4DqGcpqS9UStoM1M</a></p><p> </p><p><a href="http://www.mirrorcreator.com/files/1XHLOC38/fixed.rar_links" target="_blank">http://www.mirrorcreator.com/files/1XHLOC38/fixed.rar_links</a></p><p> </p><p><a href="http://uber-hotel.net.com/fixed.rar" target="_blank">http://uber-hotel.net.com/fixed.rar</a> (Thanks to <a href="http://devbest.com/members/worldcomer.36021/" target="_blank">Worldcomer</a> )</p><p>Enjoy the fixes - I'll update more once I find them.</p></blockquote><p></p>
[QUOTE="zMagenta, post: 220381, member: 4512"] Hello! As most people are using Swift Emulator, I thought I'd release the fixes for them here, just for the DevBest users. I will credit each fix to the rightful coder. -------------------- [B]Command - :givecrystals[/B] [SPOILER] 1 - Search in [B]HabboHotel/misc/ChatCommandHandler.cs[/B] for [CODE]internal void giveCrystals()[/CODE] 2 - replace the void with this [CODE]internal void giveCrystals() { GameClient clientByUsername = null; Room currentRoom = this.Session.GetHabbo().CurrentRoom; clientByUsername = ButterflyEnvironment.GetGame().GetClientManager().GetClientByUsername(this.Params[1]); if (clientByUsername != null) { int num; if (int.TryParse(this.Params[2], out num)) { clientByUsername.GetHabbo().Crystals += num; clientByUsername.GetHabbo().GiveUserCrystals(int.Parse(this.Params[2])); clientByUsername.GetHabbo().UpdateDiamondsBalance(); clientByUsername.SendNotif(this.Session.GetHabbo().Username + LanguageLocale.GetValue("crystal.awardmessage1") + num.ToString() + LanguageLocale.GetValue("crystal.awardmessage2")); this.Session.SendNotif(LanguageLocale.GetValue("crystal.updateok")); } else { this.Session.SendNotif(LanguageLocale.GetValue("input.intonly")); } } else { this.Session.SendNotif(LanguageLocale.GetValue("input.usernotfound")); } }[/CODE] 3 - Now search in [B]HabboHotel/Habbo/Users/Habbo.cs[/B] for this [CODE]internal void UpdateActivityPointsBalance(int NotifAmount)[/CODE] 4 - Add above it, this [CODE]internal void UpdateDiamondsBalance() { this.mClient.GetMessageHandler().GetResponse().Init(Outgoing.ActivityPoints); this.mClient.GetMessageHandler().GetResponse().AppendInt32(1); this.mClient.GetMessageHandler().GetResponse().AppendInt32(105); this.mClient.GetMessageHandler().GetResponse().AppendInt32(this.Crystals); this.mClient.GetMessageHandler().SendResponse(); }internal void UpdateDiamondsBalance() { this.mClient.GetMessageHandler().GetResponse().Init(Outgoing.ActivityPoints); this.mClient.GetMessageHandler().GetResponse().AppendInt32(1); this.mClient.GetMessageHandler().GetResponse().AppendInt32(105); this.mClient.GetMessageHandler().GetResponse().AppendInt32(this.Crystals); this.mClient.GetMessageHandler().SendResponse(); }[/CODE] 5 - Add this to your [B]bin/Debug/System/locale.ini[/B] [CODE]crystal.awardmessage1= has awarded you crystal.awardmessage2= crystals! crystal.updateok=Crystal balance updated successfully.[/CODE] 6 - Add this to your [B]bin/Debug/System/commands_register.ini[/B] file [CODE]giveCrystals=59[/CODE] 7 - Add this to your [B]bin/Debug/System/commands.ini[/B] file [CODE][giveCrystals] giveCrystals.minrank=5 giveCrystals.description=Give Crystals giveCrystals.prefix= giveCrystals.input=crystals giveCrystals.clubs=[/CODE] [/SPOILER] -------------------- [B]Core - FilterWord edit[/B] [SPOILER] 1 - Go to [B]core/LanguageLocale.cs[/B] and replace for this for [CODE]using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; using Database_Manager.Database.Session_Details.Interfaces; using System.Data; using System.Text.RegularExpressions; namespace Butterfly.Core { class LanguageLocale { private static Dictionary<string, string> values; internal static bool welcomeAlertEnabled; internal static string welcomeAlert; private static List<string> swearwords; internal static void Init() { values = IniReader.ReadFile(System.IO.Path.Combine(System.Windows.Forms.Application.StartupPath, @"System/locale.ini")); InitWelcomeMessage(); } internal static void InitSwearWord() { swearwords = new List<string>(); DataTable dTable; using (IQueryAdapter dbClient = ButterflyEnvironment.GetDatabaseManager().getQueryreactor()) { dbClient.setQuery("SELECT word FROM room_swearword_filter"); dTable = dbClient.getTable(); } string swearWord; foreach (DataRow dRow in dTable.Rows) { swearWord = (string)dRow[0]; swearwords.Add(swearWord); } } private static void InitWelcomeMessage() { Dictionary<string, string> configFile = IniReader.ReadFile(System.IO.Path.Combine(System.Windows.Forms.Application.StartupPath, @"System/welcome_config.ini")); welcomeAlertEnabled = configFile["welcome.alert.enabled"] == "true"; if (welcomeAlertEnabled) { welcomeAlert = File.ReadAllText(System.IO.Path.Combine(System.Windows.Forms.Application.StartupPath, @"System/welcome_message.ini")); } } private static string ReplaceEx(string original, string pattern, string replacement) { int count, position0, position1; count = position0 = position1 = 0; string upperString = original.ToUpper(); string upperPattern = pattern.ToUpper(); int inc = (original.Length / pattern.Length) * (replacement.Length - pattern.Length); char[] chars = new char[original.Length + Math.Max(0, inc)]; while ((position1 = upperString.IndexOf(upperPattern, position0)) != -1) { for (int i = position0; i < position1; ++i) chars[count++] = original[i]; for (int i = 0; i < replacement.Length; ++i) chars[count++] = replacement[i]; position0 = position1 + pattern.Length; } if (position0 == 0) return original; for (int i = position0; i < original.Length; ++i) chars[count++] = original[i]; return new string(chars, 0, count); } internal static string FilterSwearwords(string original) { foreach (string word in swearwords) { original = ReplaceEx(original, word, "bobba"); } return original; } internal static string GetValue(string value) { if (!values.ContainsKey(value)) { throw new MissingLocaleException("Missing language locale for [" + value + "]"); } return values[value]; } class MissingLocaleException : Exception { public MissingLocaleException(string message) : base(message) { } } } }[/CODE] [I]The next is for people without the filter turned on.[/I] 2 - Go to [B]HabboHotel/Rooms/RoomUser.cs[/B] and search for [CODE]//Message = LanguageLocale.FilterSwearwords(Message);[/CODE] and remove the '//' [/SPOILER] -------------------- [B]Core - ChatLogs being logged into the DB[/B] [SPOILER] 1 - Go to your [B]HabboHotel/Rooms/RoomUser.cs[/B] and put this [CODE]if (!this.IsPet && !this.IsBot) { using (IQueryAdapter adapter = ButterflyEnvironment.GetDatabaseManager().getQueryreactor()) { adapter.setQuery("INSERT INTO chatlogs (user_id, room_id, message, timestamp, user_name) VALUES (@user, @room, [URL='http://devbest.com/members/message.10634/']Message[/URL], [URL='http://devbest.com/members/time.25891/']Time[/URL], [URL='http://devbest.com/members/username.1633/']Username[/URL])"); adapter.addParameter("user", Session.GetHabbo().Id); adapter.addParameter("room", RoomId); adapter.addParameter("message", Message); adapter.addParameter("time", ButterflyEnvironment.GetUnixTimestamp()); adapter.addParameter("username", Session.GetHabbo().Username); adapter.runQuery(); } }[/CODE] [B]above[/B] [CODE]Message = LanguageLocale.FilterSwearwords(Message);[/CODE] [/SPOILER] -------------------- [B]Furni - One way gate fix[/B] [SPOILER] 1 - Search in HabboEvents/Incoming.cs find [CODE]Incoming.OneWayGate = 1151;[/CODE] change to [CODE]Incoming.OneWayGate = 3999;[/CODE] [/SPOILER] [B]Whole Emulator Download / More information[/B] If you do not know how to do this, you can download the fixed version. Click one of the links below. [B][COLOR=#ff0000]Please be aware this does not contain the crystals fix![/COLOR][/B] [URL]https://mega.co.nz/#!lg8zRACK!Y633hjgQmH-XHEPIYAnEMF39jdw4DqGcpqS9UStoM1M[/URL] [URL]http://www.mirrorcreator.com/files/1XHLOC38/fixed.rar_links[/URL] [URL]http://uber-hotel.net.com/fixed.rar[/URL] (Thanks to [URL='http://devbest.com/members/worldcomer.36021/']Worldcomer[/URL] ) Enjoy the fixes - I'll update more once I find them. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Releases
Swift Emulator Fixes
Top