aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
diff options
context:
space:
mode:
authorteravus2013-01-26 07:23:16 -0500
committerteravus2013-01-26 07:23:16 -0500
commit60eb0f36b3e8146eec26aa83cff7d89782026d9d (patch)
tree726fd9aa4d47733f2596bfd032ce215f565117b3 /OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
parent* Handle a NRE with Baked Textures that may result in a failed appearance. ... (diff)
parentMake llGiveMoney async again. The return value is now the constant 1 to make (diff)
downloadopensim-SC-60eb0f36b3e8146eec26aa83cff7d89782026d9d.zip
opensim-SC-60eb0f36b3e8146eec26aa83cff7d89782026d9d.tar.gz
opensim-SC-60eb0f36b3e8146eec26aa83cff7d89782026d9d.tar.bz2
opensim-SC-60eb0f36b3e8146eec26aa83cff7d89782026d9d.tar.xz
Merge remote-tracking branch 'remotes/origin/avination' into teravuswork
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs90
1 files changed, 53 insertions, 37 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index fcb68b2..53c6e5c 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -3019,38 +3019,38 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3019 3019
3020 public LSL_Integer llGiveMoney(string destination, int amount) 3020 public LSL_Integer llGiveMoney(string destination, int amount)
3021 { 3021 {
3022 m_host.AddScriptLPS(1); 3022 Util.FireAndForget(x =>
3023
3024 if (m_item.PermsGranter == UUID.Zero)
3025 return 0;
3026
3027 if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_DEBIT) == 0)
3028 { 3023 {
3029 LSLError("No permissions to give money"); 3024 m_host.AddScriptLPS(1);
3030 return 0;
3031 }
3032 3025
3033 UUID toID = new UUID(); 3026 if (m_item.PermsGranter == UUID.Zero)
3027 return;
3034 3028
3035 if (!UUID.TryParse(destination, out toID)) 3029 if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_DEBIT) == 0)
3036 { 3030 {
3037 LSLError("Bad key in llGiveMoney"); 3031 LSLError("No permissions to give money");
3038 return 0; 3032 return;
3039 } 3033 }
3040 3034
3041 IMoneyModule money = World.RequestModuleInterface<IMoneyModule>(); 3035 UUID toID = new UUID();
3042 3036
3043 if (money == null) 3037 if (!UUID.TryParse(destination, out toID))
3044 { 3038 {
3045 NotImplemented("llGiveMoney"); 3039 LSLError("Bad key in llGiveMoney");
3046 return 0; 3040 return;
3047 } 3041 }
3048 3042
3049 bool result = money.ObjectGiveMoney( 3043 IMoneyModule money = World.RequestModuleInterface<IMoneyModule>();
3050 m_host.ParentGroup.RootPart.UUID, m_host.ParentGroup.RootPart.OwnerID, toID, amount,UUID.Zero);
3051 3044
3052 if (result) 3045 if (money == null)
3053 return 1; 3046 {
3047 NotImplemented("llGiveMoney");
3048 return;
3049 }
3050
3051 money.ObjectGiveMoney(
3052 m_host.ParentGroup.RootPart.UUID, m_host.ParentGroup.RootPart.OwnerID, toID, amount,UUID.Zero);
3053 });
3054 3054
3055 return 0; 3055 return 0;
3056 } 3056 }
@@ -7322,7 +7322,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7322 { 7322 {
7323 m_host.AddScriptLPS(1); 7323 m_host.AddScriptLPS(1);
7324 IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>(); 7324 IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>();
7325 if (xmlrpcMod.IsEnabled()) 7325 if (xmlrpcMod != null && xmlrpcMod.IsEnabled())
7326 { 7326 {
7327 UUID channelID = xmlrpcMod.OpenXMLRPCChannel(m_host.LocalId, m_item.ItemID, UUID.Zero); 7327 UUID channelID = xmlrpcMod.OpenXMLRPCChannel(m_host.LocalId, m_item.ItemID, UUID.Zero);
7328 IXmlRpcRouter xmlRpcRouter = m_ScriptEngine.World.RequestModuleInterface<IXmlRpcRouter>(); 7328 IXmlRpcRouter xmlRpcRouter = m_ScriptEngine.World.RequestModuleInterface<IXmlRpcRouter>();
@@ -7354,6 +7354,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7354 m_host.AddScriptLPS(1); 7354 m_host.AddScriptLPS(1);
7355 IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>(); 7355 IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>();
7356 ScriptSleep(3000); 7356 ScriptSleep(3000);
7357 if (xmlrpcMod == null)
7358 return "";
7357 return (xmlrpcMod.SendRemoteData(m_host.LocalId, m_item.ItemID, channel, dest, idata, sdata)).ToString(); 7359 return (xmlrpcMod.SendRemoteData(m_host.LocalId, m_item.ItemID, channel, dest, idata, sdata)).ToString();
7358 } 7360 }
7359 7361
@@ -7361,7 +7363,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7361 { 7363 {
7362 m_host.AddScriptLPS(1); 7364 m_host.AddScriptLPS(1);
7363 IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>(); 7365 IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>();
7364 xmlrpcMod.RemoteDataReply(channel, message_id, sdata, idata); 7366 if (xmlrpcMod != null)
7367 xmlrpcMod.RemoteDataReply(channel, message_id, sdata, idata);
7365 ScriptSleep(3000); 7368 ScriptSleep(3000);
7366 } 7369 }
7367 7370
@@ -7369,7 +7372,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7369 { 7372 {
7370 m_host.AddScriptLPS(1); 7373 m_host.AddScriptLPS(1);
7371 IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>(); 7374 IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>();
7372 xmlrpcMod.CloseXMLRPCChannel((UUID)channel); 7375 if (xmlrpcMod != null)
7376 xmlrpcMod.CloseXMLRPCChannel((UUID)channel);
7373 ScriptSleep(1000); 7377 ScriptSleep(1000);
7374 } 7378 }
7375 7379
@@ -12207,7 +12211,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
12207 bool checkPhysical = !((rejectTypes & ScriptBaseClass.RC_REJECT_PHYSICAL) == ScriptBaseClass.RC_REJECT_PHYSICAL); 12211 bool checkPhysical = !((rejectTypes & ScriptBaseClass.RC_REJECT_PHYSICAL) == ScriptBaseClass.RC_REJECT_PHYSICAL);
12208 12212
12209 12213
12210 if (World.SuportsRayCastFiltered()) 12214 if (World.SupportsRayCastFiltered())
12211 { 12215 {
12212 if (dist == 0) 12216 if (dist == 0)
12213 return list; 12217 return list;
@@ -12270,13 +12274,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
12270 } 12274 }
12271 else 12275 else
12272 { 12276 {
12273 if (checkTerrain)
12274 {
12275 ContactResult? groundContact = GroundIntersection(rayStart, rayEnd);
12276 if (groundContact != null)
12277 results.Add((ContactResult)groundContact);
12278 }
12279
12280 if (checkAgents) 12277 if (checkAgents)
12281 { 12278 {
12282 ContactResult[] agentHits = AvatarIntersection(rayStart, rayEnd); 12279 ContactResult[] agentHits = AvatarIntersection(rayStart, rayEnd);
@@ -12292,6 +12289,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
12292 } 12289 }
12293 } 12290 }
12294 12291
12292 // Double check this
12293 if (checkTerrain)
12294 {
12295 bool skipGroundCheck = false;
12296
12297 foreach (ContactResult c in results)
12298 {
12299 if (c.ConsumerID == 0) // Physics gave us a ground collision
12300 skipGroundCheck = true;
12301 }
12302
12303 if (!skipGroundCheck)
12304 {
12305 ContactResult? groundContact = GroundIntersection(rayStart, rayEnd);
12306 if (groundContact != null)
12307 results.Add((ContactResult)groundContact);
12308 }
12309 }
12310
12295 results.Sort(delegate(ContactResult a, ContactResult b) 12311 results.Sort(delegate(ContactResult a, ContactResult b)
12296 { 12312 {
12297 return a.Depth.CompareTo(b.Depth); 12313 return a.Depth.CompareTo(b.Depth);
@@ -12585,7 +12601,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
12585 } 12601 }
12586 12602
12587 bool result = money.ObjectGiveMoney( 12603 bool result = money.ObjectGiveMoney(
12588 m_host.ParentGroup.RootPart.UUID, m_host.ParentGroup.RootPart.OwnerID, toID, amount,UUID.Zero); 12604 m_host.ParentGroup.RootPart.UUID, m_host.ParentGroup.RootPart.OwnerID, toID, amount, txn);
12589 12605
12590 if (result) 12606 if (result)
12591 { 12607 {