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_name = "RemoteAdminPlugin";
private string m_version = "0.0"; private string m_version = "0.0";
private string m_openSimVersion;
public string Version public string Version
{ {
@ -89,6 +90,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController
public void Initialise(OpenSimBase openSim) public void Initialise(OpenSimBase openSim)
{ {
m_openSimVersion = openSim.GetVersionText();
m_configSource = openSim.ConfigSource.Source; m_configSource = openSim.ConfigSource.Source;
try try
{ {
@ -159,6 +162,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
// Misc // Misc
availableMethods["admin_refresh_search"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcRefreshSearch); 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 // Either enable full remote functionality or just selected features
string enabledMethods = m_config.GetString("enabled_methods", "all"); string enabledMethods = m_config.GetString("enabled_methods", "all");
@ -1977,6 +1981,18 @@ namespace OpenSim.ApplicationPlugins.RemoteController
m_log.Info("[RADMIN]: Refresh Search Request complete"); 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> /// <summary>
/// Parse a float with the given parameter name from a request data hash table. /// Parse a float with the given parameter name from a request data hash table.
/// </summary> /// </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); 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); 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 // 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. // of whether the destination region completes the teleport.
if (!m_entityTransferStateMachine.SetInTransit(sp.UUID)) 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.", // m_log.DebugFormat(
sp.Name, sp.UUID, reg.ServerURI, finalDestination.ServerURI, finalDestination.RegionName, position); // "[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; //
} // return;
// }
if (reg == null || finalDestination == null) if (reg == null || finalDestination == null)
{ {

View File

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

View File

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

View File

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

View File

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