Merge branch 'master' into careminster-presence-refactor
commit
af55eda16b
|
@ -462,7 +462,7 @@ namespace OpenSim.Framework
|
||||||
}
|
}
|
||||||
catch (IndexOutOfRangeException e)
|
catch (IndexOutOfRangeException e)
|
||||||
{
|
{
|
||||||
m_log.WarnFormat("[CHILD AGENT DATA]: scrtips list is shorter than object list.");
|
m_log.WarnFormat("[CHILD AGENT DATA]: scripts list is shorter than object list.");
|
||||||
}
|
}
|
||||||
|
|
||||||
attObjs.Add(info);
|
attObjs.Add(info);
|
||||||
|
|
|
@ -140,24 +140,19 @@ namespace OpenSim.Framework
|
||||||
/// PUT JSON-encoded data to a web service that returns LLSD or
|
/// PUT JSON-encoded data to a web service that returns LLSD or
|
||||||
/// JSON data
|
/// JSON data
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static OSDMap PutToService(string url, OSDMap data)
|
public static OSDMap PutToService(string url, OSDMap data, int timeout)
|
||||||
{
|
{
|
||||||
return ServiceOSDRequest(url,data,"PUT", 20000);
|
return ServiceOSDRequest(url,data, "PUT", timeout);
|
||||||
}
|
|
||||||
|
|
||||||
public static OSDMap PostToService(string url, OSDMap data)
|
|
||||||
{
|
|
||||||
return PostToService(url, data, 20000);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static OSDMap PostToService(string url, OSDMap data, int timeout)
|
public static OSDMap PostToService(string url, OSDMap data, int timeout)
|
||||||
{
|
{
|
||||||
return ServiceOSDRequest(url,data,"POST", timeout);
|
return ServiceOSDRequest(url, data, "POST", timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static OSDMap GetFromService(string url)
|
public static OSDMap GetFromService(string url, int timeout)
|
||||||
{
|
{
|
||||||
return ServiceOSDRequest(url,null,"GET", 20000);
|
return ServiceOSDRequest(url, null, "GET", timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static OSDMap ServiceOSDRequest(string url, OSDMap data, string method, int timeout)
|
public static OSDMap ServiceOSDRequest(string url, OSDMap data, string method, int timeout)
|
||||||
|
@ -182,9 +177,9 @@ namespace OpenSim.Framework
|
||||||
// If there is some input, write it into the request
|
// If there is some input, write it into the request
|
||||||
if (data != null)
|
if (data != null)
|
||||||
{
|
{
|
||||||
string strBuffer = OSDParser.SerializeJsonString(data);
|
string strBuffer = OSDParser.SerializeJsonString(data);
|
||||||
byte[] buffer = System.Text.Encoding.UTF8.GetBytes(strBuffer);
|
byte[] buffer = System.Text.Encoding.UTF8.GetBytes(strBuffer);
|
||||||
|
|
||||||
request.ContentType = "application/json";
|
request.ContentType = "application/json";
|
||||||
request.ContentLength = buffer.Length; //Count bytes to send
|
request.ContentLength = buffer.Length; //Count bytes to send
|
||||||
using (Stream requestStream = request.GetRequestStream())
|
using (Stream requestStream = request.GetRequestStream())
|
||||||
|
|
|
@ -179,7 +179,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// else do the remote thing
|
// else do the remote thing
|
||||||
if (!m_localBackend.IsLocalRegion(destination.RegionHandle))
|
if (!m_localBackend.IsLocalRegion(destination.RegionID))
|
||||||
{
|
{
|
||||||
return m_remoteConnector.CreateAgent(destination, aCircuit, teleportFlags, out reason);
|
return m_remoteConnector.CreateAgent(destination, aCircuit, teleportFlags, out reason);
|
||||||
}
|
}
|
||||||
|
@ -241,7 +241,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// else do the remote thing
|
// else do the remote thing
|
||||||
if (!m_localBackend.IsLocalRegion(destination.RegionHandle))
|
if (!m_localBackend.IsLocalRegion(destination.RegionID))
|
||||||
return m_remoteConnector.QueryAccess(destination, id, position, out version, out reason);
|
return m_remoteConnector.QueryAccess(destination, id, position, out version, out reason);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -1077,7 +1077,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// and it has already rezzed the attachments and started their scripts.
|
// and it has already rezzed the attachments and started their scripts.
|
||||||
// We do the following only for non-login agents, because their scripts
|
// We do the following only for non-login agents, because their scripts
|
||||||
// haven't started yet.
|
// haven't started yet.
|
||||||
if (wasChild)
|
if (wasChild && Attachments != null && Attachments.Count > 0)
|
||||||
{
|
{
|
||||||
m_log.DebugFormat("[SCENE PRESENCE]: Restarting scripts in attachments...");
|
m_log.DebugFormat("[SCENE PRESENCE]: Restarting scripts in attachments...");
|
||||||
// Resume scripts
|
// Resume scripts
|
||||||
|
|
|
@ -306,7 +306,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||||
args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString());
|
args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString());
|
||||||
args["teleport_flags"] = OSD.FromString(flags.ToString());
|
args["teleport_flags"] = OSD.FromString(flags.ToString());
|
||||||
|
|
||||||
OSDMap result = WebUtil.PostToService(uri,args);
|
OSDMap result = WebUtil.PostToService(uri, args, 20000);
|
||||||
if (result["Success"].AsBoolean())
|
if (result["Success"].AsBoolean())
|
||||||
{
|
{
|
||||||
OSDMap unpacked = (OSDMap)result["_Result"];
|
OSDMap unpacked = (OSDMap)result["_Result"];
|
||||||
|
|
|
@ -102,7 +102,7 @@ namespace OpenSim.Services.Connectors.Simulation
|
||||||
args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString());
|
args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString());
|
||||||
args["teleport_flags"] = OSD.FromString(flags.ToString());
|
args["teleport_flags"] = OSD.FromString(flags.ToString());
|
||||||
|
|
||||||
OSDMap result = WebUtil.PostToService(uri, args, 5000);
|
OSDMap result = WebUtil.PostToService(uri, args, 20000);
|
||||||
if (result["Success"].AsBoolean())
|
if (result["Success"].AsBoolean())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
@ -126,7 +126,7 @@ namespace OpenSim.Services.Connectors.Simulation
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool UpdateAgent(GridRegion destination, AgentData data)
|
public bool UpdateAgent(GridRegion destination, AgentData data)
|
||||||
{
|
{
|
||||||
return UpdateAgent(destination, (IAgentData)data);
|
return UpdateAgent(destination, (IAgentData)data, 200000); // yes, 200 seconds
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -181,7 +181,7 @@ namespace OpenSim.Services.Connectors.Simulation
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateAgent(destination,(IAgentData)pos);
|
UpdateAgent(destination, (IAgentData)pos, 10000);
|
||||||
}
|
}
|
||||||
|
|
||||||
// unreachable
|
// unreachable
|
||||||
|
@ -191,7 +191,7 @@ namespace OpenSim.Services.Connectors.Simulation
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This is the worker function to send AgentData to a neighbor region
|
/// This is the worker function to send AgentData to a neighbor region
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private bool UpdateAgent(GridRegion destination, IAgentData cAgentData)
|
private bool UpdateAgent(GridRegion destination, IAgentData cAgentData, int timeout)
|
||||||
{
|
{
|
||||||
// m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: UpdateAgent start");
|
// m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: UpdateAgent start");
|
||||||
|
|
||||||
|
@ -207,7 +207,7 @@ namespace OpenSim.Services.Connectors.Simulation
|
||||||
args["destination_name"] = OSD.FromString(destination.RegionName);
|
args["destination_name"] = OSD.FromString(destination.RegionName);
|
||||||
args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString());
|
args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString());
|
||||||
|
|
||||||
OSDMap result = WebUtil.PutToService(uri,args);
|
OSDMap result = WebUtil.PutToService(uri, args, timeout);
|
||||||
return result["Success"].AsBoolean();
|
return result["Success"].AsBoolean();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
@ -233,7 +233,7 @@ namespace OpenSim.Services.Connectors.Simulation
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
OSDMap result = WebUtil.GetFromService(uri);
|
OSDMap result = WebUtil.GetFromService(uri, 10000);
|
||||||
if (result["Success"].AsBoolean())
|
if (result["Success"].AsBoolean())
|
||||||
{
|
{
|
||||||
// OSDMap args = Util.GetOSDMap(result["_RawResult"].AsString());
|
// OSDMap args = Util.GetOSDMap(result["_RawResult"].AsString());
|
||||||
|
@ -275,27 +275,30 @@ namespace OpenSim.Services.Connectors.Simulation
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
OSDMap result = WebUtil.ServiceOSDRequest(uri, request, "QUERYACCESS", 10000);
|
OSDMap result = WebUtil.ServiceOSDRequest(uri, request, "QUERYACCESS", 10000);
|
||||||
OSDMap data = (OSDMap)result["_Result"];
|
|
||||||
|
|
||||||
bool success = result["success"].AsBoolean();
|
bool success = result["success"].AsBoolean();
|
||||||
reason = data["reason"].AsString();
|
if (result.ContainsKey("_Result"))
|
||||||
if (data["version"] != null && data["version"].AsString() != string.Empty)
|
{
|
||||||
version = data["version"].AsString();
|
OSDMap data = (OSDMap)result["_Result"];
|
||||||
|
|
||||||
m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: QueryAccess to {0} returned {1} version {2} ({3})", uri, success, version, data["version"].AsString());
|
reason = data["reason"].AsString();
|
||||||
|
if (data["version"] != null && data["version"].AsString() != string.Empty)
|
||||||
|
version = data["version"].AsString();
|
||||||
|
|
||||||
|
m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: QueryAccess to {0} returned {1} version {2} ({3})", uri, success, version, data["version"].AsString());
|
||||||
|
}
|
||||||
|
|
||||||
if (!success)
|
if (!success)
|
||||||
{
|
{
|
||||||
if (data.ContainsKey("Message"))
|
if (result.ContainsKey("Message"))
|
||||||
{
|
{
|
||||||
string message = data["Message"].AsString();
|
string message = result["Message"].AsString();
|
||||||
if (message == "Service request failed: [MethodNotAllowed] MethodNotAllowed") // Old style region
|
if (message == "Service request failed: [MethodNotAllowed] MethodNotAllowed") // Old style region
|
||||||
{
|
{
|
||||||
m_log.Info("[REMOTE SIMULATION CONNECTOR]: The above web util error was caused by a TP to a sim that doesn't support QUERYACCESS and can be ignored");
|
m_log.Info("[REMOTE SIMULATION CONNECTOR]: The above web util error was caused by a TP to a sim that doesn't support QUERYACCESS and can be ignored");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
reason = data["Message"];
|
reason = result["Message"];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -401,7 +404,7 @@ namespace OpenSim.Services.Connectors.Simulation
|
||||||
args["destination_name"] = OSD.FromString(destination.RegionName);
|
args["destination_name"] = OSD.FromString(destination.RegionName);
|
||||||
args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString());
|
args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString());
|
||||||
|
|
||||||
WebUtil.PostToService(uri, args);
|
WebUtil.PostToService(uri, args, 40000);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue