private static void UnregisterHandlers(IonTcpConnection connection) { connection .AddHandler(206, PacketHandlerPriority.DefaultAction, ProcessEncryptionRequest) .AddHandler(204, PacketHandlerPriority.DefaultAction, ProcessSSOTicket) .AddHandler(2002, PacketHandlerPriority.DefaultAction, ProcessSessionRequest); }
/// <summary> /// Stops the client, removes this user from room, updates last online values etc. /// </summary> public void Stop() { // Leave room // Update last online mHabbo = null; mConnection = null; mMessageHandler.Destroy(); mMessageHandler = null; }
/// <summary> /// Ensure that the online values are present. /// ALWAYS CALL StopLoggedInValues() WHEN YOU ARE FINISHED! /// </summary> public void StartLoggedInValues(IonTcpConnection Connection) { OnlineValueCounter++; if (OnlineValueCounter == 1) { this.fPonged = true; this.fFuseRights = Core.GetFuseManager().GetUserRights(this.fID); this.fSessionValues = new Dictionary <object, object>(); } }
internal PacketProcessor(User User) { this.fUser = User; IonTcpConnection Connection = this.fUser.GetConnection(); Type ThisType = typeof(PacketProcessor); Connection.AddHandler(196, PacketHandlerPriority.DefaultAction, ThisType.GetMethod("Process_Pong")); Connection.AddHandler(204, PacketHandlerPriority.DefaultAction, ThisType.GetMethod("Process_SSOTicket")); Connection.AddHandler(206, PacketHandlerPriority.DefaultAction, ThisType.GetMethod("Process_InitCrypto")); }
/// <summary> /// Cleans up the online values when nobody is using them. /// </summary> public void StopLoggedInValues() { OnlineValueCounter--; if (OnlineValueCounter == 0) { this.fConnection = null; this.fPacketSender = null; this.fPacketProcessor = null; this.fSessionValues = null; this.fFuseRights = null; } }
private static void RegisterHandlers(object source, ConnectionEventArgs args) { IonTcpConnection connection = source as IonTcpConnection; if (connection == null) { return; } connection. AddHandler(2002, PacketHandlerPriority.DefaultAction, ProcessSessionRequest). AddHandler(206, PacketHandlerPriority.DefaultAction, ProcessEncryptionRequest). AddHandler(204, PacketHandlerPriority.DefaultAction, ProcessSSOTicket); }
/// <summary> /// Creates a minimal User object. /// This is not cached and is only used after the user connects but before logging in. /// Do not use this user for custom features. Use a cached version. /// </summary> /// <param name="Connection">The connection this user is for.</param> /// <returns>A mostly non-function user.</returns> public User GetPreLoginUser(IonTcpConnection Connection) { return(new User(Connection)); }
/// <summary> /// Construct a prelogin User object. /// DO NOT USE THIS FOR GETTING A USER - USE THE USER DISTRIBUTOR /// </summary> internal Habbo(IonTcpConnection connection) { _connection = connection; }
public void LoginMerge(Habbo loggedInUser) { _connection = loggedInUser._connection; _connection.Habbo = this; }
/// <summary> /// Construct a prelogin User object. /// DO NOT USE THIS FOR GETTING A USER - USE THE USER DISTRIBUTOR /// </summary> internal User(IonTcpConnection Connection) { this.fConnection = Connection; this.fPacketSender = new PacketSender(this); this.fPacketProcessor = new PacketProcessor(this); }
/// <summary> /// Creates a minimal Habbo object. /// This is not cached and is only used after the Habbo connects but before logging in. /// Do not use this Habbo for custom features. Use a cached version. /// </summary> /// <param name = "connection">The Connection this Habbo is for.</param> /// <returns>A mostly non-function Habbo.</returns> public Habbo GetPreLoginHabbo(IonTcpConnection connection) { return(new Habbo(connection)); }
/// <summary> /// Constructs a GameClient instance for a given client ID. /// </summary> /// <param name="clientID">The ID of this client.</param> public GameClient(uint clientID) { mID = clientID; mConnection = IonEnvironment.GetTcpConnections().GetConnection(clientID); mMessageHandler = new ClientMessageHandler(this); }