Esempio n. 1
0
        public void HostGame(bool publicMatch, int maxPlayers, Match.MatchType matchType)
        {
            string matchID = MatchMaker.GetRandomMatchID();

            CmdHostGame(matchID, publicMatch, maxPlayers, matchType);
            PrintIdentity();
        }
Esempio n. 2
0
        /*
         * 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);
        }
        public static bool IsOtherSeniorMatch(this Match.MatchType t)
        {
            switch (t)
            {
            case Match.MatchType.ClubCompetitiveInternational:
            case Match.MatchType.ClubCompetitiveInternationalCupRules:
                return(true);

            default:
                return(false);
            }
        }
        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);
            }
        }
Esempio n. 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);
     }
 }
Esempio n. 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);
            }
        }
 public static bool IsNonSeniorMatch(this Match.MatchType t)
 {
     return(!(t.IsLeagueMatch() || t.IsCupMatch() || t.IsQualifierMatch() || t.IsFriendlyMatch() || t.IsOtherSeniorMatch()));
 }
 public static bool IsCompetitiveSeniorMatch(this Match.MatchType t)
 {
     return(t.IsLeagueMatch() || t.IsCupMatch() || t.IsQualifierMatch() || t.IsOtherSeniorMatch());
 }
 public static bool IsCupMatch(this Match.MatchType t)
 {
     return(t == Match.MatchType.ClubCompetitiveCup);
 }
 public static bool IsQualifierMatch(this Match.MatchType t)
 {
     return(t == Match.MatchType.ClubCompetitiveQualifier);
 }
 public static bool IsLeagueMatch(this Match.MatchType t)
 {
     return(t == Match.MatchType.ClubCompetitiveLeague);
 }