Advertisement
Guest User

Untitled

a guest
Feb 16th, 2020
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. public IEnumerator GetGameRoom(string accessToken, string roomName, bool fromRefreshClick = false, Globals.LoginStatusOptions loginMethod = Globals.LoginStatusOptions.Cognito)
  2. {
  3. string url = gameroomsURL + "/" + roomName;
  4. print("url: " + url);
  5.  
  6. ValidateAccess(accessToken, loginMethod);
  7. while (waitingForTokenRefresh)
  8. yield return null;
  9.  
  10. using (UnityWebRequest www = UnityWebRequest.Get(url))
  11. {
  12. www.SetRequestHeader(GetHeaderTag(loginMethod), Globals.keyAccess);
  13. yield return www.SendWebRequest();
  14.  
  15. if (www.isNetworkError)
  16. {
  17. Debug.Log(www.error);
  18. }
  19. else
  20. {
  21. Debug.Log(www.downloadHandler.text);
  22. GameRoomOut room = JsonUtility.FromJson<GameRoomOut>(www.downloadHandler.text);
  23.  
  24. if (BroadcastRoomRefresh != null)
  25. BroadcastRoomRefresh(room, fromRefreshClick);
  26. }
  27. www.Dispose();
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement