* Refactored two more OutPackets. ObjectPropertiesFamily, and Object Properties.

0.6.0-stable
Teravus Ovares 2008-05-10 20:25:40 +00:00
parent 1ba51dd2fd
commit 05de723e51
4 changed files with 108 additions and 56 deletions

View File

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

View File

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

View File

@ -1400,32 +1400,11 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="part"></param>
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
/// <param name="client"></param>
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;
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].LastOwnerID = m_rootPart.LastOwnerID;
// proper.ObjectData[0].LastOwnerID = LLUUID.Zero;
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);
}
/// <summary>

View File

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