aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
diff options
context:
space:
mode:
authorCharles Krinke2008-06-27 02:22:33 +0000
committerCharles Krinke2008-06-27 02:22:33 +0000
commit3697e0898c83597914956157b4bbf880b83d948b (patch)
tree525dc3728b46f92a53e68e65b0ecb1638c3ffbd7 /OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
parentMantis#1591. Thank you graciously, Sempuki for a patch that: (diff)
downloadopensim-SC-3697e0898c83597914956157b4bbf880b83d948b.zip
opensim-SC-3697e0898c83597914956157b4bbf880b83d948b.tar.gz
opensim-SC-3697e0898c83597914956157b4bbf880b83d948b.tar.bz2
opensim-SC-3697e0898c83597914956157b4bbf880b83d948b.tar.xz
Mantis#1612. Thank you, kindly, Matth for a patch that:
Adds the beginnints of llRemoteLoadScriptPin() and llSetRemoteScriptAccessPin().
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.Inventory.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs98
1 files changed, 98 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index b67de7e..2bd2bad 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -1285,7 +1285,105 @@ namespace OpenSim.Region.Environment.Scenes
1285 } 1285 }
1286 } 1286 }
1287 1287
1288 /// <summary>
1289 /// Rez a script into a prim's inventory from another prim
1290 /// </summary>
1291 /// <param name="remoteClient"></param>
1292 /// <param name="itemID"> </param>
1293 /// <param name="localID"></param>
1294 public void RezScript(LLUUID srcId, SceneObjectPart srcPart, LLUUID destId, int pin, int running, int start_param)
1295 {
1296 TaskInventoryItem srcTaskItem = srcPart.GetInventoryItem(srcId);
1297
1298 if (srcTaskItem == null)
1299 {
1300 // error was already logged
1301 return;
1302 }
1303
1304 SceneObjectPart destPart = GetSceneObjectPart(destId);
1305
1306 if (destPart == null)
1307 {
1308 m_log.ErrorFormat(
1309 "[PRIM INVENTORY]: " +
1310 "Could not find script for ID {0}",
1311 destId);
1312 return;
1313 }
1314
1315 if (destPart.ScriptAccessPin != pin)
1316 {
1317 m_log.WarnFormat(
1318 "[PRIM INVENTORY]: " +
1319 "Script in object {0} : {1}, attempted to load script {2} : {3} into object {4} : {5} with invalid pin {6}",
1320 srcPart.Name, srcId, srcTaskItem.Name, srcTaskItem.ItemID, destPart.Name, destId, pin);
1321 // the LSL Wiki says we are supposed to shout on the DEBUG_CHANNEL -
1322 // "Object: Task Object trying to illegally load script onto task Other_Object!"
1323 // How do we should from in here?
1324 return;
1325 }
1326
1327 TaskInventoryItem destTaskItem = new TaskInventoryItem();
1328
1329 destTaskItem.ItemID = LLUUID.Random();
1330 destTaskItem.CreatorID = srcTaskItem.CreatorID;
1331 destTaskItem.AssetID = srcTaskItem.AssetID;
1332 destTaskItem.GroupID = destPart.GroupID;
1333 destTaskItem.OwnerID = destPart.OwnerID;
1334 destTaskItem.ParentID = destPart.UUID;
1335 destTaskItem.ParentPartID = destPart.UUID;
1336
1337 destTaskItem.BaseMask = srcTaskItem.BaseMask;
1338 destTaskItem.EveryoneMask = srcTaskItem.EveryoneMask;
1339 destTaskItem.GroupMask = srcTaskItem.GroupMask;
1340 destTaskItem.OwnerMask = srcTaskItem.OwnerMask;
1341 destTaskItem.NextOwnerMask = srcTaskItem.NextOwnerMask;
1342 destTaskItem.Flags = srcTaskItem.Flags;
1343
1344 if (destPart.OwnerID != srcPart.OwnerID)
1345 {
1346 if (ExternalChecks.ExternalChecksPropagatePermissions())
1347 {
1348 destTaskItem.OwnerMask = srcTaskItem.OwnerMask &
1349 srcTaskItem.NextOwnerMask;
1350 destTaskItem.GroupMask = srcTaskItem.GroupMask &
1351 srcTaskItem.NextOwnerMask;
1352 destTaskItem.EveryoneMask = srcTaskItem.EveryoneMask &
1353 srcTaskItem.NextOwnerMask;
1354 destTaskItem.BaseMask = srcTaskItem.BaseMask &
1355 srcTaskItem.NextOwnerMask;
1356 destTaskItem.OwnerMask |= 8; // Slam!
1357 }
1358 }
1288 1359
1360 destTaskItem.Description = srcTaskItem.Description;
1361 destTaskItem.Name = srcTaskItem.Name;
1362 destTaskItem.InvType = srcTaskItem.InvType;
1363 destTaskItem.Type = srcTaskItem.Type;
1364
1365 // need something like destPart.AddInventoryItemExclusive(destTaskItem);
1366 // this function is supposed to silently overwrite an existing script with the same name
1367
1368 destPart.AddInventoryItem(destTaskItem);
1369
1370 if ( running > 0 )
1371 {
1372 if (ExternalChecks.ExternalChecksCanRunScript(destTaskItem.AssetID, destPart.UUID, destPart.OwnerID))
1373 {
1374 // why doesn't the start_param propogate?
1375 destPart.StartScript(destTaskItem, start_param);
1376 }
1377 }
1378
1379 ScenePresence avatar;
1380
1381 if(TryGetAvatar(srcTaskItem.OwnerID, out avatar))
1382 {
1383 destPart.GetProperties(avatar.ControllingClient);
1384 }
1385 }
1386
1289 /// <summary> 1387 /// <summary>
1290 /// Called when an object is removed from the environment into inventory. 1388 /// Called when an object is removed from the environment into inventory.
1291 /// </summary> 1389 /// </summary>