Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public IEnumerator GetGameRoom(string accessToken, string roomName, bool fromRefreshClick = false, Globals.LoginStatusOptions loginMethod = Globals.LoginStatusOptions.Cognito)
- {
- string url = gameroomsURL + "/" + roomName;
- print("url: " + url);
- ValidateAccess(accessToken, loginMethod);
- while (waitingForTokenRefresh)
- yield return null;
- using (UnityWebRequest www = UnityWebRequest.Get(url))
- {
- www.SetRequestHeader(GetHeaderTag(loginMethod), Globals.keyAccess);
- yield return www.SendWebRequest();
- if (www.isNetworkError)
- {
- Debug.Log(www.error);
- }
- else
- {
- Debug.Log(www.downloadHandler.text);
- GameRoomOut room = JsonUtility.FromJson<GameRoomOut>(www.downloadHandler.text);
- if (BroadcastRoomRefresh != null)
- BroadcastRoomRefresh(room, fromRefreshClick);
- }
- www.Dispose();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement