コード例 #1
0
 /// <summary>
 /// Removes a specific connection to the connection queue.
 /// </summary>
 public void RemoveFromQueue(ConnectionCore connection)
 {
     if (ConnectionQueue.Contains(connection))
     {
         ConnectionQueue.Remove(connection);
         ServerLogger.PrivateRoom($"Removed {connection.ConnectionData.Username} ({connection.ConnectionData.ClientIP.ToString()}) from the privatechatroom queue");
     }
 }
コード例 #2
0
        /// <summary>
        /// Adds a specific connection to the connection queue.
        /// </summary>
        public void AddToQueue(ConnectionCore connection)
        {
            if (ConnectionQueue.Contains(connection))
            {
                return;
            }

            ServerLogger.PrivateRoom($"Added {connection.ConnectionData.Username} ({connection.ConnectionData.ClientIP.ToString()}) to the private chatroom queue");
            ConnectionQueue.Enqueue(connection);

            if (ConnectionQueue.Count >= 2)
            {
                CreatePrivateRoom(2);
            }
        }