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); }
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); } }