Merge remote-tracking branch 'remotes/origin/avination' into teravuswork

avinationmerge
teravus 2013-01-26 07:23:16 -05:00
commit 60eb0f36b3
8 changed files with 90 additions and 51 deletions

View File

@ -70,6 +70,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
private string m_name = "RemoteAdminPlugin";
private string m_version = "0.0";
private string m_openSimVersion;
public string Version
{
@ -89,6 +90,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController
public void Initialise(OpenSimBase openSim)
{
m_openSimVersion = openSim.GetVersionText();
m_configSource = openSim.ConfigSource.Source;
try
{
@ -159,6 +162,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
// Misc
availableMethods["admin_refresh_search"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcRefreshSearch);
availableMethods["admin_get_opensim_version"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcGetOpenSimVersion);
// Either enable full remote functionality or just selected features
string enabledMethods = m_config.GetString("enabled_methods", "all");
@ -1977,6 +1981,18 @@ namespace OpenSim.ApplicationPlugins.RemoteController
m_log.Info("[RADMIN]: Refresh Search Request complete");
}
private void XmlRpcGetOpenSimVersion(XmlRpcRequest request, XmlRpcResponse response, IPEndPoint remoteClient)
{
m_log.Info("[RADMIN]: Received Get OpenSim Version Request");
Hashtable responseData = (Hashtable)response.Value;
responseData["version"] = m_openSimVersion;
responseData["success"] = true;
m_log.Info("[RADMIN]: Get OpenSim Version Request complete");
}
/// <summary>
/// Parse a float with the given parameter name from a request data hash table.
/// </summary>

View File

@ -531,7 +531,7 @@ namespace OpenSim.Framework.Servers
}
}
protected string GetVersionText()
public string GetVersionText()
{
return String.Format("Version: {0} (interface version {1})", m_version, VersionInfo.MajorInterfaceVersion);
}
@ -563,4 +563,4 @@ namespace OpenSim.Framework.Servers
m_console.OutputFormat(format, components);
}
}
}
}

View File

@ -402,14 +402,15 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
{
// Record that this agent is in transit so that we can prevent simultaneous requests and do later detection
// of whether the destination region completes the teleport.
if (!m_entityTransferStateMachine.SetInTransit(sp.UUID))
{
m_log.DebugFormat(
"[ENTITY TRANSFER MODULE]: Ignoring teleport request of {0} {1} to {2} ({3}) {4}/{5} - agent is already in transit.",
sp.Name, sp.UUID, reg.ServerURI, finalDestination.ServerURI, finalDestination.RegionName, position);
return;
}
m_entityTransferStateMachine.SetInTransit(sp.UUID);
// if (!m_entityTransferStateMachine.SetInTransit(sp.UUID))
// {
// m_log.DebugFormat(
// "[ENTITY TRANSFER MODULE]: Ignoring teleport request of {0} {1} to {2} ({3}) {4}/{5} - agent is already in transit.",
// sp.Name, sp.UUID, reg.ServerURI, finalDestination.ServerURI, finalDestination.RegionName, position);
//
// return;
// }
if (reg == null || finalDestination == null)
{

View File

@ -533,6 +533,9 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
ResponseBody = e.Message;
}
if (ResponseBody == null)
ResponseBody = String.Empty;
_finished = true;
return;
}
@ -546,6 +549,9 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
response.Close();
}
if (ResponseBody == null)
ResponseBody = String.Empty;
_finished = true;
}

View File

@ -2065,11 +2065,11 @@ namespace OpenSim.Region.Framework.Scenes
EventManager.TriggerPrimsLoaded(this);
}
public bool SuportsRayCastFiltered()
public bool SupportsRayCastFiltered()
{
if (PhysicsScene == null)
return false;
return PhysicsScene.SuportsRaycastWorldFiltered();
return PhysicsScene.SupportsRaycastWorldFiltered();
}
public object RayCastFiltered(Vector3 position, Vector3 direction, float length, int Count, RayFilterFlags filter)

View File

@ -350,7 +350,7 @@ namespace OpenSim.Region.Physics.Manager
return null;
}
public virtual bool SuportsRaycastWorldFiltered()
public virtual bool SupportsRaycastWorldFiltered()
{
return false;
}

View File

@ -2643,7 +2643,7 @@ namespace OpenSim.Region.Physics.OdePlugin
}
}
public override bool SuportsRaycastWorldFiltered()
public override bool SupportsRaycastWorldFiltered()
{
return true;
}

View File

