protected override Response handle_Connect(string username, AmTcpClient newConnection) { if (AddClient(username, newConnection)) { return(new Response(true, "")); } else { return(new Response(false, String.Format("Username '{0}' is taken.", username))); } }
public bool FindClient(string username, out AmTcpClient connection) { return(m_clients.TryGetValue(username, out connection)); }
public bool RemoveClient(string username, out AmTcpClient clientConnection) { m_roomManager.UnsubscribeAllRooms(username); return(m_clients.TryRemove(username, out clientConnection)); }
public bool AddClient(string username, AmTcpClient connection) { return(m_clients.TryAdd(username, connection)); }