diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/InterGrid')
-rw-r--r-- | OpenSim/Region/CoreModules/InterGrid/OGSRadmin.cs | 31 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs | 100 |
2 files changed, 72 insertions, 59 deletions
diff --git a/OpenSim/Region/CoreModules/InterGrid/OGSRadmin.cs b/OpenSim/Region/CoreModules/InterGrid/OGSRadmin.cs index 0f2ba32..4534024 100644 --- a/OpenSim/Region/CoreModules/InterGrid/OGSRadmin.cs +++ b/OpenSim/Region/CoreModules/InterGrid/OGSRadmin.cs | |||
@@ -32,6 +32,7 @@ using System.Net; | |||
32 | using System.Reflection; | 32 | using System.Reflection; |
33 | using System.Text; | 33 | using System.Text; |
34 | using log4net; | 34 | using log4net; |
35 | using Mono.Addins; | ||
35 | using Nini.Config; | 36 | using Nini.Config; |
36 | using Nwc.XmlRpc; | 37 | using Nwc.XmlRpc; |
37 | using OpenMetaverse; | 38 | using OpenMetaverse; |
@@ -42,7 +43,8 @@ using OpenSim.Region.Framework.Scenes; | |||
42 | 43 | ||
43 | namespace OpenSim.Region.CoreModules.InterGrid | 44 | namespace OpenSim.Region.CoreModules.InterGrid |
44 | { | 45 | { |
45 | public class OGSRadmin : IRegionModule | 46 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] |
47 | public class OGSRadmin : ISharedRegionModule | ||
46 | { | 48 | { |
47 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 49 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
48 | private readonly List<Scene> m_scenes = new List<Scene>(); | 50 | private readonly List<Scene> m_scenes = new List<Scene>(); |
@@ -56,7 +58,6 @@ namespace OpenSim.Region.CoreModules.InterGrid | |||
56 | get { return "OGS Supporting RAdmin"; } | 58 | get { return "OGS Supporting RAdmin"; } |
57 | } | 59 | } |
58 | 60 | ||
59 | |||
60 | public void Initialise(IConfigSource source) | 61 | public void Initialise(IConfigSource source) |
61 | { | 62 | { |
62 | m_settings = source; | 63 | m_settings = source; |
@@ -67,6 +68,11 @@ namespace OpenSim.Region.CoreModules.InterGrid | |||
67 | 68 | ||
68 | } | 69 | } |
69 | 70 | ||
71 | public Type ReplaceableInterface | ||
72 | { | ||
73 | get { return null; } | ||
74 | } | ||
75 | |||
70 | public void AddRegion(Scene scene) | 76 | public void AddRegion(Scene scene) |
71 | { | 77 | { |
72 | lock (m_scenes) | 78 | lock (m_scenes) |
@@ -77,15 +83,11 @@ namespace OpenSim.Region.CoreModules.InterGrid | |||
77 | { | 83 | { |
78 | lock (m_scenes) | 84 | lock (m_scenes) |
79 | m_scenes.Remove(scene); | 85 | m_scenes.Remove(scene); |
86 | MainServer.Instance.RemoveXmlRPCHandler("grid_message"); | ||
80 | } | 87 | } |
81 | 88 | ||
82 | public void RegionLoaded(Scene scene) | 89 | public void RegionLoaded(Scene scene) |
83 | { | 90 | { |
84 | |||
85 | } | ||
86 | |||
87 | public void PostInitialise() | ||
88 | { | ||
89 | if (m_settings.Configs["Startup"].GetBoolean("gridmode", false)) | 91 | if (m_settings.Configs["Startup"].GetBoolean("gridmode", false)) |
90 | { | 92 | { |
91 | m_com = m_scenes[0].CommsManager; | 93 | m_com = m_scenes[0].CommsManager; |
@@ -93,21 +95,8 @@ namespace OpenSim.Region.CoreModules.InterGrid | |||
93 | } | 95 | } |
94 | } | 96 | } |
95 | 97 | ||
96 | #endregion | 98 | public void PostInitialise() |
97 | |||
98 | #region IRegionModule | ||
99 | |||
100 | public void Initialise(Scene scene, IConfigSource source) | ||
101 | { | ||
102 | m_settings = source; | ||
103 | |||
104 | lock (m_scenes) | ||
105 | m_scenes.Add(scene); | ||
106 | } | ||
107 | |||
108 | public bool IsSharedModule | ||
109 | { | 99 | { |
110 | get { return true; } | ||
111 | } | 100 | } |
112 | 101 | ||
113 | #endregion | 102 | #endregion |
diff --git a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs index 10a3232..8bb0fa9 100644 --- a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs +++ b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs | |||
@@ -35,6 +35,7 @@ using System.Security.Cryptography.X509Certificates; | |||
35 | using System.Threading; | 35 | using System.Threading; |
36 | using System.Web; | 36 | using System.Web; |
37 | using log4net; | 37 | using log4net; |
38 | using Mono.Addins; | ||
38 | using Nini.Config; | 39 | using Nini.Config; |
39 | using OpenMetaverse; | 40 | using OpenMetaverse; |
40 | using OpenMetaverse.StructuredData; | 41 | using OpenMetaverse.StructuredData; |
@@ -75,8 +76,9 @@ namespace OpenSim.Region.CoreModules.InterGrid | |||
75 | public bool visible_to_parent; | 76 | public bool visible_to_parent; |
76 | public string teleported_into_region; | 77 | public string teleported_into_region; |
77 | } | 78 | } |
78 | 79 | ||
79 | public class OpenGridProtocolModule : IRegionModule | 80 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] |
81 | public class OpenGridProtocolModule : ISharedRegionModule | ||
80 | { | 82 | { |
81 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 83 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
82 | private List<Scene> m_scene = new List<Scene>(); | 84 | private List<Scene> m_scene = new List<Scene>(); |
@@ -92,21 +94,22 @@ namespace OpenSim.Region.CoreModules.InterGrid | |||
92 | private bool httpSSL = false; | 94 | private bool httpSSL = false; |
93 | private uint httpsslport = 0; | 95 | private uint httpsslport = 0; |
94 | private bool GridMode = false; | 96 | private bool GridMode = false; |
97 | private bool m_enabled = false; | ||
98 | private IConfig cfg = null; | ||
99 | private IConfig httpcfg = null; | ||
100 | private IConfig startupcfg = null; | ||
101 | |||
102 | #region ISharedRegionModule Members | ||
95 | 103 | ||
96 | #region IRegionModule Members | 104 | public void Initialise(IConfigSource config) |
97 | |||
98 | public void Initialise(Scene scene, IConfigSource config) | ||
99 | { | 105 | { |
100 | bool enabled = false; | ||
101 | IConfig cfg = null; | ||
102 | IConfig httpcfg = null; | ||
103 | IConfig startupcfg = null; | ||
104 | try | 106 | try |
105 | { | 107 | { |
106 | cfg = config.Configs["OpenGridProtocol"]; | 108 | cfg = config.Configs["OpenGridProtocol"]; |
107 | } catch (NullReferenceException) | 109 | } |
110 | catch (NullReferenceException) | ||
108 | { | 111 | { |
109 | enabled = false; | 112 | m_enabled = false; |
110 | } | 113 | } |
111 | 114 | ||
112 | try | 115 | try |
@@ -128,15 +131,15 @@ namespace OpenSim.Region.CoreModules.InterGrid | |||
128 | 131 | ||
129 | if (startupcfg != null) | 132 | if (startupcfg != null) |
130 | { | 133 | { |
131 | GridMode = enabled = startupcfg.GetBoolean("gridmode", false); | 134 | GridMode = m_enabled = startupcfg.GetBoolean("gridmode", false); |
132 | } | 135 | } |
133 | 136 | ||
134 | if (cfg != null) | 137 | if (cfg != null) |
135 | { | 138 | { |
136 | enabled = cfg.GetBoolean("ogp_enabled", false); | 139 | m_enabled = cfg.GetBoolean("ogp_enabled", false); |
137 | LastNameSuffix = cfg.GetString("ogp_lastname_suffix", "_EXTERNAL"); | 140 | LastNameSuffix = cfg.GetString("ogp_lastname_suffix", "_EXTERNAL"); |
138 | FirstNamePrefix = cfg.GetString("ogp_firstname_prefix", ""); | 141 | FirstNamePrefix = cfg.GetString("ogp_firstname_prefix", ""); |
139 | if (enabled) | 142 | if (m_enabled) |
140 | { | 143 | { |
141 | m_log.Warn("[OGP]: Open Grid Protocol is on, Listening for Clients on /agent/"); | 144 | m_log.Warn("[OGP]: Open Grid Protocol is on, Listening for Clients on /agent/"); |
142 | lock (m_scene) | 145 | lock (m_scene) |
@@ -165,35 +168,61 @@ namespace OpenSim.Region.CoreModules.InterGrid | |||
165 | } | 168 | } |
166 | 169 | ||
167 | } | 170 | } |
168 | // can't pick the region 'agent' because it would conflict with our agent domain handler | ||
169 | // a zero length region name would conflict with are base region seed cap | ||
170 | if (!SceneListDuplicateCheck(scene.RegionInfo.RegionName) && scene.RegionInfo.RegionName.ToLower() != "agent" && scene.RegionInfo.RegionName.Length > 0) | ||
171 | { | ||
172 | MainServer.Instance.AddLLSDHandler( | ||
173 | "/" + HttpUtility.UrlPathEncode(scene.RegionInfo.RegionName.ToLower()), | ||
174 | ProcessRegionDomainSeed); | ||
175 | } | ||
176 | |||
177 | if (!m_scene.Contains(scene)) | ||
178 | m_scene.Add(scene); | ||
179 | } | 171 | } |
180 | } | 172 | } |
181 | } | 173 | } |
182 | lock (m_scene) | 174 | } |
175 | |||
176 | public Type ReplaceableInterface | ||
177 | { | ||
178 | get { return null; } | ||
179 | } | ||
180 | |||
181 | public void AddRegion(Scene scene) | ||
182 | { | ||
183 | if (m_enabled) | ||
183 | { | 184 | { |
184 | if (m_scene.Count == 1) | 185 | lock (m_scene) |
185 | { | 186 | { |
186 | if (httpcfg != null) | 187 | if (m_scene.Count == 1) |
187 | { | 188 | { |
188 | httpSSL = httpcfg.GetBoolean("http_listener_ssl", false); | 189 | if (httpcfg != null) |
189 | httpsCN = httpcfg.GetString("http_listener_cn", scene.RegionInfo.ExternalHostName); | 190 | { |
190 | if (httpsCN.Length == 0) | 191 | httpSSL = httpcfg.GetBoolean("http_listener_ssl", false); |
191 | httpsCN = scene.RegionInfo.ExternalHostName; | 192 | httpsCN = httpcfg.GetString("http_listener_cn", scene.RegionInfo.ExternalHostName); |
192 | httpsslport = (uint)httpcfg.GetInt("http_listener_sslport",((int)scene.RegionInfo.HttpPort + 1)); | 193 | if (httpsCN.Length == 0) |
194 | httpsCN = scene.RegionInfo.ExternalHostName; | ||
195 | httpsslport = (uint)httpcfg.GetInt("http_listener_sslport", ((int)scene.RegionInfo.HttpPort + 1)); | ||
196 | } | ||
193 | } | 197 | } |
194 | } | 198 | } |
199 | // can't pick the region 'agent' because it would conflict with our agent domain handler | ||
200 | // a zero length region name would conflict with are base region seed cap | ||
201 | if (!SceneListDuplicateCheck(scene.RegionInfo.RegionName) && scene.RegionInfo.RegionName.ToLower() != "agent" && scene.RegionInfo.RegionName.Length > 0) | ||
202 | { | ||
203 | MainServer.Instance.AddLLSDHandler( | ||
204 | "/" + HttpUtility.UrlPathEncode(scene.RegionInfo.RegionName.ToLower()), | ||
205 | ProcessRegionDomainSeed); | ||
206 | } | ||
207 | |||
208 | if (!m_scene.Contains(scene)) | ||
209 | m_scene.Add(scene); | ||
195 | } | 210 | } |
196 | } | 211 | } |
212 | |||
213 | public void RegionLoaded(Scene scene) | ||
214 | { | ||
215 | } | ||
216 | |||
217 | public void RemoveRegion(Scene scene) | ||
218 | { | ||
219 | MainServer.Instance.RemoveLLSDHandler( | ||
220 | "/" + HttpUtility.UrlPathEncode(scene.RegionInfo.RegionName.ToLower()), | ||
221 | ProcessRegionDomainSeed); | ||
222 | |||
223 | if (m_scene.Contains(scene)) | ||
224 | m_scene.Remove(scene); | ||
225 | } | ||
197 | 226 | ||
198 | public void PostInitialise() | 227 | public void PostInitialise() |
199 | { | 228 | { |
@@ -209,11 +238,6 @@ namespace OpenSim.Region.CoreModules.InterGrid | |||
209 | get { return "OpenGridProtocolModule"; } | 238 | get { return "OpenGridProtocolModule"; } |
210 | } | 239 | } |
211 | 240 | ||
212 | public bool IsSharedModule | ||
213 | { | ||
214 | get { return true; } | ||
215 | } | ||
216 | |||
217 | #endregion | 241 | #endregion |
218 | 242 | ||
219 | public OSD ProcessRegionDomainSeed(string path, OSD request, string endpoint) | 243 | public OSD ProcessRegionDomainSeed(string path, OSD request, string endpoint) |