@ -3019,38 +3019,38 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_Integer llGiveMoney(string destination, int amount)
{
m_host.AddScriptLPS(1);
if (m_item.PermsGranter == UUID.Zero)
return 0;
if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_DEBIT) == 0)
Util.FireAndForget(x =>
{
LSLError("No permissions to give money");
return 0;
}
m_host.AddScriptLPS(1);
UUID toID = new UUID();
if (m_item.PermsGranter == UUID.Zero)
return;
if (!UUID.TryParse(destination, out toID))
{
LSLError("Bad key in llGiveMoney");
return 0;
}
if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_DEBIT) == 0)
{
LSLError("No permissions to give money");
return;
}
IMoneyModule money = World.RequestModuleInterface<IMoneyModule>();
UUID toID = new UUID();
if (money == null)
{
NotImplemented("llGiveMoney");
return 0;
}
if (!UUID.TryParse(destination, out toID))
{
LSLError("Bad key in llGiveMoney");
return;
}
bool result = money.ObjectGiveMoney(
m_host.ParentGroup.RootPart.UUID, m_host.ParentGroup.RootPart.OwnerID, toID, amount,UUID.Zero);
IMoneyModule money = World.RequestModuleInterface<IMoneyModule>();
if (result)
return 1;
if (money == null)
{
NotImplemented("llGiveMoney");
return;
}
money.ObjectGiveMoney(
m_host.ParentGroup.RootPart.UUID, m_host.ParentGroup.RootPart.OwnerID, toID, amount,UUID.Zero);
});
return 0;
}
@ -7322,7 +7322,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
m_host.AddScriptLPS(1);
IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>();
if (xmlrpcMod.IsEnabled())
if (xmlrpcMod != null && xmlrpcMod.IsEnabled())
{
UUID channelID = xmlrpcMod.OpenXMLRPCChannel(m_host.LocalId, m_item.ItemID, UUID.Zero);
IXmlRpcRouter xmlRpcRouter = m_ScriptEngine.World.RequestModuleInterface<IXmlRpcRouter>();
@ -7354,6 +7354,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.AddScriptLPS(1);
IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>();
ScriptSleep(3000);
if (xmlrpcMod == null)
return "";
return (xmlrpcMod.SendRemoteData(m_host.LocalId, m_item.ItemID, channel, dest, idata, sdata)).ToString();
}
@ -7361,7 +7363,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
m_host.AddScriptLPS(1);
IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>();
xmlrpcMod.RemoteDataReply(channel, message_id, sdata, idata);
if (xmlrpcMod != null)
xmlrpcMod.RemoteDataReply(channel, message_id, sdata, idata);
ScriptSleep(3000);
}
@ -7369,7 +7372,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
m_host.AddScriptLPS(1);
IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>();
xmlrpcMod.CloseXMLRPCChannel((UUID)channel);
if (xmlrpcMod != null)
xmlrpcMod.CloseXMLRPCChannel((UUID)channel);
ScriptSleep(1000);
}
@ -12207,7 +12211,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
bool checkPhysical = !((rejectTypes & ScriptBaseClass.RC_REJECT_PHYSICAL) == ScriptBaseClass.RC_REJECT_PHYSICAL);
if (World.SuportsRayCastFiltered())
if (World.SupportsRayCastFiltered())
{
if (dist == 0)
return list;
@ -12270,13 +12274,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
else
{
if (checkTerrain)
{
ContactResult? groundContact = GroundIntersection(rayStart, rayEnd);
if (groundContact != null)
results.Add((ContactResult)groundContact);
}
if (checkAgents)
{
ContactResult[] agentHits = AvatarIntersection(rayStart, rayEnd);
@ -12292,6 +12289,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
}
// Double check this
if (checkTerrain)
{
bool skipGroundCheck = false;
foreach (ContactResult c in results)
{
if (c.ConsumerID == 0) // Physics gave us a ground collision
skipGroundCheck = true;
}
if (!skipGroundCheck)
{
ContactResult? groundContact = GroundIntersection(rayStart, rayEnd);
if (groundContact != null)
results.Add((ContactResult)groundContact);
}
}
results.Sort(delegate(ContactResult a, ContactResult b)
{
return a.Depth.CompareTo(b.Depth);
@ -12585,7 +12601,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
bool result = money.ObjectGiveMoney(
m_host.ParentGroup.RootPart.UUID, m_host.ParentGroup.RootPart.OwnerID, toID, amount,UUID.Zero);
m_host.ParentGroup.RootPart.UUID, m_host.ParentGroup.RootPart.OwnerID, toID, amount, txn);
if (result)
{