Esempio n. 1
0
 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)));
     }
 }
Esempio n. 2
0
 public bool FindClient(string username, out AmTcpClient connection)
 {
     return(m_clients.TryGetValue(username, out connection));
 }
Esempio n. 3
0
 public bool RemoveClient(string username, out AmTcpClient clientConnection)
 {
     m_roomManager.UnsubscribeAllRooms(username);
     return(m_clients.TryRemove(username, out clientConnection));
 }
Esempio n. 4
0
 public bool AddClient(string username, AmTcpClient connection)
 {
     return(m_clients.TryAdd(username, connection));
 }