aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs18
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs1
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/XEngine.cs56
4 files changed, 57 insertions, 20 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 5ea14c7..3f0af6d 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -3109,8 +3109,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3109 return; 3109 return;
3110 } 3110 }
3111 3111
3112 string reason;
3112 money.ObjectGiveMoney( 3113 money.ObjectGiveMoney(
3113 m_host.ParentGroup.RootPart.UUID, m_host.ParentGroup.RootPart.OwnerID, toID, amount,UUID.Zero); 3114 m_host.ParentGroup.RootPart.UUID, m_host.ParentGroup.RootPart.OwnerID, toID, amount,UUID.Zero, out reason);
3114 }); 3115 });
3115 3116
3116 return 0; 3117 return 0;
@@ -7105,7 +7106,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7105 UUID key; 7106 UUID key;
7106 ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition); 7107 ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition);
7107 7108
7108 if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageBanned)) 7109 if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageBanned, false))
7109 { 7110 {
7110 int expires = 0; 7111 int expires = 0;
7111 if (hours != 0) 7112 if (hours != 0)
@@ -10430,7 +10431,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
10430 // according to the docs, this command only works if script owner and land owner are the same 10431 // according to the docs, this command only works if script owner and land owner are the same
10431 // lets add estate owners and gods, too, and use the generic permission check. 10432 // lets add estate owners and gods, too, and use the generic permission check.
10432 ILandObject landObject = World.LandChannel.GetLandObject(m_host.AbsolutePosition); 10433 ILandObject landObject = World.LandChannel.GetLandObject(m_host.AbsolutePosition);
10433 if (!World.Permissions.CanEditParcelProperties(m_host.OwnerID, landObject, GroupPowers.ChangeMedia)) return; 10434 if (!World.Permissions.CanEditParcelProperties(m_host.OwnerID, landObject, GroupPowers.ChangeMedia, false)) return;
10434 10435
10435 bool update = false; // send a ParcelMediaUpdate (and possibly change the land's media URL)? 10436 bool update = false; // send a ParcelMediaUpdate (and possibly change the land's media URL)?
10436 byte loop = 0; 10437 byte loop = 0;
@@ -10873,7 +10874,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
10873 m_host.AddScriptLPS(1); 10874 m_host.AddScriptLPS(1);
10874 UUID key; 10875 UUID key;
10875 ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition); 10876 ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition);
10876 if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageBanned)) 10877 if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageBanned, false))
10877 { 10878 {
10878 int expires = 0; 10879 int expires = 0;
10879 if (hours != 0) 10880 if (hours != 0)
@@ -10914,7 +10915,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
10914 m_host.AddScriptLPS(1); 10915 m_host.AddScriptLPS(1);
10915 UUID key; 10916 UUID key;
10916 ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition); 10917 ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition);
10917 if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageAllowed)) 10918 if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageAllowed, false))
10918 { 10919 {
10919 if (UUID.TryParse(avatar, out key)) 10920 if (UUID.TryParse(avatar, out key))
10920 { 10921 {
@@ -10941,7 +10942,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
10941 m_host.AddScriptLPS(1); 10942 m_host.AddScriptLPS(1);
10942 UUID key; 10943 UUID key;
10943 ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition); 10944 ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition);
10944 if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageBanned)) 10945 if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageBanned, false))
10945 { 10946 {
10946 if (UUID.TryParse(avatar, out key)) 10947 if (UUID.TryParse(avatar, out key))
10947 { 10948 {
@@ -12784,8 +12785,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
12784 return; 12785 return;
12785 } 12786 }
12786 12787
12788 string reason;
12787 bool result = money.ObjectGiveMoney( 12789 bool result = money.ObjectGiveMoney(
12788 m_host.ParentGroup.RootPart.UUID, m_host.ParentGroup.RootPart.OwnerID, toID, amount, txn); 12790 m_host.ParentGroup.RootPart.UUID, m_host.ParentGroup.RootPart.OwnerID, toID, amount, txn, out reason);
12789 12791
12790 if (result) 12792 if (result)
12791 { 12793 {
@@ -12793,7 +12795,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
12793 return; 12795 return;
12794 } 12796 }
12795 12797
12796 replydata = "LINDENDOLLAR_INSUFFICIENTFUNDS"; 12798 replydata = reason;
12797 } 12799 }
12798 finally 12800 finally
12799 { 12801 {
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index f4e4f44..9c148d1 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -1434,7 +1434,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1434 return; 1434 return;
1435 } 1435 }
1436 1436
1437 if (!World.Permissions.CanEditParcelProperties(m_host.OwnerID, startLandObject, GroupPowers.LandOptions)) 1437 if (!World.Permissions.CanEditParcelProperties(m_host.OwnerID, startLandObject, GroupPowers.LandOptions, false))
1438 { 1438 {
1439 OSSLShoutError("You do not have permission to modify the parcel"); 1439 OSSLShoutError("You do not have permission to modify the parcel");
1440 return; 1440 return;
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
index 26850c4..a2ac9c5 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
@@ -231,6 +231,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
231 ItemID = ScriptTask.ItemID; 231 ItemID = ScriptTask.ItemID;
232 AssetID = ScriptTask.AssetID; 232 AssetID = ScriptTask.AssetID;
233 } 233 }
234 LocalID = part.LocalId;
234 235
235 PrimName = part.ParentGroup.Name; 236 PrimName = part.ParentGroup.Name;
236 StartParam = startParam; 237 StartParam = startParam;
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index 17243ab..04a4e53 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -1316,13 +1316,21 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1316 1316
1317 ScriptInstance instance = null; 1317 ScriptInstance instance = null;
1318 // Create the object record 1318 // Create the object record
1319 UUID appDomain = assetID;
1320
1321
1322
1319 lockScriptsForRead(true); 1323 lockScriptsForRead(true);
1320 if ((!m_Scripts.ContainsKey(itemID)) || 1324 if ((!m_Scripts.ContainsKey(itemID)) ||
1321 (m_Scripts[itemID].AssetID != assetID)) 1325 (m_Scripts[itemID].AssetID != assetID))
1322 { 1326 {
1323 lockScriptsForRead(false); 1327 lockScriptsForRead(false);
1324 1328 instance = new ScriptInstance(this, part,
1325 UUID appDomain = assetID; 1329 item,
1330 startParam, postOnRez,
1331 m_MaxScriptQueue);
1332
1333
1326 1334
1327 if (part.ParentGroup.IsAttachment) 1335 if (part.ParentGroup.IsAttachment)
1328 appDomain = part.ParentGroup.RootPart.UUID; 1336 appDomain = part.ParentGroup.RootPart.UUID;
@@ -1345,9 +1353,39 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1345 sandbox = AppDomain.CreateDomain( 1353 sandbox = AppDomain.CreateDomain(
1346 m_Scene.RegionInfo.RegionID.ToString(), 1354 m_Scene.RegionInfo.RegionID.ToString(),
1347 evidence, appSetup); 1355 evidence, appSetup);
1348 m_AppDomains[appDomain].AssemblyResolve += 1356 if (m_AppDomains.ContainsKey(appDomain))
1349 new ResolveEventHandler( 1357 {
1350 AssemblyResolver.OnAssemblyResolve); 1358 m_AppDomains[appDomain].AssemblyResolve +=
1359 new ResolveEventHandler(
1360 AssemblyResolver.OnAssemblyResolve);
1361 if (m_DomainScripts.ContainsKey(appDomain))
1362 {
1363 m_DomainScripts[appDomain].Add(itemID);
1364 }
1365 else
1366 {
1367 m_DomainScripts.Add(appDomain, new List<UUID>());
1368 m_DomainScripts[appDomain].Add(itemID);
1369 }
1370 }
1371 else
1372 {
1373 m_AppDomains.Add(appDomain, sandbox);
1374 m_AppDomains[appDomain].AssemblyResolve +=
1375 new ResolveEventHandler(
1376 AssemblyResolver.OnAssemblyResolve);
1377 if (m_DomainScripts.ContainsKey(appDomain))
1378 {
1379 m_DomainScripts[appDomain].Add(itemID);
1380 }
1381 else
1382 {
1383 m_DomainScripts.Add(appDomain, new List<UUID>());
1384 m_DomainScripts[appDomain].Add(itemID);
1385 }
1386
1387 }
1388
1351 } 1389 }
1352 else 1390 else
1353 { 1391 {
@@ -1373,12 +1411,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1373 return false; 1411 return false;
1374 } 1412 }
1375 } 1413 }
1376 m_DomainScripts[appDomain].Add(itemID); 1414
1377
1378 instance = new ScriptInstance(this, part,
1379 item,
1380 startParam, postOnRez,
1381 m_MaxScriptQueue);
1382 1415
1383 instance.Load(m_AppDomains[appDomain], assembly, stateSource); 1416 instance.Load(m_AppDomains[appDomain], assembly, stateSource);
1384// m_log.DebugFormat( 1417// m_log.DebugFormat(
@@ -1502,6 +1535,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1502 if (handlerObjectRemoved != null) 1535 if (handlerObjectRemoved != null)
1503 { 1536 {
1504 SceneObjectPart part = m_Scene.GetSceneObjectPart(localID); 1537 SceneObjectPart part = m_Scene.GetSceneObjectPart(localID);
1538 if (part != null)
1505 handlerObjectRemoved(part.UUID); 1539 handlerObjectRemoved(part.UUID);
1506 } 1540 }
1507 1541