{
Packet packet = e.getPacket();
Simulator simulator = e.getSimulator();
final ObjectPropertiesFamilyPacket op = (ObjectPropertiesFamilyPacket)packet;
ObjectProperties props = new ObjectProperties();
ReportType requestType = ReportType.get(op.ObjectData.RequestFlags);
props.ObjectID = op.ObjectData.ObjectID;
// ObjectCategory a;
props.Category = ObjectCategory.get((int)op.ObjectData.Category);
props.Description = Utils.bytesWithTrailingNullByteToString(op.ObjectData.Description);
props.GroupID = op.ObjectData.GroupID;
props.LastOwnerID = op.ObjectData.LastOwnerID;
props.Name = Utils.bytesWithTrailingNullByteToString(op.ObjectData.Name);
props.OwnerID = op.ObjectData.OwnerID;
props.OwnershipCost = op.ObjectData.OwnershipCost;
props.SalePrice = op.ObjectData.SalePrice;
props.SaleType = SaleType.get(op.ObjectData.SaleType);
props.Permissions.BaseMask = PermissionMask.get(op.ObjectData.BaseMask);
props.Permissions.EveryoneMask = PermissionMask.get(op.ObjectData.EveryoneMask);
props.Permissions.GroupMask = PermissionMask.get(op.ObjectData.GroupMask);
props.Permissions.NextOwnerMask = PermissionMask.get(op.ObjectData.NextOwnerMask);
props.Permissions.OwnerMask = PermissionMask.get(op.ObjectData.OwnerMask);
if (Client.settings.OBJECT_TRACKING)
{
// Primitive findPrim = simulator.ObjectsPrimitives.Find(
// delegate(Primitive prim) { return prim.ID == op.ObjectData.ObjectID; });
// final Primitive[] primarray = new Primitive[]{null};
// Primitive findPrim = null;
// simulator.ObjectsPrimitives.foreach(new Action<Entry<Long, Primitive>>()
// {
// public void execute(
// Entry<Long, Primitive> t) {
// if(t.getValue().ID.equals(op.ObjectData.ObjectID))
// {
// primarray[0] = t.getValue();
// }
// }
// });
// findPrim = primarray[0];
Primitive findPrim = simulator.ObjectsPrimitives.get(op.ObjectData.ObjectID);
if (findPrim != null)
{
synchronized (simulator.ObjectsPrimitives.getDictionary())
{
if (simulator.ObjectsPrimitives.getDictionary().containsKey(findPrim.LocalID))
{
if (simulator.ObjectsPrimitives.getDictionary().get(findPrim.LocalID).Properties == null)
simulator.ObjectsPrimitives.getDictionary().get(findPrim.LocalID).Properties = new ObjectProperties();
simulator.ObjectsPrimitives.getDictionary().get(findPrim.LocalID).Properties.SetFamilyProperties(props);
}
}
}
}