diff options
Diffstat (limited to 'OpenSim/Region/CoreModules')
5 files changed, 89 insertions, 22 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 08ac624..e92f072 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | |||
@@ -76,7 +76,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
76 | } | 76 | } |
77 | 77 | ||
78 | if (m_scene == null) | 78 | if (m_scene == null) |
79 | m_scene = scene; | 79 | m_scene = scene; |
80 | } | 80 | } |
81 | 81 | ||
82 | public void PostInitialise() | 82 | public void PostInitialise() |
@@ -162,12 +162,12 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
162 | // one and we're done otherwise, ask for a rebake | 162 | // one and we're done otherwise, ask for a rebake |
163 | if (checkonly) return false; | 163 | if (checkonly) return false; |
164 | 164 | ||
165 | m_log.InfoFormat("[AVFACTORY] missing baked texture {0}, request rebake",face.TextureID); | 165 | m_log.InfoFormat("[AVFACTORY]: missing baked texture {0}, requesting rebake",face.TextureID); |
166 | client.SendRebakeAvatarTextures(face.TextureID); | 166 | client.SendRebakeAvatarTextures(face.TextureID); |
167 | } | 167 | } |
168 | } | 168 | } |
169 | 169 | ||
170 | m_log.DebugFormat("[AVFACTORY]: complete texture check for {0}", client.AgentId); | 170 | m_log.DebugFormat("[AVFACTORY]: completed texture check for {0}", client.AgentId); |
171 | 171 | ||
172 | // If we only found default textures, then the appearance is not cached | 172 | // If we only found default textures, then the appearance is not cached |
173 | return (defonly ? false : true); | 173 | return (defonly ? false : true); |
diff --git a/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs b/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs index b823fec..7ae304c 100644 --- a/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs +++ b/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs | |||
@@ -66,8 +66,8 @@ namespace OpenSim.Region.CoreModules.Framework | |||
66 | m_scene = scene; | 66 | m_scene = scene; |
67 | m_scene.RegisterModuleInterface<ICapabilitiesModule>(this); | 67 | m_scene.RegisterModuleInterface<ICapabilitiesModule>(this); |
68 | MainConsole.Instance.Commands.AddCommand("Capabilities", false, "show caps", | 68 | MainConsole.Instance.Commands.AddCommand("Capabilities", false, "show caps", |
69 | "show capabilities", | 69 | "show caps", |
70 | "Shows all registered capabilities", CapabilitiesCommand); | 70 | "Shows all registered capabilities", CapabilitiesCommand); |
71 | } | 71 | } |
72 | 72 | ||
73 | public void RegionLoaded(Scene scene) | 73 | public void RegionLoaded(Scene scene) |
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 8775ea1..0e5953e 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -911,6 +911,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
911 | if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent)) | 911 | if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent)) |
912 | { | 912 | { |
913 | // region doesn't take it | 913 | // region doesn't take it |
914 | ReInstantiateScripts(agent); | ||
914 | ResetFromTransit(agent.UUID); | 915 | ResetFromTransit(agent.UUID); |
915 | return agent; | 916 | return agent; |
916 | } | 917 | } |
@@ -1787,14 +1788,22 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1787 | protected void ReInstantiateScripts(ScenePresence sp) | 1788 | protected void ReInstantiateScripts(ScenePresence sp) |
1788 | { | 1789 | { |
1789 | int i = 0; | 1790 | int i = 0; |
1790 | sp.Attachments.ForEach(delegate(SceneObjectGroup sog) | 1791 | if (sp.InTransitScriptStates.Count > 0) |
1791 | { | 1792 | { |
1792 | sog.SetState(sp.InTransitScriptStates[i++], sp.Scene); | 1793 | sp.Attachments.ForEach(delegate(SceneObjectGroup sog) |
1793 | sog.CreateScriptInstances(0, false, sp.Scene.DefaultScriptEngine, 0); | 1794 | { |
1794 | sog.ResumeScripts(); | 1795 | if (i < sp.InTransitScriptStates.Count) |
1795 | }); | 1796 | { |
1797 | sog.SetState(sp.InTransitScriptStates[i++], sp.Scene); | ||
1798 | sog.CreateScriptInstances(0, false, sp.Scene.DefaultScriptEngine, 0); | ||
1799 | sog.ResumeScripts(); | ||
1800 | } | ||
1801 | else | ||
1802 | m_log.ErrorFormat("[ENTITY TRANSFER MODULE]: InTransitScriptStates.Count={0} smaller than Attachments.Count={1}", sp.InTransitScriptStates.Count, sp.Attachments.Count); | ||
1803 | }); | ||
1796 | 1804 | ||
1797 | sp.InTransitScriptStates.Clear(); | 1805 | sp.InTransitScriptStates.Clear(); |
1806 | } | ||
1798 | } | 1807 | } |
1799 | #endregion | 1808 | #endregion |
1800 | 1809 | ||
diff --git a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs index bdbd0c2..fa17fb6 100644 --- a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs | |||
@@ -79,7 +79,9 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
79 | 79 | ||
80 | private int m_TotalUrls = 5000; | 80 | private int m_TotalUrls = 5000; |
81 | 81 | ||
82 | private uint https_port = 0; | ||
82 | private IHttpServer m_HttpServer = null; | 83 | private IHttpServer m_HttpServer = null; |
84 | private IHttpServer m_HttpsServer = null; | ||
83 | 85 | ||
84 | private string m_ExternalHostNameForLSL = ""; | 86 | private string m_ExternalHostNameForLSL = ""; |
85 | 87 | ||
@@ -101,6 +103,11 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
101 | public void Initialise(IConfigSource config) | 103 | public void Initialise(IConfigSource config) |
102 | { | 104 | { |
103 | m_ExternalHostNameForLSL = config.Configs["Network"].GetString("ExternalHostNameForLSL", System.Environment.MachineName); | 105 | m_ExternalHostNameForLSL = config.Configs["Network"].GetString("ExternalHostNameForLSL", System.Environment.MachineName); |
106 | bool ssl_enabled = config.Configs["Network"].GetBoolean("https_listener",false); | ||
107 | if (ssl_enabled) | ||
108 | { | ||
109 | https_port = (uint) config.Configs["Network"].GetInt("https_port",0); | ||
110 | } | ||
104 | } | 111 | } |
105 | 112 | ||
106 | public void PostInitialise() | 113 | public void PostInitialise() |
@@ -114,6 +121,12 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
114 | // There can only be one | 121 | // There can only be one |
115 | // | 122 | // |
116 | m_HttpServer = MainServer.Instance; | 123 | m_HttpServer = MainServer.Instance; |
124 | // | ||
125 | // We can use the https if it is enabled | ||
126 | if (https_port > 0) | ||
127 | { | ||
128 | m_HttpsServer = MainServer.GetHttpServer(https_port); | ||
129 | } | ||
117 | } | 130 | } |
118 | 131 | ||
119 | scene.RegisterModuleInterface<IUrlModule>(this); | 132 | scene.RegisterModuleInterface<IUrlModule>(this); |
@@ -171,7 +184,40 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
171 | { | 184 | { |
172 | UUID urlcode = UUID.Random(); | 185 | UUID urlcode = UUID.Random(); |
173 | 186 | ||
174 | engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" }); | 187 | if (m_HttpsServer == null) |
188 | { | ||
189 | engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" }); | ||
190 | return urlcode; | ||
191 | } | ||
192 | |||
193 | lock (m_UrlMap) | ||
194 | { | ||
195 | if (m_UrlMap.Count >= m_TotalUrls) | ||
196 | { | ||
197 | engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" }); | ||
198 | return urlcode; | ||
199 | } | ||
200 | string url = "https://" + m_ExternalHostNameForLSL + ":" + m_HttpsServer.Port.ToString() + "/lslhttps/" + urlcode.ToString() + "/"; | ||
201 | |||
202 | UrlData urlData = new UrlData(); | ||
203 | urlData.hostID = host.UUID; | ||
204 | urlData.itemID = itemID; | ||
205 | urlData.engine = engine; | ||
206 | urlData.url = url; | ||
207 | urlData.urlcode = urlcode; | ||
208 | urlData.requests = new Dictionary<UUID, RequestData>(); | ||
209 | |||
210 | |||
211 | m_UrlMap[url] = urlData; | ||
212 | |||
213 | string uri = "/lslhttps/" + urlcode.ToString() + "/"; | ||
214 | |||
215 | m_HttpsServer.AddPollServiceHTTPHandler(uri,HandleHttpPoll, | ||
216 | new PollServiceEventArgs(HttpRequestHandler,HasEvents, GetEvents, NoEvents, | ||
217 | urlcode)); | ||
218 | |||
219 | engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url }); | ||
220 | } | ||
175 | 221 | ||
176 | return urlcode; | 222 | return urlcode; |
177 | } | 223 | } |
@@ -349,7 +395,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
349 | } | 395 | } |
350 | private Hashtable GetEvents(UUID requestID, UUID sessionID, string request) | 396 | private Hashtable GetEvents(UUID requestID, UUID sessionID, string request) |
351 | { | 397 | { |
352 | UrlData url = null; | 398 | UrlData url = null; |
353 | RequestData requestData = null; | 399 | RequestData requestData = null; |
354 | 400 | ||
355 | lock (m_RequestMap) | 401 | lock (m_RequestMap) |
@@ -396,11 +442,12 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
396 | lock (request) | 442 | lock (request) |
397 | { | 443 | { |
398 | string uri = request["uri"].ToString(); | 444 | string uri = request["uri"].ToString(); |
399 | 445 | bool is_ssl = uri.Contains("lslhttps"); | |
446 | |||
400 | try | 447 | try |
401 | { | 448 | { |
402 | Hashtable headers = (Hashtable)request["headers"]; | 449 | Hashtable headers = (Hashtable)request["headers"]; |
403 | 450 | ||
404 | // string uri_full = "http://" + m_ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + uri;// "/lslhttp/" + urlcode.ToString() + "/"; | 451 | // string uri_full = "http://" + m_ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + uri;// "/lslhttp/" + urlcode.ToString() + "/"; |
405 | 452 | ||
406 | int pos1 = uri.IndexOf("/");// /lslhttp | 453 | int pos1 = uri.IndexOf("/");// /lslhttp |
@@ -414,7 +461,11 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
414 | 461 | ||
415 | pathInfo = uri.Substring(pos3); | 462 | pathInfo = uri.Substring(pos3); |
416 | 463 | ||
417 | UrlData url = m_UrlMap["http://" + m_ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + uri_tmp]; | 464 | UrlData url = null; |
465 | if (!is_ssl) | ||
466 | url = m_UrlMap["http://" + m_ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + uri_tmp]; | ||
467 | else | ||
468 | url = m_UrlMap["https://" + m_ExternalHostNameForLSL + ":" + m_HttpsServer.Port.ToString() + uri_tmp]; | ||
418 | 469 | ||
419 | //for llGetHttpHeader support we need to store original URI here | 470 | //for llGetHttpHeader support we need to store original URI here |
420 | //to make x-path-info / x-query-string / x-script-url / x-remote-ip headers | 471 | //to make x-path-info / x-query-string / x-script-url / x-remote-ip headers |
diff --git a/OpenSim/Region/CoreModules/World/Region/RestartModule.cs b/OpenSim/Region/CoreModules/World/Region/RestartModule.cs index 19ee7f5..c2934cd 100644 --- a/OpenSim/Region/CoreModules/World/Region/RestartModule.cs +++ b/OpenSim/Region/CoreModules/World/Region/RestartModule.cs | |||
@@ -76,19 +76,26 @@ namespace OpenSim.Region.CoreModules.World.Region | |||
76 | scene.RegionInfo.RegionID.ToString())); | 76 | scene.RegionInfo.RegionID.ToString())); |
77 | 77 | ||
78 | m_Scene = scene; | 78 | m_Scene = scene; |
79 | |||
79 | scene.RegisterModuleInterface<IRestartModule>(this); | 80 | scene.RegisterModuleInterface<IRestartModule>(this); |
80 | MainConsole.Instance.Commands.AddCommand("RestartModule", | 81 | MainConsole.Instance.Commands.AddCommand("RestartModule", |
81 | false, "region restart bluebox", | 82 | false, "region restart bluebox", |
82 | "region restart bluebox <message> <time> ...", | 83 | "region restart bluebox <message> <delta seconds>+", |
83 | "Restart the region", HandleRegionRestart); | 84 | "Schedule a region restart", |
85 | "Schedule a region restart after a given number of seconds. If one delta is given then the region is restarted in delta seconds time. A time to restart is sent to users in the region as a transient notice. If multiple deltas are given then a notice is sent when we reach each delta.", | ||
86 | HandleRegionRestart); | ||
87 | |||
84 | MainConsole.Instance.Commands.AddCommand("RestartModule", | 88 | MainConsole.Instance.Commands.AddCommand("RestartModule", |
85 | false, "region restart notice", | 89 | false, "region restart notice", |
86 | "region restart notice <message> <time> ...", | 90 | "region restart notice <message> <delta seconds>+", |
87 | "Restart the region", HandleRegionRestart); | 91 | "Schedule a region restart", |
92 | "Schedule a region restart after a given number of seconds. If one delta is given then the region is restarted in delta seconds time. A time to restart is sent to users in the region as a dismissable bluebox notice. If multiple deltas are given then a notice is sent when we reach each delta.", | ||
93 | HandleRegionRestart); | ||
94 | |||
88 | MainConsole.Instance.Commands.AddCommand("RestartModule", | 95 | MainConsole.Instance.Commands.AddCommand("RestartModule", |
89 | false, "region restart abort", | 96 | false, "region restart abort", |
90 | "region restart abort [<message>]", | 97 | "region restart abort [<message>]", |
91 | "Restart the region", HandleRegionRestart); | 98 | "Abort a region restart", HandleRegionRestart); |
92 | } | 99 | } |
93 | 100 | ||
94 | public void RegionLoaded(Scene scene) | 101 | public void RegionLoaded(Scene scene) |
@@ -260,7 +267,7 @@ namespace OpenSim.Region.CoreModules.World.Region | |||
260 | } | 267 | } |
261 | } | 268 | } |
262 | 269 | ||
263 | MainConsole.Instance.Output("Error: restart region <mode> <name> <time> ..."); | 270 | MainConsole.Instance.Output("Error: restart region <mode> <name> <delta seconds>+"); |
264 | return; | 271 | return; |
265 | } | 272 | } |
266 | 273 | ||