Jeremy 2 роки тому
батько
коміт
2282a20a67

+ 2 - 0
src/InteractionCenter/InteractionCenterService.cs

@@ -1,5 +1,6 @@
 using WingServerCommon.Service;
 using WingInterfaceLibrary.Interface.DBInterface;
+using WingInterfaceLibrary.LiveConsultation;
 
 namespace WingCloudServer.InteractionCenter
 {
@@ -9,6 +10,7 @@ namespace WingCloudServer.InteractionCenter
         
         protected ILiveRoomDBService _liveRoomDBService;
         protected IDistributedServerInfoDBService _distributedServerInfoDBService;
+        protected ILiveConsultationService _liveConsultationService;
     }
 
 }

+ 3 - 1
src/InteractionCenter/MasterInteractionCenterService.cs

@@ -8,6 +8,7 @@ using System.Linq;
 using WingServerCommon.Log;
 using CSScriptLib;
 using System.Reflection;
+using WingInterfaceLibrary.LiveConsultation;
 
 namespace WingCloudServer.InteractionCenter
 {
@@ -22,6 +23,7 @@ namespace WingCloudServer.InteractionCenter
             _opLogDBService = GetProxy<IOpLogDBService>();
             _distributedServerInfoDBService = GetProxy<IDistributedServerInfoDBService>();
             _liveRoomDBService = GetProxy<ILiveRoomDBService>();
+            _liveConsultationService = GetProxy<ILiveConsultationService>();
             _serverUrlMap = new Dictionary<string, string>();
         }
 
@@ -117,7 +119,7 @@ namespace WingCloudServer.InteractionCenter
                 var syncCompleteOpLogsRequest = new SyncCompleteOpLogsRequest { Oplogs = request.Oplogs };
                 await _opLogDBService.SyncCompleteOpLogsAsync(syncCompleteOpLogsRequest);
             }
-            //调用manager
+            await _liveConsultationService.SyncServerMessageAsync(request);
 
             return true;
         }

+ 4 - 4
src/InteractionCenter/MasterInteractionSyncService.cs

@@ -30,13 +30,13 @@ namespace WingCloudServer.InteractionCenter
         /// <returns></returns>
         public async Task<bool> SyncReceiveSlaveServiceDataAsync(SyncReceiveServiceDataRequest request)
         {
-            Logger.WriteLineInfo("SyncReceiveSlaveServiceDataAsync:"+request.ServiceDataJson+","+request.ServerID);
+            Logger.WriteLineInfo("SyncReceiveSlaveServiceDataAsync:" + request.ServiceDataJson + "," + request.ServerID);
             //判断是当前服务器并且是主服务器 则只需要发送oplogs到其他副服务器
-            if (string.IsNullOrWhiteSpace(request.ServerID))
+            var localServerUrl = ConfigurationManager.Host;
+            if (request.SourceUrl != localServerUrl)
             {
-                //调用manager
+                await _liveConsultationService.SyncServerMessageAsync(request);
             }
-            var localServerUrl = ConfigurationManager.Host;
             var baseLiveConsultation = JsonConvert.DeserializeObject<BaseLiveConsultationJson>(request.ServiceDataJson);
             // 判断是否存在其他服务器的用户
             var getLiveRoomByCodeDBRequest = new GetLiveRoomByCodeDBRequest();