aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorMelanie2011-05-08 20:20:40 +0100
committerMelanie2011-05-08 20:20:40 +0100
commit1be67914fab348115faa1fc9e9ecffbf7c303093 (patch)
tree7ad4917efae6aebeefa51fe03b1d1aac3e95efcb /OpenSim/Region/CoreModules
parentEnable compressed (gzip) fatpack transfers. (diff)
parentMantis #5472 (diff)
downloadopensim-SC_OLD-1be67914fab348115faa1fc9e9ecffbf7c303093.zip
opensim-SC_OLD-1be67914fab348115faa1fc9e9ecffbf7c303093.tar.gz
opensim-SC_OLD-1be67914fab348115faa1fc9e9ecffbf7c303093.tar.bz2
opensim-SC_OLD-1be67914fab348115faa1fc9e9ecffbf7c303093.tar.xz
Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs6
-rw-r--r--OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs21
-rw-r--r--OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs61
-rw-r--r--OpenSim/Region/CoreModules/World/Region/RestartModule.cs19
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 111d808..eb776fe 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 73f07ba..da3a541 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -892,6 +892,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
892 if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent)) 892 if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent))
893 { 893 {
894 // region doesn't take it 894 // region doesn't take it
895 ReInstantiateScripts(agent);
895 ResetFromTransit(agent.UUID); 896 ResetFromTransit(agent.UUID);
896 return agent; 897 return agent;
897 } 898 }
@@ -1761,14 +1762,22 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1761 protected void ReInstantiateScripts(ScenePresence sp) 1762 protected void ReInstantiateScripts(ScenePresence sp)
1762 { 1763 {
1763 int i = 0; 1764 int i = 0;
1764 sp.Attachments.ForEach(delegate(SceneObjectGroup sog) 1765 if (sp.InTransitScriptStates.Count > 0)
1765 { 1766 {
1766 sog.SetState(sp.InTransitScriptStates[i++], sp.Scene); 1767 sp.Attachments.ForEach(delegate(SceneObjectGroup sog)
1767 sog.CreateScriptInstances(0, false, sp.Scene.DefaultScriptEngine, 0); 1768 {
1768 sog.ResumeScripts(); 1769 if (i < sp.InTransitScriptStates.Count)
1769 }); 1770 {
1771 sog.SetState(sp.InTransitScriptStates[i++], sp.Scene);
1772 sog.CreateScriptInstances(0, false, sp.Scene.DefaultScriptEngine, 0);
1773 sog.ResumeScripts();
1774 }
1775 else
1776 m_log.ErrorFormat("[ENTITY TRANSFER MODULE]: InTransitScriptStates.Count={0} smaller than Attachments.Count={1}", sp.InTransitScriptStates.Count, sp.Attachments.Count);
1777 });
1770 1778
1771 sp.InTransitScriptStates.Clear(); 1779 sp.InTransitScriptStates.Clear();
1780 }
1772 } 1781 }
1773 #endregion 1782 #endregion
1774 1783
diff --git a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
index 9b565ed..a552a28 100644
--- a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
+++ b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
@@ -78,7 +78,9 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
78 78
79 private int m_TotalUrls = 100; 79 private int m_TotalUrls = 100;
80 80
81 private uint https_port = 0;
81 private IHttpServer m_HttpServer = null; 82 private IHttpServer m_HttpServer = null;
83 private IHttpServer m_HttpsServer = null;
82 84
83 private string m_ExternalHostNameForLSL = ""; 85 private string m_ExternalHostNameForLSL = "";
84 86
@@ -100,6 +102,11 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
100 public void Initialise(IConfigSource config) 102 public void Initialise(IConfigSource config)
101 { 103 {
102 m_ExternalHostNameForLSL = config.Configs["Network"].GetString("ExternalHostNameForLSL", System.Environment.MachineName); 104 m_ExternalHostNameForLSL = config.Configs["Network"].GetString("ExternalHostNameForLSL", System.Environment.MachineName);
105 bool ssl_enabled = config.Configs["Network"].GetBoolean("https_listener",false);
106 if (ssl_enabled)
107 {
108 https_port = (uint) config.Configs["Network"].GetInt("https_port",0);
109 }
103 } 110 }
104 111
105 public void PostInitialise() 112 public void PostInitialise()
@@ -113,6 +120,12 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
113 // There can only be one 120 // There can only be one
114 // 121 //
115 m_HttpServer = MainServer.Instance; 122 m_HttpServer = MainServer.Instance;
123 //
124 // We can use the https if it is enabled
125 if (https_port > 0)
126 {
127 m_HttpsServer = MainServer.GetHttpServer(https_port);
128 }
116 } 129 }
117 130
118 scene.RegisterModuleInterface<IUrlModule>(this); 131 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 }
@@ -345,7 +391,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
345 } 391 }
346 private Hashtable GetEvents(UUID requestID, UUID sessionID, string request) 392 private Hashtable GetEvents(UUID requestID, UUID sessionID, string request)
347 { 393 {
348 UrlData url = null; 394 UrlData url = null;
349 RequestData requestData = null; 395 RequestData requestData = null;
350 396
351 lock (m_RequestMap) 397 lock (m_RequestMap)
@@ -391,11 +437,12 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
391 lock (request) 437 lock (request)
392 { 438 {
393 string uri = request["uri"].ToString(); 439 string uri = request["uri"].ToString();
394 440 bool is_ssl = uri.Contains("lslhttps");
441
395 try 442 try
396 { 443 {
397 Hashtable headers = (Hashtable)request["headers"]; 444 Hashtable headers = (Hashtable)request["headers"];
398 445
399// string uri_full = "http://" + m_ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + uri;// "/lslhttp/" + urlcode.ToString() + "/"; 446// string uri_full = "http://" + m_ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + uri;// "/lslhttp/" + urlcode.ToString() + "/";
400 447
401 int pos1 = uri.IndexOf("/");// /lslhttp 448 int pos1 = uri.IndexOf("/");// /lslhttp
@@ -409,7 +456,11 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
409 456
410 pathInfo = uri.Substring(pos3); 457 pathInfo = uri.Substring(pos3);
411 458
412 UrlData url = m_UrlMap["http://" + m_ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + uri_tmp]; 459 UrlData url = null;
460 if (!is_ssl)
461 url = m_UrlMap["http://" + m_ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + uri_tmp];
462 else
463 url = m_UrlMap["https://" + m_ExternalHostNameForLSL + ":" + m_HttpsServer.Port.ToString() + uri_tmp];
413 464
414 //for llGetHttpHeader support we need to store original URI here 465 //for llGetHttpHeader support we need to store original URI here
415 //to make x-path-info / x-query-string / x-script-url / x-remote-ip headers 466 //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 ab6a598..e983239 100644
--- a/OpenSim/Region/CoreModules/World/Region/RestartModule.cs
+++ b/OpenSim/Region/CoreModules/World/Region/RestartModule.cs
@@ -64,19 +64,26 @@ namespace OpenSim.Region.CoreModules.World.Region
64 public void AddRegion(Scene scene) 64 public void AddRegion(Scene scene)
65 { 65 {
66 m_Scene = scene; 66 m_Scene = scene;
67
67 scene.RegisterModuleInterface<IRestartModule>(this); 68 scene.RegisterModuleInterface<IRestartModule>(this);
68 MainConsole.Instance.Commands.AddCommand("RestartModule", 69 MainConsole.Instance.Commands.AddCommand("RestartModule",
69 false, "region restart bluebox", 70 false, "region restart bluebox",
70 "region restart bluebox <message> <time> ...", 71 "region restart bluebox <message> <delta seconds>+",
71 "Restart the region", HandleRegionRestart); 72 "Schedule a region restart",
73 "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.",
74 HandleRegionRestart);
75
72 MainConsole.Instance.Commands.AddCommand("RestartModule", 76 MainConsole.Instance.Commands.AddCommand("RestartModule",
73 false, "region restart notice", 77 false, "region restart notice",
74 "region restart notice <message> <time> ...", 78 "region restart notice <message> <delta seconds>+",
75 "Restart the region", HandleRegionRestart); 79 "Schedule a region restart",
80 "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.",
81 HandleRegionRestart);
82
76 MainConsole.Instance.Commands.AddCommand("RestartModule", 83 MainConsole.Instance.Commands.AddCommand("RestartModule",
77 false, "region restart abort", 84 false, "region restart abort",
78 "region restart abort [<message>]", 85 "region restart abort [<message>]",
79 "Restart the region", HandleRegionRestart); 86 "Abort a region restart", HandleRegionRestart);
80 } 87 }
81 88
82 public void RegionLoaded(Scene scene) 89 public void RegionLoaded(Scene scene)
@@ -245,7 +252,7 @@ namespace OpenSim.Region.CoreModules.World.Region
245 } 252 }
246 } 253 }
247 254
248 MainConsole.Instance.Output("Error: restart region <mode> <name> <time> ..."); 255 MainConsole.Instance.Output("Error: restart region <mode> <name> <delta seconds>+");
249 return; 256 return;
250 } 257 }
251 258