|
@@ -84,16 +84,12 @@ public class MQTTClient : MonoSingleton<MQTTClient>
|
|
|
Subscribe(MQTTManager.Instance.front + "sensor/VOICE"); //噪声
|
|
|
Subscribe(MQTTManager.Instance.front + "sensor/TEMPERATURE_HUMIDITY"); //温湿度传感器
|
|
|
Subscribe(MQTTManager.Instance.front + "sensor/VIBRATE"); //振动传感器
|
|
|
- //if (!string.IsNullOrEmpty( MQTTManager.Instance.topiceNavigation))
|
|
|
- //{
|
|
|
- // Subscribe(MQTTManager.Instance.topiceNavigation);
|
|
|
- // Subscribe(MQTTManager.Instance.topiceSync);
|
|
|
- // Subscribe(MQTTManager.Instance.topiceClose);
|
|
|
- //}
|
|
|
+ Subscribe(MQTTManager.Instance.front + "room/RTC"); //RTC
|
|
|
+
|
|
|
|
|
|
// Subscribe((MQTTManager.Instance.front + "younuo"));
|
|
|
- // MQTTManager.Instance.isCreateRoom = true;
|
|
|
-
|
|
|
+ // MQTTManager.Instance.isCreateRoom = true;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
@@ -129,6 +125,26 @@ public class MQTTClient : MonoSingleton<MQTTClient>
|
|
|
// MQTTManager.Instance.Received(msg);
|
|
|
MQTTManager.Instance.Received(obj);
|
|
|
|
|
|
+ JsonData data = JsonMapper.ToObject(msg);
|
|
|
+ if(data["device"].ToString()=="ROOM2")
|
|
|
+ {
|
|
|
+ if (RTCDemoManager.Instance&&RTCDemoManager.Instance.roomId!="")
|
|
|
+ {
|
|
|
+ JsonData obj2 = new JsonData();
|
|
|
+ obj2["device"] = new JsonData();
|
|
|
+ obj2["device"]["deviceCode"] = "ROOM";
|
|
|
+ obj2["roomId"] = RTCDemoManager.Instance.roomId;
|
|
|
+ // 用MQTT 向中考发送邀请
|
|
|
+ MQTTManager.Instance.PushMsg(MQTTManager.Instance.front + "room/RTC", obj2.ToJson());
|
|
|
+ }else
|
|
|
+ {
|
|
|
+ Debug.Log("创建房间");
|
|
|
+ RTCDemoManager.Instance.CreatRoom();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
if (ProjectALLStateManager.Instance.isAIDevice)
|
|
|
AIDeviceManager.Instance.Received(msg);
|
|
|
}
|