コード例 #1
0
        public void HostGame(bool publicMatch, int maxPlayers, Match.MatchType matchType)
        {
            string matchID = MatchMaker.GetRandomMatchID();

            CmdHostGame(matchID, publicMatch, maxPlayers, matchType);
            PrintIdentity();
        }
コード例 #2
0
ファイル: Expression.cs プロジェクト: jean/phosphorusfive
        /*
         * Initializes expression type, and optionally a conversion type
         */
        private void InitializeType(string token)
        {
            // this is our last token, storing it as "expression type", and optionally a "convert", before ending iteration
            string typeOfExpression = null;

            if (token.IndexOf('.') != -1)
            {
                _convert         = token.Substring(token.IndexOf('.') + 1);
                typeOfExpression = token.Substring(0, token.IndexOf('.'));
            }
            else
            {
                typeOfExpression = token;
            }
            switch (typeOfExpression)
            {
            case "name":
            case "value":
            case "node":
            case "count":
                break;

            default:
                throw new ExpressionException(Value, "Type declaration of expression was not valid");
            }
            _expressionType = (Match.MatchType)Enum.Parse(typeof(Match.MatchType), typeOfExpression);
        }
コード例 #3
0
        public static bool IsOtherSeniorMatch(this Match.MatchType t)
        {
            switch (t)
            {
            case Match.MatchType.ClubCompetitiveInternational:
            case Match.MatchType.ClubCompetitiveInternationalCupRules:
                return(true);

            default:
                return(false);
            }
        }
コード例 #4
0
        public static bool IsFriendlyMatch(this Match.MatchType t)
        {
            switch (t)
            {
            case Match.MatchType.ClubFriendly:
            case Match.MatchType.ClubFriendlyCupRules:
            case Match.MatchType.ClubFriendlyInternational:
            case Match.MatchType.ClubFriendlyInternationalCupRules:
                return(true);

            default:
                return(false);
            }
        }
コード例 #5
0
 void CmdHostGame(string _matchID, bool publicMatch, int maxPlayers, Match.MatchType matchType)
 {
     matchID = _matchID;
     if (MatchMaker.instance.HostGame(_matchID, gameObject, publicMatch, out playerIndex, maxPlayers, matchType))
     {
         Debug.Log($"<color=green>Game hosted successfully</color>");
         networkMatchChecker.matchId = _matchID.ToGuid();
         TargetHostGame(true, _matchID, playerIndex);
     }
     else
     {
         Debug.Log($"<color=red>Game hosted failed</color>");
         TargetHostGame(false, _matchID, playerIndex);
     }
 }
コード例 #6
0
        public bool HostGame(string _matchID, GameObject _player, bool publicMatch, out int playerIndex, int maxPlayers, Match.MatchType matchType)
        {
            playerIndex = -1;
            Debug.Log("estoy llamando HOST GAME");

            if (!matchIDs.Contains(_matchID))
            {
                matchIDs.Add(_matchID);
                Match match = new Match(_matchID, _player, publicMatch, maxPlayers, matchType);
                matches.Add(match);
                Debug.Log($"Match generated");
                _player.GetComponent <PlayerNetwork>().currentMatch = match;

                for (int i = 0; i < matches.Count; i++)
                {
                    if (matches[i].matchID == _matchID)
                    {
                        roomListManager.FillListHost(matches[i].players.ToArray(), _matchID);
                    }
                }

                playerIndex = 1;
                return(true);
            }
            else
            {
                Debug.Log($"Match ID already exists");
                return(false);
            }
        }
コード例 #7
0
 public static bool IsNonSeniorMatch(this Match.MatchType t)
 {
     return(!(t.IsLeagueMatch() || t.IsCupMatch() || t.IsQualifierMatch() || t.IsFriendlyMatch() || t.IsOtherSeniorMatch()));
 }
コード例 #8
0
 public static bool IsCompetitiveSeniorMatch(this Match.MatchType t)
 {
     return(t.IsLeagueMatch() || t.IsCupMatch() || t.IsQualifierMatch() || t.IsOtherSeniorMatch());
 }
コード例 #9
0
 public static bool IsCupMatch(this Match.MatchType t)
 {
     return(t == Match.MatchType.ClubCompetitiveCup);
 }
コード例 #10
0
 public static bool IsQualifierMatch(this Match.MatchType t)
 {
     return(t == Match.MatchType.ClubCompetitiveQualifier);
 }
コード例 #11
0
 public static bool IsLeagueMatch(this Match.MatchType t)
 {
     return(t == Match.MatchType.ClubCompetitiveLeague);
 }