feedback report 3 done
This commit is contained in:
@@ -94,6 +94,13 @@ public class CupidLobby : MonoBehaviour
|
||||
{
|
||||
RefreshMatchmakingPanel();
|
||||
|
||||
if (Application.internetReachability == NetworkReachability.NotReachable)
|
||||
{
|
||||
Logger.Log("Matchmaker unreachable: no internet");
|
||||
StopMatchmakingNoInternet();
|
||||
yield break;
|
||||
}
|
||||
|
||||
using (UnityWebRequest req = UnityWebRequest.Get(Cupid.CupidURI + "/"))
|
||||
{
|
||||
req.downloadHandler = new DownloadHandlerBuffer();
|
||||
@@ -101,6 +108,13 @@ public class CupidLobby : MonoBehaviour
|
||||
yield return req.SendWebRequest();
|
||||
|
||||
string text = req.downloadHandler != null ? req.downloadHandler.text : "";
|
||||
if (req.result == UnityWebRequest.Result.ConnectionError)
|
||||
{
|
||||
Logger.Log("Matchmaker unreachable: " + req.error + " body: " + text);
|
||||
StopMatchmakingNoInternet();
|
||||
yield break;
|
||||
}
|
||||
|
||||
if (req.result != UnityWebRequest.Result.Success)
|
||||
{
|
||||
Logger.Log("Matchmaker poll failed: " + req.error + " body: " + text);
|
||||
@@ -200,6 +214,15 @@ public class CupidLobby : MonoBehaviour
|
||||
RefreshMatchmakingPanel();
|
||||
}
|
||||
|
||||
void StopMatchmakingNoInternet()
|
||||
{
|
||||
matchmaking = false;
|
||||
RefreshMatchmakingPanel();
|
||||
if (MainMenuManager.instance != null)
|
||||
MainMenuManager.instance.ShowMatchmakingNoInternet();
|
||||
StartCoroutine(CancelMatchmake());
|
||||
}
|
||||
|
||||
void RefreshMatchmakingPanel()
|
||||
{
|
||||
MatchmakingUI.SetActive(matchmaking);
|
||||
|
||||
Reference in New Issue
Block a user