private void StopDiscovery() { if (myNetworkDiscovery.running) { myNetworkDiscovery.StopBroadcast(); } }
/** Callback functions **/ public void OnConnected(NetworkMessage netMsg) { Debug.Log("Connected :" + netMsg.conn.address); isConnecting = true; // if started as client if (!NetworkServer.active) { Debug.Log("client 停止广播接收"); sendUid(); discovery.StopBroadcast(); GameManager.Instance.gameUI.SetExplainText("已连接至服务器,请准备"); } else { GameManager.Instance.gameUI.SetExplainText("有客户端加入房间,请准备"); } }
public void CreateRoom() { soundManager.SFX_MenuButtonPlay(); soundManager.FindingLobbyTrackPlay(); UIAnimator.SetBool("Find_Waiting", false); UIAnimator.SetBool("Create_waiting", true); CreateRoomBtn.SetActive(false); DifficultyLevelDropDownPanel.SetActive(false); FindRoomBtn.SetActive(true); switch (DifficultyLevel.value) { case 0: CharacterLife.difficultyLevel = global::DifficultyLevel.NormalWitch; break; case 1: CharacterLife.difficultyLevel = global::DifficultyLevel.EvilWitch; break; case 2: CharacterLife.difficultyLevel = global::DifficultyLevel.CrazyWitch; break; default: break; } networkDiscovery.StopBroadcast(); var newHost = networkManager.StartHost(); if (newHost == null) { StopCoroutine(ShowError()); StartCoroutine(ShowError()); } //networkManager.StartHost(); networkDiscovery.StartBroadcast(); }
void Cleanup() { isInDelayedStart = false; if (discovery != null && discovery.running && discovery.isActiveAndEnabled) { discovery.StopBroadcast(); } if (IsClientConnected()) { StopClient(); } StopHost(); }
public override void OnStopServer() { m_NetworkDiscovery.StopBroadcast(); }
public void EndBroadcast() { netDiscover.StopBroadcast(); netDiscover.Initialize(); }
public void StopBroadcast() { localNetworkDiscovery.StopBroadcast(); }