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.
Emulator: Swift Emulator
Revision: RELEASE63-201302211227-19310969
Change game port:
Profiles fix (Load registration via users table/on login):
Game Center updated packets and adding the disabled packet:
I'll update this thread with other fixes I make, but sometime soon I'm going to just update to another revision anyway.
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.
Emulator: Swift Emulator
Revision: RELEASE63-201302211227-19310969
Change game port:
This fix is only for running more than one instance of this emulator on the same machine server times.
Do the following:
Add the following line to your configuration.ini file:
Search for the following in the emulator:
Note, it may not be 42, it may be the hexadecimal value '0x2a', which would be:
Replace it with:
Do the following:
Add the following line to your configuration.ini file:
Code:
data.socket.port=PORT INTEGER HERE
PHP:
DataSocket.SetupListener(42);
PHP:
DataSocket.SetupListener(0x2a);
PHP:
DataSocket.SetupListener(int.Parse(ButterflyEnvironment.GetConfig().data["data.socket.port"]));
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):
Find the following in GameClinetMessageHandler:
Remove the following:
And further down (in the same void) remove this:
Replace it with:
You will have an error, this is where the next step comes in, find the following in Habbo.cs:
Add below or above it:
In the same file find:
Replace with:
In the same file/void find:
Add above or below it:
Next in HabboFactoy.cs find:
Add above or below it:
In the same file find: 'lastOnline', add next to it 'regTimestamp,'.
And that should tackle that.
(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):
Find the following in GameClinetMessageHandler:
PHP:
internal void LoadProfile()
Remove the following:
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:
this.Response.AppendString(UnixTimeStampToDateTime((double)Info["reg_timestamp"]).ToShortDateString());
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:
internal string LastOnline;
PHP:
internal string regTimestamp;
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:
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:
this.LastOnline = DateTime.Now.ToString();
PHP:
this.regTimestamp = DateTime.Now.ToString();
Next in HabboFactoy.cs find:
PHP:
string lastOnline = (string)dRow["last_online"];
PHP:
string regTimestamp = (string)dRow["account_created"];
In the same file find: 'lastOnline', add next to it 'regTimestamp,'.
And that should tackle that.
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!
Incoming.cs:
(I'm not going to show what to replace, but they're all located in a similar place).
In the same file search for:
And add under it:
Outgoing.cs:
(Again, I'm not going to show what to replace as I've lost that now).
Now to add the new packet to the handler..
Find the following in StaticClientMessageHandler:
Add under it:
Next, in SharedPacketLib.cs find the following:
Add under it:
Next in GameClientMessageHandler.cs find:
And UNDER THAT VOID:
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.
Oh and just a quick tip; if you do want the Game Center make sure to have this in your variables:
if you set it to false the new packet we added to the handler will display!
Incoming.cs:
(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.
In the same file search for:
PHP:
public static int Game2SetUserMoveTargetMessageComposer;
And add under it:
PHP:
public static int GameCenterEnabled;
Outgoing.cs:
(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;
Now to add the new packet to the handler..
Find the following in StaticClientMessageHandler:
PHP:
handlers.Add(Incoming.GetRelationshipsProfile, new StaticRequestHandler(SharedPacketLib.GetRelationshipsProfile));
Add under it:
PHP:
handlers.Add(Incoming.GameCenterEnabled, new StaticRequestHandler(SharedPacketLib.GameCenterEnabled));
Next, in SharedPacketLib.cs find the following:
PHP:
public static void EventTracker(GameClientMessageHandler handler)
Add under it:
PHP:
public static void GameCenterEnabled(GameClientMessageHandler handler)
{
handler.GameCenterEnabled();
}
Next in GameClientMessageHandler.cs find:
PHP:
internal void Whisper()
And UNDER THAT VOID:
PHP:
internal void GameCenterEnabled()
{
Session.SendNotif("Game Center is currently not enabled!");
}
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.
Oh and just a quick tip; if you do want the Game Center make sure to have this in your variables:
Code:
game.center.enabled=true
I'll update this thread with other fixes I make, but sometime soon I'm going to just update to another revision anyway.