示例#1
0
        protected static bool IsGameJoinable(JoinRandomGameRequest joinRequest, ILobbyPeer peer, GameState gameState)
        {
            if (!gameState.IsJoinable)
            {
                return(false);
            }

            if (!gameState.SupportsProtocol(peer.NetworkProtocol))
            {
                return(false);
            }

            return(!gameState.CheckUserIdOnJoin ||
                   (!gameState.ContainsUser(peer.UserId) &&
                    !gameState.IsUserInExcludeList(peer.UserId) &&
                    gameState.CheckSlots(peer.UserId, joinRequest.AddUsers)));
        }