Aww you release one of my sources... :P
Credits to:-
- Holograph (for encoding, decoding and the asynchronous sockets)
- AWA for the requests.cs, getting received strings and numbers and response.cs
- Ion for the storage, teehee :)
Anyway, it's fairly neat, although it can be improved on.
Was a development with someone, that's why the name of some folders are, in somewhat would say, shotty :D
Well here are some snippets of the neater parts in the emulator
(HabboHotel/Client/Global.cs)
Code:using System; using System.Collections.Generic; using System.Data; using System.Text; using Storage; namespace embis.HabboHotel.Session { public partial class Client { private void InitConnection() { Response.Initialize(257); // "DA" Response.AppendInt32(9); Response.AppendInt32(0); Response.AppendInt32(0); Response.AppendInt32(1); Response.AppendInt32(1); Response.AppendInt32(3); Response.AppendInt32(0); Response.AppendInt32(2); Response.AppendInt32(1); Response.AppendInt32(4); Response.AppendInt32(0); Response.AppendInt32(5); Response.AppendString("dd-MM-yyyy"); Response.AppendInt32(7); Response.AppendBoolean(false); Response.AppendInt32(8); Response.AppendString("hotel-co.uk"); Response.AppendInt32(9); Response.AppendBoolean(false); SendResponse(); Response.Initialize(277); // "DU" Response.Append("576b145a0c17f8a385971e0b6324a4bc"); SendResponse(); } private void Login() { string SSOticket = Request.PopString().Replace("'", ""); if (SSOticket.Length > 0) { using (DatabaseClient dbClient = Program.GetDatabase().GetClient()) { dbClient.AddParamWithValue("sso", SSOticket); if (dbClient.ReadBoolean("SELECT id FROM users WHERE sso_ticket = @sso;")) { dbClient.ExecuteQuery("UPDATE users SET SockId = '" + SocketID + "' WHERE username = '" + dbClient.ReadString("SELECT username FROM users WHERE sso_ticket = @sso;") + "'"); Response.Initialize(3); // "@C" SendResponse(); //Initalize the credits GetCredits(); } } } } private void RegisterGlobal() { mRequestHandlers[206] = new RequestHandler(InitConnection); mRequestHandlers[415] = new RequestHandler(Login); } } }






