Made SceneObjectGroup.GetChildPrim() public, for now so that script engine can get ref to the SceneObjectPart/ IScriptHost.

afrisby
MW 2007-08-22 17:40:26 +00:00
parent 5ea6d8d739
commit 001d5a5c92
7 changed files with 35 additions and 20 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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());

View File

@ -362,7 +362,7 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary>
/// <param name="primID"></param>
/// <returns></returns>
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
/// </summary>
/// <param name="localID"></param>
/// <returns></returns>
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
/// <param name="name"></param>
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
/// <param name="localID"></param>
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
/// <param name="data"></param>
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
/// <param name="textureEntry"></param>
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
/// <param name="shapeBlock"></param>
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
/// <param name="localID"></param>
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
/// <param name="localID"></param>
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
/// <param name="localID"></param>
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);
}
}

View File

@ -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)
{

View File

@ -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;