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