Exemple #1
0
 public void AddClientToQueue(NetworkConnection clientConnection, ClientInitializeGamePackage initData)
 {
     if (Matchmaking.AddRequestToQueue(clientConnection.ClientSession.SessionID, initData.GamePlayerCount, initData.PlayerTeamwish))
     {
         m_waitingClientConnections.Add(clientConnection);
         SendMatchmakingStatus(clientConnection, string.Format(WAITING_IN_QUEUE, TotalPlayersOnlineCallback(), TotalPlayersSearching()));
         clientConnection.ConnectionDiedEvent += RemoveConnection;
     }
     else
     {
         SendMatchmakingError(clientConnection, INVALID_REQUEST);
     }
 }
        private void HandleGameRequest(NetworkConnection connection, PackageInterface request)
        {
            ClientInitializeGamePackage initPackage = request as ClientInitializeGamePackage;

            switch (initPackage.Request)
            {
            case ClientInitializeGamePackage.RequestType.Matchmaking:
                ConnectionsReadyForQueingUpToMatchmaking.Remove(connection);
                OnMatchmakingRequest?.Invoke(this, connection, request);
                break;

            case ClientInitializeGamePackage.RequestType.Observe:
                ConnectionsReadyForQueingUpToMatchmaking.Remove(connection);
                OnObserverRequest?.Invoke(this, connection);
                break;
            }
        }
Exemple #3
0
 public QueueRequest(NetworkConnection connection, ClientInitializeGamePackage initData)
 {
     Connection = connection;
     InitData   = initData;
 }