void Start() { searchPanel.SetActive(false); gameConfiguration = FindObjectOfType <GameConfiguration>(); searchGlass = FindObjectOfType <SearchGlass>(); StartCoroutine(HidePanel()); IEnumerator HidePanel() { yield return(new WaitForSeconds(1f)); switch (gameConfiguration.role) { case 0: NetworkManager.singleton.StartHost(); networkDiscovery.AdvertiseServer(); loadingPanel.SetActive(false); break; case 1: searchPanel.SetActive(true); loadingPanel.SetActive(false); networkDiscovery.StartDiscovery(); StartCoroutine(UpdateAndAttemptConnection()); break; } } }
public void RefreshServerList() { CheckForManagers(); ClearServerList(); NetworkDiscovery.StartDiscovery(); }
//TODO: Always search for active servers (Update, coroutine) while in menu scene public void FindServers() { //Find available servers networkDiscovery.StartDiscovery(); //search for more servers Debug.Log("Discovered Servers: " + discoveredServers.Count); CheckRooms(); }
//Buscar Partida******************************************** public void Discovery() { BotonBuscar.SetActive(false); TextoBuscando.SetActive(true); discoveredServers.Clear(); networkDiscovery.StartDiscovery(); StartCoroutine(BuscarServidores()); }
void Discovery() { networkDiscovery.StartDiscovery(); print(networkDiscoveryHUD.discoveredServers.Count); foreach (ServerResponse info in networkDiscoveryHUD.discoveredServers.Values) { if (networkDiscoveryHUD.discoveredServers.Count > 0) { jionBtnText.color = Color.red; jionBtnText.text = info.EndPoint.Address.ToString(); } print(info.EndPoint.Address.ToString()); serverResponse = info; } }
void DrawGUI() { GUILayout.BeginHorizontal(); var options = new GUILayoutOption[] { GUILayout.Height(80), GUILayout.Width(120) }; if (GUILayout.Button("Find Servers", options)) { discoveredServers.Clear(); networkDiscovery.StartDiscovery(); } // LAN Host if (GUILayout.Button("Start Host", options)) { discoveredServers.Clear(); NetworkManager.singleton.StartHost(); networkDiscovery.AdvertiseServer(); } // Dedicated server if (GUILayout.Button("Start Server", options)) { discoveredServers.Clear(); NetworkManager.singleton.StartServer(); networkDiscovery.AdvertiseServer(); } GUILayout.EndHorizontal(); // show list of found server GUILayout.Label($"Discovered Servers [{discoveredServers.Count}]:"); // servers scrollViewPos = GUILayout.BeginScrollView(scrollViewPos); foreach (ServerResponse info in discoveredServers.Values) { if (GUILayout.Button(info.EndPoint.Address.ToString(), options)) { Connect(info); } } GUILayout.EndScrollView(); }
// ------------------------------------------- /* * Start */ public override void Start() { base.Start(); if (m_networkDiscovery == null) { m_networkDiscovery = GetComponent <NetworkDiscovery>(); m_networkDiscovery.OnServerFound.AddListener(OnDiscoveredServer); } m_discovering = true; m_networkDiscovery.StartDiscovery(); BasicSystemEventController.Instance.BasicSystemEvent += new BasicSystemEventHandler(OnBasicSystemEvent); BasicSystemEventController.Instance.DelayBasicSystemEvent(EVENT_MIRRORDISCOVERYCONTROLLER_TIMEOUT_DISCOVERY, 5); Debug.LogError("%%%%%%%%%% MirrorDiscoveryController::START SEARCHING FOR A SERVER..."); }
public void listening() { discoveredServers.Clear(); _discovery.StartDiscovery(); }
public void StartDiscovery() { discoveredServers.Clear(); networkDiscovery.StartDiscovery(); }
public void FindServers() { networkDiscovery.StartDiscovery(); }
public void OnFindServers() { discoveredServers.Clear(); networkDiscovery.StartDiscovery(); StartCoroutine(PopulateUIWithServerInfo()); }