public void Disconnect() { networkStream.Close(); socket.Close(); Server.clients.Remove(this); Server.NotifyAll(name + " left the server"); }
private static void AddClient(Client client) { if (clients.Count >= maxPlayers) { Server.NotifyAll("Server full!"); return; } clients.Add(client); if (clients.Count == 1) { client.admin = true; } Server.NotifyAll(client.name + " joined the server!"); }