From 05de723e51ba27e083e4d5c530bd96311e95c4d9 Mon Sep 17 00:00:00 2001
From: Teravus Ovares
Date: Sat, 10 May 2008 20:25:40 +0000
Subject: * Refactored two more OutPackets. ObjectPropertiesFamily, and Object
Properties.
---
OpenSim/Framework/IClientAPI.cs | 11 ++++
.../Region/ClientStack/LindenUDP/LLClientView.cs | 73 ++++++++++++++++++++++
.../Region/Environment/Scenes/SceneObjectGroup.cs | 69 ++++----------------
.../Region/Examples/SimpleModule/MyNpcCharacter.cs | 15 +++++
4 files changed, 110 insertions(+), 58 deletions(-)
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 09c6329..a01ee0b 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -941,6 +941,17 @@ namespace OpenSim.Framework
void SendShutdownConnectionNotice();
void SendSimStats(Packet pack);
+ void SendObjectPropertiesFamilyData(uint RequestFlags, LLUUID ObjectUUID, LLUUID OwnerID, LLUUID GroupID,
+ uint BaseMask, uint OwnerMask, uint GroupMask, uint EveryoneMask,
+ uint NextOwnerMask, int OwnershipCost, byte SaleType, int SalePrice, uint Category,
+ LLUUID LastOwnerID, string ObjectName, string Description);
+
+ void SendObjectPropertiesReply(LLUUID ItemID, ulong CreationDate, LLUUID CreatorUUID, LLUUID FolderUUID, LLUUID FromTaskUUID,
+ LLUUID GroupUUID, short InventorySerial, LLUUID LastOwnerUUID, LLUUID ObjectUUID,
+ LLUUID OwnerUUID, string TouchTitle, byte[] TextureID, string SitTitle, string ItemName,
+ string ItemDescription, uint OwnerMask, uint NextOwnerMask, uint GroupMask, uint EveryoneMask,
+ uint BaseMask);
+
byte[] GetThrottlesPacked(float multiplier);
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index aff43d5..bf45006 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -2257,6 +2257,79 @@ namespace OpenSim.Region.ClientStack.LindenUDP
OutPacket(pack, ThrottleOutPacketType.Task);
}
+ public void SendObjectPropertiesFamilyData(uint RequestFlags, LLUUID ObjectUUID, LLUUID OwnerID, LLUUID GroupID,
+ uint BaseMask, uint OwnerMask, uint GroupMask, uint EveryoneMask,
+ uint NextOwnerMask, int OwnershipCost, byte SaleType,int SalePrice, uint Category,
+ LLUUID LastOwnerID, string ObjectName, string Description)
+ {
+ ObjectPropertiesFamilyPacket objPropFamilyPack = (ObjectPropertiesFamilyPacket)PacketPool.Instance.GetPacket(PacketType.ObjectPropertiesFamily);
+ // TODO: don't create new blocks if recycling an old packet
+
+ ObjectPropertiesFamilyPacket.ObjectDataBlock objPropDB = new ObjectPropertiesFamilyPacket.ObjectDataBlock();
+ objPropDB.RequestFlags = RequestFlags;
+ objPropDB.ObjectID = ObjectUUID;
+ objPropDB.OwnerID = OwnerID;
+ objPropDB.GroupID = GroupID;
+ objPropDB.BaseMask = BaseMask;
+ objPropDB.OwnerMask = OwnerMask;
+ objPropDB.GroupMask = GroupMask;
+ objPropDB.EveryoneMask = EveryoneMask;
+ objPropDB.NextOwnerMask = NextOwnerMask;
+
+ // TODO: More properties are needed in SceneObjectPart!
+ objPropDB.OwnershipCost = OwnershipCost;
+ objPropDB.SaleType = SaleType;
+ objPropDB.SalePrice = SalePrice;
+ objPropDB.Category = Category;
+ objPropDB.LastOwnerID = LastOwnerID;
+ objPropDB.Name = Helpers.StringToField(ObjectName);
+ objPropDB.Description = Helpers.StringToField(Description);
+ objPropFamilyPack.ObjectData = objPropDB;
+ objPropFamilyPack.Header.Zerocoded = true;
+ OutPacket(objPropFamilyPack, ThrottleOutPacketType.Task);
+ }
+
+ public void SendObjectPropertiesReply(LLUUID ItemID, ulong CreationDate, LLUUID CreatorUUID, LLUUID FolderUUID, LLUUID FromTaskUUID,
+ LLUUID GroupUUID, short InventorySerial, LLUUID LastOwnerUUID, LLUUID ObjectUUID,
+ LLUUID OwnerUUID, string TouchTitle, byte[] TextureID, string SitTitle, string ItemName,
+ string ItemDescription, uint OwnerMask, uint NextOwnerMask, uint GroupMask, uint EveryoneMask,
+ uint BaseMask)
+ {
+ ObjectPropertiesPacket proper = (ObjectPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.ObjectProperties);
+ // TODO: don't create new blocks if recycling an old packet
+
+ proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[1];
+ proper.ObjectData[0] = new ObjectPropertiesPacket.ObjectDataBlock();
+ proper.ObjectData[0].ItemID = ItemID;
+ proper.ObjectData[0].CreationDate = CreationDate;
+ proper.ObjectData[0].CreatorID = CreatorUUID;
+ proper.ObjectData[0].FolderID = FolderUUID;
+ proper.ObjectData[0].FromTaskID = FromTaskUUID;
+ proper.ObjectData[0].GroupID = GroupUUID;
+ proper.ObjectData[0].InventorySerial = InventorySerial;
+
+ proper.ObjectData[0].LastOwnerID = LastOwnerUUID;
+ // proper.ObjectData[0].LastOwnerID = LLUUID.Zero;
+
+ proper.ObjectData[0].ObjectID = ObjectUUID;
+ proper.ObjectData[0].OwnerID = OwnerUUID;
+ proper.ObjectData[0].TouchName = Helpers.StringToField(TouchTitle);
+ proper.ObjectData[0].TextureID = TextureID;
+ proper.ObjectData[0].SitName = Helpers.StringToField(SitTitle);
+ proper.ObjectData[0].Name = Helpers.StringToField(ItemName);
+ proper.ObjectData[0].Description = Helpers.StringToField(ItemDescription);
+ proper.ObjectData[0].OwnerMask = OwnerMask;
+ proper.ObjectData[0].NextOwnerMask = NextOwnerMask;
+ proper.ObjectData[0].GroupMask = GroupMask;
+ proper.ObjectData[0].EveryoneMask = EveryoneMask;
+ proper.ObjectData[0].BaseMask = BaseMask;
+ // proper.ObjectData[0].AggregatePerms = 53;
+ // proper.ObjectData[0].AggregatePermTextures = 0;
+ // proper.ObjectData[0].AggregatePermTexturesOwner = 0;
+ proper.Header.Zerocoded = true;
+ OutPacket(proper, ThrottleOutPacketType.Task);
+ }
+
#endregion
#region Estate Data Sending Methods
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index 1ba17dc..3844793 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -1400,32 +1400,11 @@ namespace OpenSim.Region.Environment.Scenes
///
public void ServiceObjectPropertiesFamilyRequest(IClientAPI remoteClient, LLUUID AgentID, uint RequestFlags)
{
- //RootPart.ServiceObjectPropertiesFamilyRequest(remoteClient, AgentID, RequestFlags);
- ObjectPropertiesFamilyPacket objPropFamilyPack = (ObjectPropertiesFamilyPacket) PacketPool.Instance.GetPacket(PacketType.ObjectPropertiesFamily);
- // TODO: don't create new blocks if recycling an old packet
-
- ObjectPropertiesFamilyPacket.ObjectDataBlock objPropDB = new ObjectPropertiesFamilyPacket.ObjectDataBlock();
- objPropDB.RequestFlags = RequestFlags;
- objPropDB.ObjectID = RootPart.UUID;
- objPropDB.OwnerID = RootPart.ObjectOwner;
- objPropDB.GroupID = RootPart.GroupID;
- objPropDB.BaseMask = RootPart.BaseMask;
- objPropDB.OwnerMask = RootPart.OwnerMask;
- objPropDB.GroupMask = RootPart.GroupMask;
- objPropDB.EveryoneMask = RootPart.EveryoneMask;
- objPropDB.NextOwnerMask = RootPart.NextOwnerMask;
-
- // TODO: More properties are needed in SceneObjectPart!
- objPropDB.OwnershipCost = RootPart.OwnershipCost;
- objPropDB.SaleType = RootPart.ObjectSaleType;
- objPropDB.SalePrice = RootPart.SalePrice;
- objPropDB.Category = RootPart.Category;
- objPropDB.LastOwnerID = RootPart.CreatorID;
- objPropDB.Name = Helpers.StringToField(RootPart.Name);
- objPropDB.Description = Helpers.StringToField(RootPart.Description);
- objPropFamilyPack.ObjectData = objPropDB;
- objPropFamilyPack.Header.Zerocoded = true;
- remoteClient.OutPacket(objPropFamilyPack, ThrottleOutPacketType.Task);
+
+ remoteClient.SendObjectPropertiesFamilyData(RequestFlags, RootPart.UUID, RootPart.ObjectOwner, RootPart.GroupID, RootPart.BaseMask,
+ RootPart.OwnerMask, RootPart.GroupMask, RootPart.EveryoneMask, RootPart.NextOwnerMask,
+ RootPart.OwnershipCost, RootPart.ObjectSaleType, RootPart.SalePrice, RootPart.Category,
+ RootPart.CreatorID, RootPart.Name, RootPart.Description);
}
public void SetPartOwner(SceneObjectPart part, LLUUID cAgentID, LLUUID cGroupID)
@@ -1945,39 +1924,13 @@ namespace OpenSim.Region.Environment.Scenes
///
public void GetProperties(IClientAPI client)
{
- ObjectPropertiesPacket proper = (ObjectPropertiesPacket) PacketPool.Instance.GetPacket(PacketType.ObjectProperties);
- // TODO: don't create new blocks if recycling an old packet
-
- proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[1];
- proper.ObjectData[0] = new ObjectPropertiesPacket.ObjectDataBlock();
- proper.ObjectData[0].ItemID = LLUUID.Zero;
- proper.ObjectData[0].CreationDate = (ulong) m_rootPart.CreationDate;
- proper.ObjectData[0].CreatorID = m_rootPart.CreatorID;
- proper.ObjectData[0].FolderID = LLUUID.Zero;
- proper.ObjectData[0].FromTaskID = LLUUID.Zero;
- proper.ObjectData[0].GroupID = LLUUID.Zero;
- proper.ObjectData[0].InventorySerial = (short) m_rootPart.InventorySerial;
-
- proper.ObjectData[0].LastOwnerID = m_rootPart.LastOwnerID;
-// proper.ObjectData[0].LastOwnerID = LLUUID.Zero;
+
+ client.SendObjectPropertiesReply(LLUUID.Zero, (ulong)m_rootPart.CreationDate, m_rootPart.CreatorID, LLUUID.Zero, LLUUID.Zero,
+ LLUUID.Zero, (short)m_rootPart.InventorySerial, m_rootPart.LastOwnerID, UUID, m_rootPart.OwnerID,
+ m_rootPart.TouchName, new byte[0], m_rootPart.SitName, m_rootPart.Name, m_rootPart.Description,
+ m_rootPart.OwnerMask, m_rootPart.NextOwnerMask, m_rootPart.GroupMask, m_rootPart.EveryoneMask,
+ m_rootPart.BaseMask);
- proper.ObjectData[0].ObjectID = UUID;
- proper.ObjectData[0].OwnerID = m_rootPart.OwnerID;
- proper.ObjectData[0].TouchName = Helpers.StringToField(m_rootPart.TouchName);
- proper.ObjectData[0].TextureID = new byte[0];
- proper.ObjectData[0].SitName = Helpers.StringToField(m_rootPart.SitName);
- proper.ObjectData[0].Name = Helpers.StringToField(m_rootPart.Name);
- proper.ObjectData[0].Description = Helpers.StringToField(m_rootPart.Description);
- proper.ObjectData[0].OwnerMask = m_rootPart.OwnerMask;
- proper.ObjectData[0].NextOwnerMask = m_rootPart.NextOwnerMask;
- proper.ObjectData[0].GroupMask = m_rootPart.GroupMask;
- proper.ObjectData[0].EveryoneMask = m_rootPart.EveryoneMask;
- proper.ObjectData[0].BaseMask = m_rootPart.BaseMask;
-// proper.ObjectData[0].AggregatePerms = 53;
-// proper.ObjectData[0].AggregatePermTextures = 0;
-// proper.ObjectData[0].AggregatePermTexturesOwner = 0;
- proper.Header.Zerocoded = true;
- client.OutPacket(proper, ThrottleOutPacketType.Task);
}
///
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
index 05f963a..42912e7 100644
--- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
@@ -543,6 +543,21 @@ namespace OpenSim.Region.Examples.SimpleModule
{
}
+ public void SendObjectPropertiesFamilyData(uint RequestFlags, LLUUID ObjectUUID, LLUUID OwnerID, LLUUID GroupID,
+ uint BaseMask, uint OwnerMask, uint GroupMask, uint EveryoneMask,
+ uint NextOwnerMask, int OwnershipCost, byte SaleType,int SalePrice, uint Category,
+ LLUUID LastOwnerID, string ObjectName, string Description)
+ {
+ }
+
+ public void SendObjectPropertiesReply(LLUUID ItemID, ulong CreationDate, LLUUID CreatorUUID, LLUUID FolderUUID, LLUUID FromTaskUUID,
+ LLUUID GroupUUID, short InventorySerial, LLUUID LastOwnerUUID, LLUUID ObjectUUID,
+ LLUUID OwnerUUID, string TouchTitle, byte[] TextureID, string SitTitle, string ItemName,
+ string ItemDescription, uint OwnerMask, uint NextOwnerMask, uint GroupMask, uint EveryoneMask,
+ uint BaseMask)
+ {
+ }
+
private void Update()
{
frame++;
--
cgit v1.1