|
@@ -30,6 +30,8 @@ public class SupportControl : AbstractController
|
|
|
|
|
|
|
|
|
public QuestionEnum Question;
|
|
|
+
|
|
|
+ private RTCRoomInfo mRTCRoomInfo;
|
|
|
void Awake()
|
|
|
{
|
|
|
#if UNITY_EDITOR
|
|
@@ -61,28 +63,38 @@ public class SupportControl : AbstractController
|
|
|
|
|
|
this.RegisterEvent<RTCCreatRoomSuccessEvent>(CreatRoomSuccess).UnRegisterWhenGameObjectDestroyed(gameObject);
|
|
|
Question = QuestionEnum.NetWork;
|
|
|
+
|
|
|
+ RTCManager.OnUserJoined += OnUserJoined;
|
|
|
}
|
|
|
|
|
|
- private void CreatRoomSuccess(RTCCreatRoomSuccessEvent e)
|
|
|
+ private void OnUserJoined(string uid)
|
|
|
{
|
|
|
-
|
|
|
- Debug.Log("DGJ =====> JoinRoomSuccess");
|
|
|
- RTCRoomInfo mRTCRoomInfo = JsonConvert.DeserializeObject<RTCRoomInfo>(e.rtcRoomInfo);
|
|
|
-
|
|
|
JsonData data = new JsonData();
|
|
|
data["roomId"] = mRTCRoomInfo.roomId.ToString();
|
|
|
data["questionCategory"] = (int)Question;
|
|
|
|
|
|
- Debug.Log("DGJ =====> "+ mRTCRoomInfo.roomId );
|
|
|
- StartCoroutine( HttpTool.Instance.SendHttp(HttpActionLang.apply, data.ToJson(), message =>
|
|
|
+ Debug.Log("DGJ =====> " + mRTCRoomInfo.roomId);
|
|
|
+
|
|
|
+ StartCoroutine(HttpTool.Instance.SendHttp(HttpActionLang.apply, data.ToJson(), message =>
|
|
|
{
|
|
|
- Debug.Log("DGJ ===> HttpActionLang.apply " + HttpActionLang.apply+" "+ message);
|
|
|
+ Debug.Log("DGJ ===> HttpActionLang.apply " + HttpActionLang.apply + " " + message);
|
|
|
JObject jobject = JObject.Parse(message);
|
|
|
if (jobject["code"].ToString() == "200" && !string.IsNullOrWhiteSpace(jobject["data"].ToString()))
|
|
|
{
|
|
|
Debug.Log("DGJ ===> ");
|
|
|
+ RTCManager.OnUserJoined -= OnUserJoined;
|
|
|
}
|
|
|
}));
|
|
|
+ }
|
|
|
+
|
|
|
+ private void CreatRoomSuccess(RTCCreatRoomSuccessEvent e)
|
|
|
+ {
|
|
|
+
|
|
|
+ Debug.Log("DGJ =====> JoinRoomSuccess");
|
|
|
+ mRTCRoomInfo = JsonConvert.DeserializeObject<RTCRoomInfo>(e.rtcRoomInfo);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
UILogManager.Instance.text2.text = mRTCRoomInfo.roomId.ToString();
|
|
|
UICallManager.Instance.SetMQTTRoomId(mRTCRoomInfo.roomId.ToString());
|