Exemplo n.º 1
0
        void WorldConnection_OnDisconnect(object sender, InterLib.Networking.SessionCloseEventArgs e)
        {
            if (IsAZone)
            {
                this.OnPacket -= new EventHandler<InterPacketReceivedEventArgs>(WorldConnection_OnPacket);
                this.OnDisconnect -= new EventHandler<InterLib.Networking.SessionCloseEventArgs>(WorldConnection_OnDisconnect);

                ZoneConnection derp;
                if (Program.Zones.TryRemove(ID, out derp))
                {
                    Log.WriteLine(LogLevel.Info, "Zone {0} disconnected.", ID);
                    InterHandler.SendZoneStopped(ID);
                }
                else
                {
                    Log.WriteLine(LogLevel.Info, "Could not remove zone {0}!?", ID);
                }
            }
        }
Exemplo n.º 2
0
 void WorldConnection_OnDisconnect(object sender, InterLib.Networking.SessionCloseEventArgs e)
 {
     if (IsAWorld)
     {
         this.OnPacket -= new EventHandler<InterPacketReceivedEventArgs>(WorldConnection_OnPacket);
         this.OnDisconnect -= new EventHandler<InterLib.Networking.SessionCloseEventArgs>(WorldConnection_OnDisconnect);
         WorldConnection derp;
         if (WorldManager.Instance.Worlds.TryRemove(ID, out derp))
         {
             Log.WriteLine(LogLevel.Info, "World {0} disconnected.", ID);
         }
         else
         {
             Log.WriteLine(LogLevel.Info, "Could not remove world {0}!?", ID);
         }
     }
 }