/// <summary> /// Stops the Connection, disconnects the socket and disposes used resources. /// </summary> internal void Stop() { if (!IsAlive()) return; // Already stopped if (Habbo.IsLoggedIn()) { Habbo.SetLoggedIn(false); CoreManager.ServerCore.GetStandardOut().PrintNotice("Connection stopped [" + GetIPAddressString() + ", " + Habbo.GetUsername() + ']'); } else { CoreManager.ServerCore.GetStandardOut().PrintNotice("Connection stopped [" + GetIPAddressString() + ", UNKNOWN]"); } try { _socket.Close(); } catch (NullReferenceException) { throw; } _socket = null; _dataBuffer = null; _dataReceivedCallback = null; }
private static void ProcessHabboInfoRequest(Habbo sender, IncomingMessage message) { new MHabboData { Figure = sender.GetFigure() as HabboFigure, Motto = sender.GetMotto(), HabboID = sender.GetID(), Username = sender.GetUsername() }.Send(sender); }