From 001d5a5c923899b036c8135f9031867f8a431d5b Mon Sep 17 00:00:00 2001
From: MW
Date: Wed, 22 Aug 2007 17:40:26 +0000
Subject: Made SceneObjectGroup.GetChildPrim() public, for now so that script
engine can get ref to the SceneObjectPart/ IScriptHost.
---
OpenSim/Framework/General/Interfaces/IClientAPI.cs | 2 ++
OpenSim/Framework/General/NullClientAPI.cs | 1 +
OpenSim/Region/ClientStack/ClientView.API.cs | 1 +
.../ClientStack/ClientView.ProcessPackets.cs | 10 ++++++
.../Region/Environment/Scenes/SceneObjectGroup.cs | 38 +++++++++++-----------
.../Region/Environment/Scenes/SceneObjectPart.cs | 2 +-
.../Region/Examples/SimpleApp/MyNpcCharacter.cs | 1 +
7 files changed, 35 insertions(+), 20 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Framework/General/Interfaces/IClientAPI.cs b/OpenSim/Framework/General/Interfaces/IClientAPI.cs
index 24ab47a..3c41eb5 100644
--- a/OpenSim/Framework/General/Interfaces/IClientAPI.cs
+++ b/OpenSim/Framework/General/Interfaces/IClientAPI.cs
@@ -89,6 +89,7 @@ namespace OpenSim.Framework.Interfaces
public delegate void RequestTaskInventory(IClientAPI remoteClient, uint localID);
public delegate void UpdateInventoryItemTransaction(IClientAPI remoteClient, LLUUID transactionID, LLUUID assetID, LLUUID itemID);
public delegate void RezScript(IClientAPI remoteClient, LLUUID itemID, uint localID);
+ public delegate void UpdateTaskInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID folderID, uint localID);
public delegate void UDPAssetUploadRequest(IClientAPI remoteClient, LLUUID assetID, LLUUID transaction, sbyte type, byte[] data);
public delegate void XferReceive(IClientAPI remoteClient, ulong xferID, uint packetID, byte[] data);
@@ -150,6 +151,7 @@ namespace OpenSim.Framework.Interfaces
event RequestXfer OnRequestXfer;
event ConfirmXfer OnConfirmXfer;
event RezScript OnRezScript;
+ event UpdateTaskInventory OnUpdateTaskInventory;
event UUIDNameRequest OnNameFromUUIDRequest;
diff --git a/OpenSim/Framework/General/NullClientAPI.cs b/OpenSim/Framework/General/NullClientAPI.cs
index 74be103..6692fde 100644
--- a/OpenSim/Framework/General/NullClientAPI.cs
+++ b/OpenSim/Framework/General/NullClientAPI.cs
@@ -64,6 +64,7 @@ namespace OpenSim.Framework
public event RequestXfer OnRequestXfer;
public event ConfirmXfer OnConfirmXfer;
public event RezScript OnRezScript;
+ public event UpdateTaskInventory OnUpdateTaskInventory;
public event UUIDNameRequest OnNameFromUUIDRequest;
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs
index 029b948..6570a82 100644
--- a/OpenSim/Region/ClientStack/ClientView.API.cs
+++ b/OpenSim/Region/ClientStack/ClientView.API.cs
@@ -93,6 +93,7 @@ namespace OpenSim.Region.ClientStack
public event RequestXfer OnRequestXfer;
public event ConfirmXfer OnConfirmXfer;
public event RezScript OnRezScript;
+ public event UpdateTaskInventory OnUpdateTaskInventory;
public event UUIDNameRequest OnNameFromUUIDRequest;
diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
index c17f453..383c7a9 100644
--- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
+++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
@@ -476,6 +476,16 @@ namespace OpenSim.Region.ClientStack
case PacketType.UpdateTaskInventory:
//Console.WriteLine(Pack.ToString());
UpdateTaskInventoryPacket updatetask = (UpdateTaskInventoryPacket)Pack;
+ if (OnUpdateTaskInventory != null)
+ {
+ if (updatetask.UpdateData.Key == 0)
+ {
+ OnUpdateTaskInventory(this, updatetask.InventoryData.ItemID, updatetask.InventoryData.FolderID, updatetask.UpdateData.LocalID);
+ }
+ }
+ break;
+ case PacketType.MoveTaskInventory:
+ //Console.WriteLine(Pack.ToString());
break;
case PacketType.RezScript:
//Console.WriteLine(Pack.ToString());
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index 99bdda9..c50809f 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -362,7 +362,7 @@ namespace OpenSim.Region.Environment.Scenes
///
///
///
- private SceneObjectPart GetChildPrim(LLUUID primID)
+ public SceneObjectPart GetChildPart(LLUUID primID)
{
SceneObjectPart childPart = null;
if (this.m_parts.ContainsKey(primID))
@@ -377,7 +377,7 @@ namespace OpenSim.Region.Environment.Scenes
///
///
///
- private SceneObjectPart GetChildPrim(uint localID)
+ public SceneObjectPart GetChildPart(uint localID)
{
foreach (SceneObjectPart part in this.m_parts.Values)
{
@@ -543,7 +543,7 @@ namespace OpenSim.Region.Environment.Scenes
///
public void SetPartName(string name, uint localID)
{
- SceneObjectPart part = this.GetChildPrim(localID);
+ SceneObjectPart part = this.GetChildPart(localID);
if (part != null)
{
part.Name = name;
@@ -552,7 +552,7 @@ namespace OpenSim.Region.Environment.Scenes
public void SetPartDescription(string des, uint localID)
{
- SceneObjectPart part = this.GetChildPrim(localID);
+ SceneObjectPart part = this.GetChildPart(localID);
if (part != null)
{
part.Description = des;
@@ -561,7 +561,7 @@ namespace OpenSim.Region.Environment.Scenes
public void SetPartText(string text, uint localID)
{
- SceneObjectPart part = this.GetChildPrim(localID);
+ SceneObjectPart part = this.GetChildPart(localID);
if (part != null)
{
part.Text = text;
@@ -570,7 +570,7 @@ namespace OpenSim.Region.Environment.Scenes
public void SetPartText(string text, LLUUID partID)
{
- SceneObjectPart part = this.GetChildPrim(partID);
+ SceneObjectPart part = this.GetChildPart(partID);
if (part != null)
{
part.Text = text;
@@ -579,7 +579,7 @@ namespace OpenSim.Region.Environment.Scenes
public string GetPartName(uint localID)
{
- SceneObjectPart part = this.GetChildPrim(localID);
+ SceneObjectPart part = this.GetChildPart(localID);
if (part != null)
{
return part.Name;
@@ -589,7 +589,7 @@ namespace OpenSim.Region.Environment.Scenes
public string GetPartDescription(uint localID)
{
- SceneObjectPart part = this.GetChildPrim(localID);
+ SceneObjectPart part = this.GetChildPart(localID);
if (part != null)
{
return part.Description;
@@ -604,7 +604,7 @@ namespace OpenSim.Region.Environment.Scenes
///
public bool GetPartInventoryFileName(IClientAPI remoteClient, uint localID)
{
- SceneObjectPart part = this.GetChildPrim(localID);
+ SceneObjectPart part = this.GetChildPart(localID);
if (part != null)
{
return part.GetInventoryFileName(remoteClient, localID);
@@ -614,7 +614,7 @@ namespace OpenSim.Region.Environment.Scenes
public string RequestInventoryFile(uint localID, XferManager xferManager)
{
- SceneObjectPart part = this.GetChildPrim(localID);
+ SceneObjectPart part = this.GetChildPart(localID);
if (part != null)
{
return part.RequestInventoryFile(xferManager);
@@ -624,7 +624,7 @@ namespace OpenSim.Region.Environment.Scenes
public bool AddInventoryItem(IClientAPI remoteClient, uint localID, InventoryItemBase item)
{
- SceneObjectPart part = this.GetChildPrim(localID);
+ SceneObjectPart part = this.GetChildPart(localID);
if (part != null)
{
SceneObjectPart.TaskInventoryItem taskItem = new SceneObjectPart.TaskInventoryItem();
@@ -652,7 +652,7 @@ namespace OpenSim.Region.Environment.Scenes
///
public void UpdateExtraParam(uint localID, ushort type, bool inUse, byte[] data)
{
- SceneObjectPart part = this.GetChildPrim(localID);
+ SceneObjectPart part = this.GetChildPart(localID);
if (part != null)
{
part.UpdateExtraParam(type, inUse, data);
@@ -666,7 +666,7 @@ namespace OpenSim.Region.Environment.Scenes
///
public void UpdateTextureEntry(uint localID, byte[] textureEntry)
{
- SceneObjectPart part = this.GetChildPrim(localID);
+ SceneObjectPart part = this.GetChildPart(localID);
if (part != null)
{
part.UpdateTextureEntry(textureEntry);
@@ -681,7 +681,7 @@ namespace OpenSim.Region.Environment.Scenes
///
public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock, uint localID)
{
- SceneObjectPart part = this.GetChildPrim(localID);
+ SceneObjectPart part = this.GetChildPart(localID);
if (part != null)
{
part.UpdateShape(shapeBlock);
@@ -697,7 +697,7 @@ namespace OpenSim.Region.Environment.Scenes
///
public void Resize(LLVector3 scale, uint localID)
{
- SceneObjectPart part = this.GetChildPrim(localID);
+ SceneObjectPart part = this.GetChildPart(localID);
if (part != null)
{
part.Resize(scale);
@@ -723,7 +723,7 @@ namespace OpenSim.Region.Environment.Scenes
///
public void UpdateSinglePosition(LLVector3 pos, uint localID)
{
- SceneObjectPart part = this.GetChildPrim(localID);
+ SceneObjectPart part = this.GetChildPart(localID);
if (part != null)
{
if (part.UUID == this.m_rootPart.UUID)
@@ -795,7 +795,7 @@ namespace OpenSim.Region.Environment.Scenes
///
public void UpdateSingleRotation(LLQuaternion rot, uint localID)
{
- SceneObjectPart part = this.GetChildPrim(localID);
+ SceneObjectPart part = this.GetChildPart(localID);
if (part != null)
{
if (part.UUID == this.m_rootPart.UUID)
@@ -987,7 +987,7 @@ namespace OpenSim.Region.Environment.Scenes
public LLUUID GetPartsFullID(uint localID)
{
- SceneObjectPart part = this.GetChildPrim(localID);
+ SceneObjectPart part = this.GetChildPart(localID);
if (part != null)
{
return part.UUID;
@@ -1009,7 +1009,7 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
- SceneObjectPart part = GetChildPrim(localId);
+ SceneObjectPart part = GetChildPart(localId);
OnGrabPart(part, offsetPos, remoteClient);
}
}
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
index 7684b4f..8a59d88 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
@@ -238,7 +238,7 @@ namespace OpenSim.Region.Environment.Scenes
m_inventoryFileName = "taskinventory" + LLUUID.Random().ToString();
m_folderID = LLUUID.Random();
-
+
//temporary code just so the m_flags field doesn't give a compiler warning
if (m_flags == LLObject.ObjectFlags.AllowInventoryDrop)
{
diff --git a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
index 12d19e6..0e898a2 100644
--- a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
@@ -78,6 +78,7 @@ namespace SimpleApp
public event RequestXfer OnRequestXfer;
public event ConfirmXfer OnConfirmXfer;
public event RezScript OnRezScript;
+ public event UpdateTaskInventory OnUpdateTaskInventory;
public event UUIDNameRequest OnNameFromUUIDRequest;
--
cgit v1.1