private IEnumerator CheckConnection(string url) { m_IsChecking = true; using (UnityWebRequest request = UnityWebRequest.Get(url)) { request.timeout = 30; yield return(request.SendWebRequest()); m_IsChecking = false; m_Timer = m_UpdateFrequency; if (request.isNetworkError || request.isHttpError || ForceInternetDown) { UnityEngine.Debug.LogErrorFormat("Response URL : {0}, Error : {1}, Response Code : {2}", request.url, request.error, request.responseCode); m_RetryCount++; if (m_RetryCount >= MaxRetries) { OnConnectionVerified(false); } } else { XDebug.Log("Response URL : " + request.url + "\nText : " + request.downloadHandler.text + "\nResponse Code : " + request.responseCode, XDebug.Mask.ConnectivityMonitor, XDebug.Color.Yellow); //Call succeeded, now check if the data returned is what we expect. if (request.downloadHandler.text.Equals("true") || request.downloadHandler.text.Equals("true\n")) { OnConnectionVerified(true); } else { //The call was successfull, but content was wrong, this happens in case of ISP login. m_RetryCount++; if (m_RetryCount >= MaxRetries) { OnConnectionVerified(false); } } } } }
public override void OnJoinedLobby() { XDebug.Log("On Joined Lobby", XDebug.Mask.GameManager, null); }
public override void OnLobbyStatisticsUpdate(List <TypedLobbyInfo> lobbyStatistics) { XDebug.Log("On Lobby Statistics Update\nCount = " + lobbyStatistics[0].RoomCount, XDebug.Mask.GameManager, XDebug.Color.Yellow); }
public override void OnRoomListUpdate(List <RoomInfo> roomList) { XDebug.Log("Updated room list", XDebug.Mask.GameManager, XDebug.Color.Yellow); NetworkData.Instance.UpdateRoomList(roomList); }
public override void OnPlayerLeftRoom(Player otherPlayer) { XDebug.Log("On Player Left Room - " + otherPlayer.NickName + "\nTotal Player Count = " + PhotonNetwork.CurrentRoom.PlayerCount, XDebug.Mask.GameManager, XDebug.Color.Red); MyEventManager.Instance.OnPlayerLeft.Dispatch(); }
public void OnCreatedOrJoinedRoom() { XDebug.Log("Loading finished...Waiting Scene will be loaded now", XDebug.Mask.MainMenu); SceneManager.Instance.LoadScene(SceneManager.Scene.WaitScene, UnityEngine.SceneManagement.LoadSceneMode.Single); }
public override void OnCreateRoomFailed(short returnCode, string message) { XDebug.Log("On Create Room Failed - code = " + returnCode + "\nMessage = " + message, XDebug.Mask.GameManager, XDebug.Color.Red); }
public override void OnConnected() { base.OnConnected(); XDebug.Log("On Connected", XDebug.Mask.GameManager, null); }
public void UpdateGameState(GameState gameState) { XDebug.Log("Updating Game State", XDebug.Mask.GameStateManager, XDebug.Color.Yellow); this.CurrentGameState = gameState; MyEventManager.Instance.OnGameStateUpdated.Dispatch(); }