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; } }
public QueueRequest(NetworkConnection connection, ClientInitializeGamePackage initData) { Connection = connection; InitData = initData; }