mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 08:55:56 +08:00
Merge branch 'master' into careminster-presence-refactor
This commit is contained in:
@@ -76,7 +76,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
}
|
||||
|
||||
if (m_scene == null)
|
||||
m_scene = scene;
|
||||
m_scene = scene;
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
@@ -162,12 +162,12 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
// one and we're done otherwise, ask for a rebake
|
||||
if (checkonly) return false;
|
||||
|
||||
m_log.InfoFormat("[AVFACTORY] missing baked texture {0}, request rebake",face.TextureID);
|
||||
m_log.InfoFormat("[AVFACTORY]: missing baked texture {0}, requesting rebake",face.TextureID);
|
||||
client.SendRebakeAvatarTextures(face.TextureID);
|
||||
}
|
||||
}
|
||||
|
||||
m_log.DebugFormat("[AVFACTORY]: complete texture check for {0}", client.AgentId);
|
||||
m_log.DebugFormat("[AVFACTORY]: completed texture check for {0}", client.AgentId);
|
||||
|
||||
// If we only found default textures, then the appearance is not cached
|
||||
return (defonly ? false : true);
|
||||
|
||||
@@ -66,8 +66,8 @@ namespace OpenSim.Region.CoreModules.Framework
|
||||
m_scene = scene;
|
||||
m_scene.RegisterModuleInterface<ICapabilitiesModule>(this);
|
||||
MainConsole.Instance.Commands.AddCommand("Capabilities", false, "show caps",
|
||||
"show capabilities",
|
||||
"Shows all registered capabilities", CapabilitiesCommand);
|
||||
"show caps",
|
||||
"Shows all registered capabilities", CapabilitiesCommand);
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
|
||||
@@ -911,6 +911,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent))
|
||||
{
|
||||
// region doesn't take it
|
||||
ReInstantiateScripts(agent);
|
||||
ResetFromTransit(agent.UUID);
|
||||
return agent;
|
||||
}
|
||||
@@ -1787,14 +1788,22 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
protected void ReInstantiateScripts(ScenePresence sp)
|
||||
{
|
||||
int i = 0;
|
||||
sp.Attachments.ForEach(delegate(SceneObjectGroup sog)
|
||||
if (sp.InTransitScriptStates.Count > 0)
|
||||
{
|
||||
sog.SetState(sp.InTransitScriptStates[i++], sp.Scene);
|
||||
sog.CreateScriptInstances(0, false, sp.Scene.DefaultScriptEngine, 0);
|
||||
sog.ResumeScripts();
|
||||
});
|
||||
sp.Attachments.ForEach(delegate(SceneObjectGroup sog)
|
||||
{
|
||||
if (i < sp.InTransitScriptStates.Count)
|
||||
{
|
||||
sog.SetState(sp.InTransitScriptStates[i++], sp.Scene);
|
||||
sog.CreateScriptInstances(0, false, sp.Scene.DefaultScriptEngine, 0);
|
||||
sog.ResumeScripts();
|
||||
}
|
||||
else
|
||||
m_log.ErrorFormat("[ENTITY TRANSFER MODULE]: InTransitScriptStates.Count={0} smaller than Attachments.Count={1}", sp.InTransitScriptStates.Count, sp.Attachments.Count);
|
||||
});
|
||||
|
||||
sp.InTransitScriptStates.Clear();
|
||||
sp.InTransitScriptStates.Clear();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -79,7 +79,9 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
|
||||
|
||||
private int m_TotalUrls = 5000;
|
||||
|
||||
private uint https_port = 0;
|
||||
private IHttpServer m_HttpServer = null;
|
||||
private IHttpServer m_HttpsServer = null;
|
||||
|
||||
private string m_ExternalHostNameForLSL = "";
|
||||
|
||||
@@ -101,6 +103,11 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
m_ExternalHostNameForLSL = config.Configs["Network"].GetString("ExternalHostNameForLSL", System.Environment.MachineName);
|
||||
bool ssl_enabled = config.Configs["Network"].GetBoolean("https_listener",false);
|
||||
if (ssl_enabled)
|
||||
{
|
||||
https_port = (uint) config.Configs["Network"].GetInt("https_port",0);
|
||||
}
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
@@ -114,6 +121,12 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
|
||||
// There can only be one
|
||||
//
|
||||
m_HttpServer = MainServer.Instance;
|
||||
//
|
||||
// We can use the https if it is enabled
|
||||
if (https_port > 0)
|
||||
{
|
||||
m_HttpsServer = MainServer.GetHttpServer(https_port);
|
||||
}
|
||||
}
|
||||
|
||||
scene.RegisterModuleInterface<IUrlModule>(this);
|
||||
@@ -171,7 +184,40 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
|
||||
{
|
||||
UUID urlcode = UUID.Random();
|
||||
|
||||
engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" });
|
||||
if (m_HttpsServer == null)
|
||||
{
|
||||
engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" });
|
||||
return urlcode;
|
||||
}
|
||||
|
||||
lock (m_UrlMap)
|
||||
{
|
||||
if (m_UrlMap.Count >= m_TotalUrls)
|
||||
{
|
||||
engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" });
|
||||
return urlcode;
|
||||
}
|
||||
string url = "https://" + m_ExternalHostNameForLSL + ":" + m_HttpsServer.Port.ToString() + "/lslhttps/" + urlcode.ToString() + "/";
|
||||
|
||||
UrlData urlData = new UrlData();
|
||||
urlData.hostID = host.UUID;
|
||||
urlData.itemID = itemID;
|
||||
urlData.engine = engine;
|
||||
urlData.url = url;
|
||||
urlData.urlcode = urlcode;
|
||||
urlData.requests = new Dictionary<UUID, RequestData>();
|
||||
|
||||
|
||||
m_UrlMap[url] = urlData;
|
||||
|
||||
string uri = "/lslhttps/" + urlcode.ToString() + "/";
|
||||
|
||||
m_HttpsServer.AddPollServiceHTTPHandler(uri,HandleHttpPoll,
|
||||
new PollServiceEventArgs(HttpRequestHandler,HasEvents, GetEvents, NoEvents,
|
||||
urlcode));
|
||||
|
||||
engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url });
|
||||
}
|
||||
|
||||
return urlcode;
|
||||
}
|
||||
@@ -349,7 +395,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
|
||||
}
|
||||
private Hashtable GetEvents(UUID requestID, UUID sessionID, string request)
|
||||
{
|
||||
UrlData url = null;
|
||||
UrlData url = null;
|
||||
RequestData requestData = null;
|
||||
|
||||
lock (m_RequestMap)
|
||||
@@ -396,11 +442,12 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
|
||||
lock (request)
|
||||
{
|
||||
string uri = request["uri"].ToString();
|
||||
|
||||
bool is_ssl = uri.Contains("lslhttps");
|
||||
|
||||
try
|
||||
{
|
||||
Hashtable headers = (Hashtable)request["headers"];
|
||||
|
||||
|
||||
// string uri_full = "http://" + m_ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + uri;// "/lslhttp/" + urlcode.ToString() + "/";
|
||||
|
||||
int pos1 = uri.IndexOf("/");// /lslhttp
|
||||
@@ -414,7 +461,11 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
|
||||
|
||||
pathInfo = uri.Substring(pos3);
|
||||
|
||||
UrlData url = m_UrlMap["http://" + m_ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + uri_tmp];
|
||||
UrlData url = null;
|
||||
if (!is_ssl)
|
||||
url = m_UrlMap["http://" + m_ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + uri_tmp];
|
||||
else
|
||||
url = m_UrlMap["https://" + m_ExternalHostNameForLSL + ":" + m_HttpsServer.Port.ToString() + uri_tmp];
|
||||
|
||||
//for llGetHttpHeader support we need to store original URI here
|
||||
//to make x-path-info / x-query-string / x-script-url / x-remote-ip headers
|
||||
|
||||
@@ -76,19 +76,26 @@ namespace OpenSim.Region.CoreModules.World.Region
|
||||
scene.RegionInfo.RegionID.ToString()));
|
||||
|
||||
m_Scene = scene;
|
||||
|
||||
scene.RegisterModuleInterface<IRestartModule>(this);
|
||||
MainConsole.Instance.Commands.AddCommand("RestartModule",
|
||||
false, "region restart bluebox",
|
||||
"region restart bluebox <message> <time> ...",
|
||||
"Restart the region", HandleRegionRestart);
|
||||
"region restart bluebox <message> <delta seconds>+",
|
||||
"Schedule a region restart",
|
||||
"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.",
|
||||
HandleRegionRestart);
|
||||
|
||||
MainConsole.Instance.Commands.AddCommand("RestartModule",
|
||||
false, "region restart notice",
|
||||
"region restart notice <message> <time> ...",
|
||||
"Restart the region", HandleRegionRestart);
|
||||
"region restart notice <message> <delta seconds>+",
|
||||
"Schedule a region restart",
|
||||
"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.",
|
||||
HandleRegionRestart);
|
||||
|
||||
MainConsole.Instance.Commands.AddCommand("RestartModule",
|
||||
false, "region restart abort",
|
||||
"region restart abort [<message>]",
|
||||
"Restart the region", HandleRegionRestart);
|
||||
"Abort a region restart", HandleRegionRestart);
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
@@ -260,7 +267,7 @@ namespace OpenSim.Region.CoreModules.World.Region
|
||||
}
|
||||
}
|
||||
|
||||
MainConsole.Instance.Output("Error: restart region <mode> <name> <time> ...");
|
||||
MainConsole.Instance.Output("Error: restart region <mode> <name> <delta seconds>+");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user