예제 #1
0
 private void handleDisconnect(object sender, OnDisconnectEventArgs e)
 {
     Console.WriteLine("Client \"" + this.name + "\" lost Connection!");
     this.state = ClientStates.DISCONNECTED;
     this.server.closeRoom(this.room, this, "Client lost connection!");
     this.handler.CloseConnection();
     this.server.removeClient(this);
 }
예제 #2
0
        protected virtual void EmitDisconnectEvent()
        {
            Console.WriteLine("Client disconnected!");
            this.CloseConnection();
            OnDisconnectEventArgs e = new OnDisconnectEventArgs(this.lastContact);
            EventHandler <OnDisconnectEventArgs> handler = onDisconnect;

            if (handler != null)
            {
                handler(this, e);
            }
        }