aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine
diff options
context:
space:
mode:
authorMelanie Thielker2008-12-14 22:27:40 +0000
committerMelanie Thielker2008-12-14 22:27:40 +0000
commit3aa7ad24dab4896a92a35c8246a26aa25e69361a (patch)
tree5e40e0103a5ab7368e3081242445e04bc7d236f8 /OpenSim/Region/ScriptEngine
parentWas missed some time ago, it seems... (diff)
downloadopensim-SC_OLD-3aa7ad24dab4896a92a35c8246a26aa25e69361a.zip
opensim-SC_OLD-3aa7ad24dab4896a92a35c8246a26aa25e69361a.tar.gz
opensim-SC_OLD-3aa7ad24dab4896a92a35c8246a26aa25e69361a.tar.bz2
opensim-SC_OLD-3aa7ad24dab4896a92a35c8246a26aa25e69361a.tar.xz
Make scripted item and folder gives pop up a "accept, decline" message
and allow deletion of the just received item.
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs60
1 files changed, 54 insertions, 6 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index ab7e934..b15189e 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -79,6 +79,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
79 private DateTime m_timer = DateTime.Now; 79 private DateTime m_timer = DateTime.Now;
80 private bool m_waitingForScriptAnswer=false; 80 private bool m_waitingForScriptAnswer=false;
81 private bool m_automaticLinkPermission=false; 81 private bool m_automaticLinkPermission=false;
82 private IMessageTransferModule m_TransferModule = null;
82 83
83 //private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 84 //private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
84 85
@@ -98,6 +99,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
98 m_automaticLinkPermission = 99 m_automaticLinkPermission =
99 m_ScriptEngine.Config.GetBoolean("AutomaticLinkPermission", false); 100 m_ScriptEngine.Config.GetBoolean("AutomaticLinkPermission", false);
100 101
102 m_TransferModule =
103 m_ScriptEngine.World.RequestModuleInterface<IMessageTransferModule>();
101 AsyncCommands = new AsyncCommandManager(ScriptEngine); 104 AsyncCommands = new AsyncCommandManager(ScriptEngine);
102 } 105 }
103 106
@@ -2654,11 +2657,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2654 msg.RegionID = World.RegionInfo.RegionID.Guid;//RegionID.Guid; 2657 msg.RegionID = World.RegionInfo.RegionID.Guid;//RegionID.Guid;
2655 msg.binaryBucket = new byte[0];// binaryBucket; 2658 msg.binaryBucket = new byte[0];// binaryBucket;
2656 2659
2657 IMessageTransferModule tr = World.RequestModuleInterface<IMessageTransferModule>(); 2660 if (m_TransferModule != null)
2658
2659 if (tr != null)
2660 { 2661 {
2661 tr.SendInstantMessage(msg, delegate(bool success) {} ); 2662 m_TransferModule.SendInstantMessage(msg, delegate(bool success) {} );
2662 } 2663 }
2663 ScriptSleep(2000); 2664 ScriptSleep(2000);
2664 } 2665 }
@@ -3318,6 +3319,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3318 bool found = false; 3319 bool found = false;
3319 UUID destId = UUID.Zero; 3320 UUID destId = UUID.Zero;
3320 UUID objId = UUID.Zero; 3321 UUID objId = UUID.Zero;
3322 int assetType = 0;
3323 string objName = String.Empty;
3321 3324
3322 if (!UUID.TryParse(destination, out destId)) 3325 if (!UUID.TryParse(destination, out destId))
3323 { 3326 {
@@ -3332,6 +3335,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3332 { 3335 {
3333 found = true; 3336 found = true;
3334 objId = inv.Key; 3337 objId = inv.Key;
3338 assetType = inv.Value.Type;
3339 objName = inv.Value.Name;
3335 break; 3340 break;
3336 } 3341 }
3337 } 3342 }
@@ -3346,7 +3351,29 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3346 if (World.GetScenePresence(destId) != null) 3351 if (World.GetScenePresence(destId) != null)
3347 { 3352 {
3348 // destination is an avatar 3353 // destination is an avatar
3349 World.MoveTaskInventoryItem(destId, UUID.Zero, m_host, objId); 3354 InventoryItemBase agentItem =
3355 World.MoveTaskInventoryItem(destId, UUID.Zero, m_host, objId);
3356
3357 if (agentItem == null)
3358 return;
3359
3360 byte[] bucket = new byte[17];
3361 bucket[0] = (byte)assetType;
3362 byte[] objBytes = objId.GetBytes();
3363 Array.Copy(objBytes, 0, bucket, 1, 16);
3364
3365 GridInstantMessage msg = new GridInstantMessage(World,
3366 m_host.UUID, m_host.Name+", an object owned by "+
3367 resolveName(m_host.OwnerID)+",", destId,
3368 (byte)InstantMessageDialog.InventoryOffered,
3369 false, objName+"\n"+m_host.Name+" is located at "+
3370 World.RegionInfo.RegionName+" "+
3371 m_host.AbsolutePosition.ToString(),
3372 agentItem.ID, true, m_host.AbsolutePosition,
3373 bucket);
3374
3375 if (m_TransferModule != null)
3376 m_TransferModule.SendInstantMessage(msg, delegate(bool success) {} );
3350 } 3377 }
3351 else 3378 else
3352 { 3379 {
@@ -5485,7 +5512,28 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5485 if (itemList.Count == 0) 5512 if (itemList.Count == 0)
5486 return; 5513 return;
5487 5514
5488 m_ScriptEngine.World.MoveTaskInventoryItems(destID, category, m_host, itemList); 5515 UUID folderID = m_ScriptEngine.World.MoveTaskInventoryItems(destID, category, m_host, itemList);
5516
5517 if (folderID == UUID.Zero)
5518 return;
5519
5520 byte[] bucket = new byte[17];
5521 bucket[0] = (byte)AssetType.Folder;
5522 byte[] objBytes = folderID.GetBytes();
5523 Array.Copy(objBytes, 0, bucket, 1, 16);
5524
5525 GridInstantMessage msg = new GridInstantMessage(World,
5526 m_host.UUID, m_host.Name+", an object owned by "+
5527 resolveName(m_host.OwnerID)+",", destID,
5528 (byte)InstantMessageDialog.InventoryOffered,
5529 false, category+"\n"+m_host.Name+" is located at "+
5530 World.RegionInfo.RegionName+" "+
5531 m_host.AbsolutePosition.ToString(),
5532 folderID, true, m_host.AbsolutePosition,
5533 bucket);
5534
5535 if (m_TransferModule != null)
5536 m_TransferModule.SendInstantMessage(msg, delegate(bool success) {} );
5489 } 5537 }
5490 5538
5491 public void llSetVehicleType(int type) 5539 public void llSetVehicleType(int type)