Example #1
0
 private void OnDisconnect(DisconnectPacket p)
 {
     if (Disconnect != null) Disconnect.Invoke(this, new PacketEventArgs<DisconnectPacket>(p));
 }
Example #2
0
        public static void ReadDisconnect(Client client, PacketReader reader)
        {
            DisconnectPacket dp = new DisconnectPacket();
            dp.Read(reader);

            if (!reader.Failed)
                Client.HandlePacketDisconnect(client, dp);
        }
Example #3
0
 public static void HandlePacketDisconnect(Client client, DisconnectPacket packet)
 {
     client.Logger.Log(Logger.LogLevel.Info, client.Owner.DisplayName + " disconnected: " + packet.Reason);
     client.Stop();
 }
Example #4
0
        public static void HandlePacketDisconnect(TestClient client, DisconnectPacket dp)
        {
            client.Dispose();

            using (StreamWriter sw = new StreamWriter(String.Format("disconnect_reason_{0}.log", client.UserName), true))
            {
                sw.WriteLine("{0} - {1}", DateTime.Now, dp.Reason);
            }
        }