예제 #1
0
 void UpdateHostList()
 {
     if (MasterServer.PollHostList().Length != 0 && joingame)
     {
         joingame = false;
         timer.Clear();
         Debug.Log("Host List Received");
         HostData[] hostData = MasterServer.PollHostList();
         string[]   ips      = hostData.SelectMany(a => a.ip).ToArray();
         _Popup.ShowPopup("Server List Received " + hostData.Length + ", Connecting");
         Network.Connect(ips, 5300);
         for (int i = 0; i < hostData.Length; i++)
         {
             _Popup.popupText = "Trying Connect to " + hostData[i].gameName;
             Network.Connect(hostData[i]);
         }
         MasterServer.ClearHostList();
     }
 }