Esempio n. 1
0
    // Callback funtion for request to get online matchList
    public void OnMatchList(bool success, string extendedInfo, List <MatchInfoSnapshot> matchList)
    {
        Debug.Log("Got Response for Internet Server List");
        OnLocalMatchList();
        if (success)
        {
            foreach (MatchInfoSnapshot matchInfo in matchList)
            {
                MatchJoiner match = OnlineMatch.GetMatchJoiner(matchInfo);
                AddToList(match);
            }
            if (roomListParent.transform.childCount == 1)
            {
                ServerListStatus.text = "No active servers at the moment.";
            }
            else
            {
                ServerListStatus.text = "Server list ready.";
            }
        }
        else
        {
            if (roomListParent.transform.childCount == 1)
            {
                ServerListStatus.text = "Couldn't connect to Internet. No LAN servers at the moment.";
            }
            else
            {
                ServerListStatus.text = "Couldn't connect to Internet. Showing Local Serves.";
            }

            return;
        }
    }
Esempio n. 2
0
 /// <summary>
 /// Create object of LANMatch/OnlineMatch. This function is called by UI Event.
 /// </summary>
 public void SetServerTypeLocal(bool isLocalServer)
 {
     if (isLocalServer)
     {
         match = LANMatch.GetMatchCreator(networkDiscovery);
     }
     else
     {
         match = OnlineMatch.GetMatchCreator();
     }
 }