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="Sledmore" data-source="post: 214743" data-attributes="member: 591"><p>Hai,</p><p> </p><p>I recently released some fixes on another forum so I thought I'd release them here too for people who do not use the other forum.</p><p> </p><p><strong>Emulator:</strong> Swift Emulator</p><p><strong>Revision:</strong> RELEASE63-201302211227-19310969</p><p> </p><p><strong>Change game port:</strong></p><p>[spoiler="Game Port"]</p><p>This fix is only for running more than one instance of this emulator on the same machine server times.</p><p> </p><p><strong>Do the following:</strong></p><p> </p><p><strong>Add the following line to your configuration.ini file:</strong></p><p>[CODE]data.socket.port=PORT INTEGER HERE[/CODE]</p><p><strong>Search for the following in the emulator:</strong></p><p>[PHP]DataSocket.SetupListener(42);[/PHP]</p><p><strong>Note, it may not be 42, it may be the hexadecimal value '0x2a', which would be:</strong></p><p>[PHP]DataSocket.SetupListener(0x2a);[/PHP]</p><p><strong>Replace it with:</strong></p><p>[PHP]DataSocket.SetupListener(int.Parse(ButterflyEnvironment.GetConfig().data["data.socket.port"]));[/PHP]</p><p>[/spoiler]</p><p><strong>Profiles fix (Load registration via users table/on login):</strong></p><p>[spoiler="Profiles fix (Load registration via users table/on login)"]</p><p>Profiles do work, your error is probably due to not having `users_info` or `user_info` table (I forgot which as I've changed this), I've made mine check via the users registration timestamp from `users` table, if you'd like to do this then do the following:</p><p> </p><p>(Note: there is two ways to this, one a simple query (loads each time profile is opened) or do it on user login, like I have below):</p><p> </p><p><strong>Find the following in GameClinetMessageHandler:</strong></p><p>[PHP]internal void LoadProfile()[/PHP]</p><p> </p><p><strong>Remove the following:</strong></p><p>[PHP]DataRow Info;</p><p>using (IQueryAdapter adapter = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())</p><p>{</p><p>adapter.setQuery("SELECT `reg_timestamp` FROM `user_info` WHERE user_id = '" + habbo.Id + "'");</p><p>Info = adapter.getRow();</p><p>}[/PHP]</p><p><strong>And further down (in the same void) remove this:</strong></p><p>[PHP]this.Response.AppendString(UnixTimeStampToDateTime((double)Info["reg_timestamp"]).ToShortDateString());[/PHP]</p><p><strong>Replace it with:</strong></p><p>[PHP]DateTime origin = new DateTime(1970, 1, 1, 0, 0, 0, 0);</p><p>DateTime regdate = origin.AddSeconds(Convert.ToDouble(habbo.regTimestamp));</p><p>this.Response.AppendString(regdate.ToString("dd/MM/yyyy"));[/PHP]</p><p><strong>You will have an error, this is where the next step comes in, find the following in Habbo.cs:</strong></p><p>[PHP]internal string LastOnline;[/PHP]</p><p><strong>Add below or above it:</strong></p><p>[PHP]internal string regTimestamp;[/PHP]</p><p><strong>In the same file find:</strong></p><p>[PHP]internal Habbo(uint Id, string Username, string RealName, uint Rank, string Motto, string Look, string Gender, int Credits, int ActivityPoints, int Crystals, double LastActivityPointsUpdate, bool Muted, uint HomeRoom, int Respect, int DailyRespectPoints, int DailyPetRespectPoints, bool MutantPenalty, bool HasFriendRequestsDisabled, int achievementPoints, string LastOnline, string quests, string queststates, bool canchangename, int favoriteGroup, bool PassedQuiz, int pointsOnline)[/PHP]</p><p><strong>Replace with:</strong></p><p>[PHP]internal Habbo(uint Id, string Username, string RealName, uint Rank, string Motto, string Look, string Gender, int Credits, int ActivityPoints, int Crystals, double LastActivityPointsUpdate, bool Muted, uint HomeRoom, int Respect, int DailyRespectPoints, int DailyPetRespectPoints, bool MutantPenalty, bool HasFriendRequestsDisabled, int achievementPoints, string regTimestamp, string LastOnline, string quests, string queststates, bool canchangename, int favoriteGroup, bool PassedQuiz, int pointsOnline)[/PHP]</p><p><strong>In the same file/void find:</strong></p><p>[PHP]this.LastOnline = DateTime.Now.ToString();[/PHP]</p><p><strong>Add above or below it:</strong></p><p>[PHP]this.regTimestamp = DateTime.Now.ToString();[/PHP]</p><p> </p><p><strong>Next in HabboFactoy.cs find:</strong></p><p>[PHP]string lastOnline = (string)dRow["last_online"];[/PHP]</p><p><strong>Add above or below it:</strong></p><p>[PHP]string regTimestamp = (string)dRow["account_created"];[/PHP]</p><p> </p><p><strong>In the same file find: 'lastOnline', add next to it 'regTimestamp,'.</strong></p><p> </p><p>And that should tackle that.</p><p>[/spoiler]</p><p><strong>Game Center updated packets and adding the disabled packet:</strong></p><p>[spoiler="Game Center missing packets and disabled packet"]</p><p>I haven't really finished this as I'm about to do something else so I will update you later, but I've updated some packets and added the game center disabled packet to the handler, here we go!</p><p> </p><p><strong>Incoming.cs:</strong></p><p>(I'm not going to show what to replace, but they're all located in a similar place).</p><p> </p><p>[PHP]</p><p>Incoming.GetGames = 892;// 2498;</p><p>Incoming.GetGame = 1215;// 39;</p><p>Incoming.Game2LeaveGameMessageComposer = 850;// 42;</p><p>Incoming.Game2GameChatMessageComposer = 2113;// 1462;</p><p>Incoming.Game2SetUserMoveTargetMessageComposer = 1835;// 1630;</p><p>Incoming.Game2LoadStageReadyMessageComposer = 3770;// 270;</p><p>Incoming.GameCenterEnabled = 13;//Not sure of previous.</p><p>[/PHP]</p><p> </p><p><strong>In the same file search for:</strong></p><p>[PHP]public static int Game2SetUserMoveTargetMessageComposer;[/PHP]</p><p> </p><p><strong>And add under it:</strong></p><p>[PHP]public static int GameCenterEnabled;[/PHP]</p><p> </p><p><strong>Outgoing.cs:</strong></p><p>(Again, I'm not going to show what to replace as I've lost that now).</p><p> </p><p>[PHP]Outgoing.GetRankInGame = 1563;// 1414;</p><p>Outgoing.CreateWar = 1519;// 2737; // I think this one is wrong - Sledmore</p><p>Outgoing.AddToNewGame = 3849;// 2200;</p><p>Outgoing.LeaveGame = 3757;// 3543;</p><p>Outgoing.StartCounter = 430;// 2155;</p><p>Outgoing.SetStep1 = 2656;// 3828;</p><p>Outgoing.Game2EnterArenaMessageEvent = 1864;// 811;</p><p>Outgoing.Game2ArenaEnteredMessageEvent = 133;// 2312;</p><p>Outgoing.Game2StageStillLoadingMessageEvent = 1283;// 1048;</p><p>Outgoing.Game2StageLoadMessageEvent = 2502;// 1125;</p><p>Outgoing.Game2StageStartingMessageEvent = 2900;// 2942;</p><p>Outgoing.Game2GameChatFromPlayerMessageEvent = 1577;// 483;</p><p>Outgoing.Game2StageRunningMessageEvent = 1184;// 2975;</p><p>Outgoing.Game2PlayerExitedGameArenaMessageEvent = 1956;// 2050;</p><p>Outgoing.Game2GameStatusMessageEvent = 2352;// 275;[/PHP]</p><p> </p><p>Now to add the new packet to the handler..</p><p> </p><p><strong>Find the following in StaticClientMessageHandler:</strong></p><p>[PHP]handlers.Add(Incoming.GetRelationshipsProfile, new StaticRequestHandler(SharedPacketLib.GetRelationshipsProfile));[/PHP]</p><p> </p><p><strong>Add under it:</strong></p><p>[PHP]handlers.Add(Incoming.GameCenterEnabled, new StaticRequestHandler(SharedPacketLib.GameCenterEnabled));[/PHP]</p><p> </p><p><strong>Next, in SharedPacketLib.cs find the following:</strong></p><p>[PHP]public static void EventTracker(GameClientMessageHandler handler)[/PHP]</p><p> </p><p><strong>Add under it:</strong></p><p>[PHP]public static void GameCenterEnabled(GameClientMessageHandler handler)</p><p>{</p><p>handler.GameCenterEnabled();</p><p>}[/PHP]</p><p> </p><p><strong>Next in GameClientMessageHandler.cs find:</strong></p><p>[PHP]internal void Whisper()[/PHP]</p><p> </p><p><strong>And UNDER THAT VOID:</strong></p><p>[PHP]internal void GameCenterEnabled()</p><p>{</p><p>Session.SendNotif("Game Center is currently not enabled!");</p><p>}[/PHP]</p><p> </p><p>And that should be it, if I've missed anything or broken anything at your end please let me know, haha this all works for me, but I've not saved the previous work so I may have miss-placed something for you.</p><p> </p><p><strong>Oh and just a quick tip; if you do want the Game Center make sure to have this in your variables:</strong></p><p>[CODE]game.center.enabled=true[/CODE]</p><p>if you set it to false the new packet we added to the handler will display! <img src="/styles/default/xenforo/smilies/emojione/smile.png" class="smilie" loading="lazy" alt=":)" title="Smile :)" data-shortname=":)" /></p><p>[/spoiler]</p><p> </p><p>I'll update this thread with other fixes I make, but sometime soon I'm going to just update to another revision anyway.</p></blockquote><p></p>
[QUOTE="Sledmore, post: 214743, member: 591"] Hai, I recently released some fixes on another forum so I thought I'd release them here too for people who do not use the other forum. [B]Emulator:[/B] Swift Emulator [B]Revision:[/B] RELEASE63-201302211227-19310969 [B]Change game port:[/B] [spoiler="Game Port"] This fix is only for running more than one instance of this emulator on the same machine server times. [B]Do the following:[/B] [B]Add the following line to your configuration.ini file:[/B] [CODE]data.socket.port=PORT INTEGER HERE[/CODE] [B]Search for the following in the emulator:[/B] [PHP]DataSocket.SetupListener(42);[/PHP] [B]Note, it may not be 42, it may be the hexadecimal value '0x2a', which would be:[/B] [PHP]DataSocket.SetupListener(0x2a);[/PHP] [B]Replace it with:[/B] [PHP]DataSocket.SetupListener(int.Parse(ButterflyEnvironment.GetConfig().data["data.socket.port"]));[/PHP] [/spoiler] [B]Profiles fix (Load registration via users table/on login):[/B] [spoiler="Profiles fix (Load registration via users table/on login)"] Profiles do work, your error is probably due to not having `users_info` or `user_info` table (I forgot which as I've changed this), I've made mine check via the users registration timestamp from `users` table, if you'd like to do this then do the following: (Note: there is two ways to this, one a simple query (loads each time profile is opened) or do it on user login, like I have below): [B]Find the following in GameClinetMessageHandler:[/B] [PHP]internal void LoadProfile()[/PHP] [B]Remove the following:[/B] [PHP]DataRow Info; using (IQueryAdapter adapter = ButterflyEnvironment.GetDatabaseManager().getQueryreactor()) { adapter.setQuery("SELECT `reg_timestamp` FROM `user_info` WHERE user_id = '" + habbo.Id + "'"); Info = adapter.getRow(); }[/PHP] [B]And further down (in the same void) remove this:[/B] [PHP]this.Response.AppendString(UnixTimeStampToDateTime((double)Info["reg_timestamp"]).ToShortDateString());[/PHP] [B]Replace it with:[/B] [PHP]DateTime origin = new DateTime(1970, 1, 1, 0, 0, 0, 0); DateTime regdate = origin.AddSeconds(Convert.ToDouble(habbo.regTimestamp)); this.Response.AppendString(regdate.ToString("dd/MM/yyyy"));[/PHP] [B]You will have an error, this is where the next step comes in, find the following in Habbo.cs:[/B] [PHP]internal string LastOnline;[/PHP] [B]Add below or above it:[/B] [PHP]internal string regTimestamp;[/PHP] [B]In the same file find:[/B] [PHP]internal Habbo(uint Id, string Username, string RealName, uint Rank, string Motto, string Look, string Gender, int Credits, int ActivityPoints, int Crystals, double LastActivityPointsUpdate, bool Muted, uint HomeRoom, int Respect, int DailyRespectPoints, int DailyPetRespectPoints, bool MutantPenalty, bool HasFriendRequestsDisabled, int achievementPoints, string LastOnline, string quests, string queststates, bool canchangename, int favoriteGroup, bool PassedQuiz, int pointsOnline)[/PHP] [B]Replace with:[/B] [PHP]internal Habbo(uint Id, string Username, string RealName, uint Rank, string Motto, string Look, string Gender, int Credits, int ActivityPoints, int Crystals, double LastActivityPointsUpdate, bool Muted, uint HomeRoom, int Respect, int DailyRespectPoints, int DailyPetRespectPoints, bool MutantPenalty, bool HasFriendRequestsDisabled, int achievementPoints, string regTimestamp, string LastOnline, string quests, string queststates, bool canchangename, int favoriteGroup, bool PassedQuiz, int pointsOnline)[/PHP] [B]In the same file/void find:[/B] [PHP]this.LastOnline = DateTime.Now.ToString();[/PHP] [B]Add above or below it:[/B] [PHP]this.regTimestamp = DateTime.Now.ToString();[/PHP] [B]Next in HabboFactoy.cs find:[/B] [PHP]string lastOnline = (string)dRow["last_online"];[/PHP] [B]Add above or below it:[/B] [PHP]string regTimestamp = (string)dRow["account_created"];[/PHP] [B]In the same file find: 'lastOnline', add next to it 'regTimestamp,'.[/B] And that should tackle that. [/spoiler] [B]Game Center updated packets and adding the disabled packet:[/B] [spoiler="Game Center missing packets and disabled packet"] I haven't really finished this as I'm about to do something else so I will update you later, but I've updated some packets and added the game center disabled packet to the handler, here we go! [B]Incoming.cs:[/B] (I'm not going to show what to replace, but they're all located in a similar place). [PHP] Incoming.GetGames = 892;// 2498; Incoming.GetGame = 1215;// 39; Incoming.Game2LeaveGameMessageComposer = 850;// 42; Incoming.Game2GameChatMessageComposer = 2113;// 1462; Incoming.Game2SetUserMoveTargetMessageComposer = 1835;// 1630; Incoming.Game2LoadStageReadyMessageComposer = 3770;// 270; Incoming.GameCenterEnabled = 13;//Not sure of previous. [/PHP] [B]In the same file search for:[/B] [PHP]public static int Game2SetUserMoveTargetMessageComposer;[/PHP] [B]And add under it:[/B] [PHP]public static int GameCenterEnabled;[/PHP] [B]Outgoing.cs:[/B] (Again, I'm not going to show what to replace as I've lost that now). [PHP]Outgoing.GetRankInGame = 1563;// 1414; Outgoing.CreateWar = 1519;// 2737; // I think this one is wrong - Sledmore Outgoing.AddToNewGame = 3849;// 2200; Outgoing.LeaveGame = 3757;// 3543; Outgoing.StartCounter = 430;// 2155; Outgoing.SetStep1 = 2656;// 3828; Outgoing.Game2EnterArenaMessageEvent = 1864;// 811; Outgoing.Game2ArenaEnteredMessageEvent = 133;// 2312; Outgoing.Game2StageStillLoadingMessageEvent = 1283;// 1048; Outgoing.Game2StageLoadMessageEvent = 2502;// 1125; Outgoing.Game2StageStartingMessageEvent = 2900;// 2942; Outgoing.Game2GameChatFromPlayerMessageEvent = 1577;// 483; Outgoing.Game2StageRunningMessageEvent = 1184;// 2975; Outgoing.Game2PlayerExitedGameArenaMessageEvent = 1956;// 2050; Outgoing.Game2GameStatusMessageEvent = 2352;// 275;[/PHP] Now to add the new packet to the handler.. [B]Find the following in StaticClientMessageHandler:[/B] [PHP]handlers.Add(Incoming.GetRelationshipsProfile, new StaticRequestHandler(SharedPacketLib.GetRelationshipsProfile));[/PHP] [B]Add under it:[/B] [PHP]handlers.Add(Incoming.GameCenterEnabled, new StaticRequestHandler(SharedPacketLib.GameCenterEnabled));[/PHP] [B]Next, in SharedPacketLib.cs find the following:[/B] [PHP]public static void EventTracker(GameClientMessageHandler handler)[/PHP] [B]Add under it:[/B] [PHP]public static void GameCenterEnabled(GameClientMessageHandler handler) { handler.GameCenterEnabled(); }[/PHP] [B]Next in GameClientMessageHandler.cs find:[/B] [PHP]internal void Whisper()[/PHP] [B]And UNDER THAT VOID:[/B] [PHP]internal void GameCenterEnabled() { Session.SendNotif("Game Center is currently not enabled!"); }[/PHP] And that should be it, if I've missed anything or broken anything at your end please let me know, haha this all works for me, but I've not saved the previous work so I may have miss-placed something for you. [B]Oh and just a quick tip; if you do want the Game Center make sure to have this in your variables:[/B] [CODE]game.center.enabled=true[/CODE] if you set it to false the new packet we added to the handler will display! :) [/spoiler] I'll update this thread with other fixes I make, but sometime soon I'm going to just update to another revision anyway. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Releases
Swift Emulator fixes.
Top