[Simian]
* Clearing up confusion with Agent.Avatar by making it a SimulationObject that is passed in through the constructor. This should prevent duplicate notions of an avatar in the scene * Fixed the "you don't own this object" issue after moving a prim. The fix is rather hacky and will be replaced when we stop sending full object updates for every change git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@2465 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
@@ -120,7 +120,7 @@ namespace Simian.Extensions
|
||||
prim.GroupID = add.AgentData.GroupID;
|
||||
prim.ID = UUID.Random();
|
||||
prim.MediaURL = String.Empty;
|
||||
prim.OwnerID = agent.Avatar.ID;
|
||||
prim.OwnerID = agent.ID;
|
||||
prim.Position = position;
|
||||
|
||||
prim.PrimData.Material = (Material)add.ObjectData.Material;
|
||||
@@ -146,10 +146,10 @@ namespace Simian.Extensions
|
||||
|
||||
prim.Properties = new Primitive.ObjectProperties();
|
||||
prim.Properties.CreationDate = DateTime.Now;
|
||||
prim.Properties.CreatorID = agent.Avatar.ID;
|
||||
prim.Properties.CreatorID = agent.ID;
|
||||
prim.Properties.Description = String.Empty;
|
||||
prim.Properties.GroupID = add.AgentData.GroupID;
|
||||
prim.Properties.LastOwnerID = agent.Avatar.ID;
|
||||
prim.Properties.LastOwnerID = agent.ID;
|
||||
prim.Properties.Name = "New Object";
|
||||
prim.Properties.ObjectID = prim.ID;
|
||||
prim.Properties.OwnerID = prim.OwnerID;
|
||||
@@ -163,7 +163,7 @@ namespace Simian.Extensions
|
||||
|
||||
// Add this prim to the object database
|
||||
SimulationObject simObj = new SimulationObject(prim, server);
|
||||
server.Scene.ObjectAdd(this, simObj, agent.Avatar.ID, 0, flags);
|
||||
server.Scene.ObjectAdd(this, simObj, agent.ID, 0, flags);
|
||||
}
|
||||
|
||||
void ObjectDuplicateHandler(Packet packet, Agent agent)
|
||||
@@ -184,7 +184,7 @@ namespace Simian.Extensions
|
||||
newObj.Prim.Position += offset;
|
||||
newObj.Prim.ID = UUID.Random();
|
||||
|
||||
server.Scene.ObjectAdd(this, newObj, agent.Avatar.ID, 0, flags);
|
||||
server.Scene.ObjectAdd(this, newObj, agent.ID, 0, flags);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -195,7 +195,7 @@ namespace Simian.Extensions
|
||||
kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1];
|
||||
kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock();
|
||||
kill.ObjectData[0].ID = dupeID;
|
||||
server.UDP.SendPacket(agent.Avatar.ID, kill, PacketCategory.State);
|
||||
server.UDP.SendPacket(agent.ID, kill, PacketCategory.State);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -241,7 +241,7 @@ namespace Simian.Extensions
|
||||
{
|
||||
properties.ObjectData[0].BaseMask = (uint)PermissionMask.All;
|
||||
properties.ObjectData[0].CreationDate = Utils.DateTimeToUnixTime(DateTime.Now);
|
||||
properties.ObjectData[0].CreatorID = agent.Avatar.ID;
|
||||
properties.ObjectData[0].CreatorID = agent.ID;
|
||||
properties.ObjectData[0].Description = Utils.StringToBytes(String.Empty);
|
||||
properties.ObjectData[0].EveryoneMask = (uint)PermissionMask.All;
|
||||
properties.ObjectData[0].GroupID = UUID.Zero;
|
||||
@@ -250,7 +250,7 @@ namespace Simian.Extensions
|
||||
properties.ObjectData[0].Name = Utils.StringToBytes(String.Empty);
|
||||
properties.ObjectData[0].NextOwnerMask = (uint)PermissionMask.All;
|
||||
properties.ObjectData[0].ObjectID = obj.Prim.ID;
|
||||
properties.ObjectData[0].OwnerID = agent.Avatar.ID;
|
||||
properties.ObjectData[0].OwnerID = agent.ID;
|
||||
properties.ObjectData[0].OwnerMask = (uint)PermissionMask.All;
|
||||
properties.ObjectData[0].OwnershipCost = 0;
|
||||
properties.ObjectData[0].SalePrice = 0;
|
||||
@@ -260,7 +260,7 @@ namespace Simian.Extensions
|
||||
properties.ObjectData[0].TouchName = new byte[0];
|
||||
}
|
||||
|
||||
server.UDP.SendPacket(agent.Avatar.ID, properties, PacketCategory.Transaction);
|
||||
server.UDP.SendPacket(agent.ID, properties, PacketCategory.Transaction);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -277,7 +277,7 @@ namespace Simian.Extensions
|
||||
kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1];
|
||||
kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock();
|
||||
kill.ObjectData[0].ID = select.ObjectData[i].ObjectLocalID;
|
||||
server.UDP.SendPacket(agent.Avatar.ID, kill, PacketCategory.State);
|
||||
server.UDP.SendPacket(agent.ID, kill, PacketCategory.State);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -313,7 +313,7 @@ namespace Simian.Extensions
|
||||
//TODO: send an error message
|
||||
return;
|
||||
}
|
||||
else if (obj.Prim.OwnerID != agent.Avatar.ID)
|
||||
else if (obj.Prim.OwnerID != agent.ID)
|
||||
{
|
||||
//TODO: send an error message
|
||||
return;
|
||||
@@ -385,7 +385,7 @@ namespace Simian.Extensions
|
||||
//TODO: send an error message
|
||||
return;
|
||||
}
|
||||
else if (obj.Prim.OwnerID != agent.Avatar.ID)
|
||||
else if (obj.Prim.OwnerID != agent.ID)
|
||||
{
|
||||
//TODO: send an error message
|
||||
return;
|
||||
@@ -635,13 +635,13 @@ namespace Simian.Extensions
|
||||
break;
|
||||
case DeRezDestination.TrashFolder:
|
||||
InventoryObject invObj;
|
||||
if (server.Inventory.TryGetInventory(agent.Avatar.ID, derez.AgentBlock.DestinationID, out invObj) &&
|
||||
if (server.Inventory.TryGetInventory(agent.ID, derez.AgentBlock.DestinationID, out invObj) &&
|
||||
invObj is InventoryFolder)
|
||||
{
|
||||
// FIXME: Handle children
|
||||
InventoryFolder trash = (InventoryFolder)invObj;
|
||||
server.Inventory.CreateItem(agent.Avatar.ID, obj.Prim.Properties.Name, obj.Prim.Properties.Description, InventoryType.Object,
|
||||
AssetType.Object, obj.Prim.ID, trash.ID, PermissionMask.All, PermissionMask.All, agent.Avatar.ID,
|
||||
server.Inventory.CreateItem(agent.ID, obj.Prim.Properties.Name, obj.Prim.Properties.Description, InventoryType.Object,
|
||||
AssetType.Object, obj.Prim.ID, trash.ID, PermissionMask.All, PermissionMask.All, agent.ID,
|
||||
obj.Prim.Properties.CreatorID, derez.AgentBlock.TransactionID, 0, true);
|
||||
server.Scene.ObjectRemove(this, obj.Prim.LocalID);
|
||||
|
||||
@@ -719,7 +719,7 @@ namespace Simian.Extensions
|
||||
obj.Prim.Rotation = rotation;
|
||||
obj.Prim.Scale = scale;
|
||||
|
||||
server.Scene.ObjectAdd(this, obj, agent.Avatar.ID, 0, PrimFlags.None);
|
||||
server.Scene.ObjectAdd(this, obj, agent.ID, 0, PrimFlags.None);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -735,7 +735,7 @@ namespace Simian.Extensions
|
||||
kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1];
|
||||
kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock();
|
||||
kill.ObjectData[0].ID = block.ObjectLocalID;
|
||||
server.UDP.SendPacket(agent.Avatar.ID, kill, PacketCategory.State);
|
||||
server.UDP.SendPacket(agent.ID, kill, PacketCategory.State);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -782,7 +782,7 @@ namespace Simian.Extensions
|
||||
props.ObjectData.Name = Utils.StringToBytes(String.Empty);
|
||||
props.ObjectData.NextOwnerMask = (uint)PermissionMask.All;
|
||||
props.ObjectData.ObjectID = obj.Prim.ID;
|
||||
props.ObjectData.OwnerID = agent.Avatar.ID;
|
||||
props.ObjectData.OwnerID = agent.ID;
|
||||
props.ObjectData.OwnerMask = (uint)PermissionMask.All;
|
||||
props.ObjectData.OwnershipCost = 0;
|
||||
props.ObjectData.RequestFlags = (uint)ReportType.None;
|
||||
@@ -790,7 +790,7 @@ namespace Simian.Extensions
|
||||
props.ObjectData.SaleType = (byte)SaleType.Not;
|
||||
}
|
||||
|
||||
server.UDP.SendPacket(agent.Avatar.ID, props, PacketCategory.Transaction);
|
||||
server.UDP.SendPacket(agent.ID, props, PacketCategory.Transaction);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user