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