|
@@ -103,11 +103,12 @@ public class RTCRoomManager : MonoSingleton<RTCRoomManager>, IController
|
|
|
|
|
|
public void UserJoined( UserEnum userEnum , JObject metadata = null)
|
|
|
{
|
|
|
- Debug.Log("DGJ ===> " + rtcState);
|
|
|
+ // Debug.Log("DGJ ===> " + rtcState);
|
|
|
switch (userEnum)
|
|
|
{
|
|
|
case UserEnum.Player:
|
|
|
rtcState = RTCEnum.Online;
|
|
|
+ Debug.Log(" DGJ ===> UserJoined 自己 ");
|
|
|
break;
|
|
|
case UserEnum.Expert:
|
|
|
expertData = metadata;
|
|
@@ -129,6 +130,7 @@ public class RTCRoomManager : MonoSingleton<RTCRoomManager>, IController
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
+ Debug.Log(" DGJ ===> UserJoined 专家 ");
|
|
|
break;
|
|
|
case UserEnum.Conterl:
|
|
|
controlData = metadata;
|
|
@@ -137,14 +139,14 @@ public class RTCRoomManager : MonoSingleton<RTCRoomManager>, IController
|
|
|
case RTCEnum.OFF:
|
|
|
|
|
|
case RTCEnum.Online:
|
|
|
- rtcState = RTCEnum.ExpertOnline;
|
|
|
+ rtcState = RTCEnum.ConterlOnline;
|
|
|
break;
|
|
|
case RTCEnum.ExpertOnline:
|
|
|
rtcState = RTCEnum.ALLOnline;
|
|
|
|
|
|
break;
|
|
|
case RTCEnum.ConterlOnline:
|
|
|
- rtcState = RTCEnum.ExpertOnline;
|
|
|
+ rtcState = RTCEnum.ConterlOnline;
|
|
|
break;
|
|
|
case RTCEnum.ALLOnline:
|
|
|
Debug.LogError("RTC 房间状态有误 ");
|
|
@@ -152,10 +154,12 @@ public class RTCRoomManager : MonoSingleton<RTCRoomManager>, IController
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
+ Debug.Log(" DGJ ===> UserJoined 中控 ");
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
+ Debug.Log("DGJ ===> " + rtcState);
|
|
|
}
|
|
|
|
|
|
public void UserOffline(string uid)
|
|
@@ -165,11 +169,13 @@ public class RTCRoomManager : MonoSingleton<RTCRoomManager>, IController
|
|
|
if(expertData!=null&& participant.identity == expertData["name"].ToString() )
|
|
|
{
|
|
|
UserOffline(UserEnum.Expert);
|
|
|
-
|
|
|
+ Debug.Log("DGJ ===> UserOffline 专家 "+ uid);
|
|
|
|
|
|
}else if(controlData!=null && participant.identity == controlData["name"].ToString())
|
|
|
{
|
|
|
UserOffline(UserEnum.Conterl);
|
|
|
+
|
|
|
+ Debug.Log("DGJ ===> UserOffline 中控 " + uid);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -231,7 +237,7 @@ public class RTCRoomManager : MonoSingleton<RTCRoomManager>, IController
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
- if(rtcState == RTCEnum.Online&& ScenesManager.Instance.getWindow() != ScenesManager.SceneType.ShowRTC)
|
|
|
+ if(rtcState != RTCEnum.OFF&& ScenesManager.Instance.getWindow() != ScenesManager.SceneType.ShowRTC)
|
|
|
{
|
|
|
// 退出房间
|
|
|
LeaveChannel();
|
|
@@ -240,8 +246,11 @@ public class RTCRoomManager : MonoSingleton<RTCRoomManager>, IController
|
|
|
|
|
|
public void LeaveChannel()
|
|
|
{
|
|
|
+ Debug.LogError(" RTCRoomManager 退出房间");
|
|
|
RTCManager.Instance.LeaveChannel();
|
|
|
+ rtcState = RTCEnum.OFF;
|
|
|
ClearRoomData();
|
|
|
+
|
|
|
}
|
|
|
|
|
|
private void ClearRoomData()
|