TestCreateRoom.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. using Newtonsoft.Json.Linq;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using TMPro;
  5. using UnityEngine;
  6. public class TestCreateRoom : MonoBehaviour
  7. {
  8. // Start is called before the first frame update
  9. void Start()
  10. {
  11. // Debug.Log("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA");
  12. StartCoroutine(HttpTool.Instance.SendHttp("/cmcc-endustry/v1/rtc/createRoom", "", message =>
  13. {
  14. JObject jobject = JObject.Parse(message);
  15. Debug.Log("DGJ ===> CreateRoom " + message);
  16. // "Request Timeout"
  17. if (jobject["code"].ToString() == "200" && !string.IsNullOrWhiteSpace(jobject["data"].ToString()))
  18. {
  19. Debug.LogError("DGJ === RoomID " + jobject["data"]["roomId"]);
  20. UILogManager.Instance.logText.text = jobject["data"]["roomId"].ToString();
  21. GHZRTCFusionManager.Instance.CreateRoom(jobject["data"]["host"].ToString(), jobject["data"]["token"].ToString());
  22. }
  23. else if (jobject["code"].ToString() == "503")
  24. {
  25. }
  26. }, "application/x-www-form-urlencoded"));
  27. }
  28. }