private void CloseConnectionAction(Individual individ) { if (individ.Name == null) { Console.WriteLine("Client with {0} disconnected without logging in.\n", individ.ConnectionInfo()); individ.CloseConnection(); } else { string connectionInfo = individ.ConnectionInfo(); Exit(individ); Console.WriteLine("Person {0} with {1} disconnected.\n", individ.Name, connectionInfo); } }
private void Exit(Individual normalPerson) { Leave(normalPerson.Name); normalPerson.CloseConnection(); Broadcast(new Message(normalPerson.Name + " is offline."), null); }