Jelajahi Sumber

Fix build break

Melanie 4 tahun lalu
induk
melakukan
be34b8e79d

+ 5 - 1
OpenSim/Services/HypergridService/GatekeeperService.cs

@@ -73,6 +73,7 @@ namespace OpenSim.Services.HypergridService
         private static Uri m_Uri;
         private static GridRegion m_DefaultGatewayRegion;
         private bool m_allowDuplicatePresences = false;
+        private static string m_messageKey;
 
         public GatekeeperService(IConfigSource config, ISimulationService simService)
         {
@@ -154,6 +155,9 @@ namespace OpenSim.Services.HypergridService
                     m_allowDuplicatePresences = presenceConfig.GetBoolean("AllowDuplicatePresences", m_allowDuplicatePresences);
                 }
 
+                IConfig messagingConfig = config.Configs["Messaging"];
+                if (messagingConfig != null)
+                    m_messageKey = messagingConfig.GetString("MessageKey", String.Empty);
                 m_log.Debug("[GATEKEEPER SERVICE]: Starting...");
             }
         }
@@ -651,7 +655,7 @@ namespace OpenSim.Services.HypergridService
             msg.Position = Vector3.Zero;
             msg.RegionID = scopeID.Guid;
             msg.binaryBucket = new byte[1] {0};
-            InstantMessageServiceConnector.SendInstantMessage(regURL,msg);
+            InstantMessageServiceConnector.SendInstantMessage(regURL,msg, m_messageKey);
 
             m_GridUserService.LoggedOut(agentID.ToString(),
                 UUID.Zero, guinfo.LastRegionID, guinfo.LastPosition, guinfo.LastLookAt);

+ 2 - 1
OpenSim/Services/HypergridService/HGInstantMessageService.cs

@@ -70,6 +70,7 @@ namespace OpenSim.Services.HypergridService
 
         private static bool m_ForwardOfflineGroupMessages;
         private static bool m_InGatekeeper;
+        private string m_messageKey;
 
         public HGInstantMessageService(IConfigSource config)
             : this(config, null)
@@ -322,7 +323,7 @@ namespace OpenSim.Services.HypergridService
 
         bool ForwardIMToGrid(string url, GridInstantMessage im, UUID toAgentID, bool foreigner)
         {
-            if (InstantMessageServiceConnector.SendInstantMessage(url, im))
+            if (InstantMessageServiceConnector.SendInstantMessage(url, im, m_messageKey))
             {
                 // IM delivery successful, so store the Agent's location in our local cache.
                 lock (m_UserLocationMap)

+ 5 - 1
OpenSim/Services/LLLoginService/LLLoginService.cs

@@ -92,6 +92,7 @@ namespace OpenSim.Services.LLLoginService
         protected string m_MessageUrl;
         protected string m_DSTZone;
         protected bool m_allowDuplicatePresences = false;
+        protected string m_messageKey;
 
         IConfig m_LoginServerConfig;
 //        IConfig m_ClientsConfig;
@@ -159,6 +160,9 @@ namespace OpenSim.Services.LLLoginService
                     m_MapTileURL = m_MapTileURL + "/";
             }
 
+            IConfig messagingConfig = config.Configs["Messaging"];
+            if (messagingConfig != null)
+                m_messageKey = messagingConfig.GetString("MessageKey", String.Empty);
             // These are required; the others aren't
             if (accountService == string.Empty || authService == string.Empty)
                 throw new Exception("LoginService is missing service specifications");
@@ -1170,7 +1174,7 @@ namespace OpenSim.Services.LLLoginService
             msg.Position = Vector3.Zero;
             msg.RegionID = scopeID.Guid;
             msg.binaryBucket = new byte[1] {0};
-            InstantMessageServiceConnector.SendInstantMessage(regURL,msg);
+            InstantMessageServiceConnector.SendInstantMessage(regURL,msg, m_messageKey);
 
             m_GridUserService.LoggedOut(agentID.ToString(),
                 UUID.Zero, guinfo.LastRegionID, guinfo.LastPosition, guinfo.LastLookAt);

+ 1 - 1
OpenSim/Tests/Robust/Clients/InstantMessage/IMClient.cs

@@ -50,7 +50,7 @@ namespace Robust.Tests
             im.message = "Hello";
             im.imSessionID = new Guid();
 
-            bool success = InstantMessageServiceConnector.SendInstantMessage(DemonServer.Address, im);
+            bool success = InstantMessageServiceConnector.SendInstantMessage(DemonServer.Address, im, String.Empty);
             Assert.IsFalse(success, "Sending of IM succeeded, but it should have failed");
         }