[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:
@@ -47,7 +47,7 @@ namespace Simian.Extensions
|
||||
GridLayerType type = (GridLayerType)request.AgentData.Flags;
|
||||
|
||||
MapLayerReplyPacket reply = new MapLayerReplyPacket();
|
||||
reply.AgentData.AgentID = agent.Avatar.ID;
|
||||
reply.AgentData.AgentID = agent.ID;
|
||||
reply.AgentData.Flags = (uint)type;
|
||||
reply.LayerData = new MapLayerReplyPacket.LayerDataBlock[1];
|
||||
reply.LayerData[0] = new MapLayerReplyPacket.LayerDataBlock();
|
||||
@@ -57,7 +57,7 @@ namespace Simian.Extensions
|
||||
reply.LayerData[0].Right = UInt16.MaxValue;
|
||||
reply.LayerData[0].ImageID = new UUID("89556747-24cb-43ed-920b-47caed15465f");
|
||||
|
||||
server.UDP.SendPacket(agent.Avatar.ID, reply, PacketCategory.Transaction);
|
||||
server.UDP.SendPacket(agent.ID, reply, PacketCategory.Transaction);
|
||||
}
|
||||
|
||||
void MapBlockRequestHandler(Packet packet, Agent agent)
|
||||
@@ -66,7 +66,7 @@ namespace Simian.Extensions
|
||||
GridLayerType type = (GridLayerType)request.AgentData.Flags;
|
||||
|
||||
MapBlockReplyPacket reply = new MapBlockReplyPacket();
|
||||
reply.AgentData.AgentID = agent.Avatar.ID;
|
||||
reply.AgentData.AgentID = agent.ID;
|
||||
reply.AgentData.Flags = (uint)type;
|
||||
|
||||
reply.Data = new MapBlockReplyPacket.DataBlock[2];
|
||||
@@ -91,7 +91,7 @@ namespace Simian.Extensions
|
||||
reply.Data[1].X = (ushort)(server.Scene.RegionX + 1);
|
||||
reply.Data[1].Y = (ushort)server.Scene.RegionY;
|
||||
|
||||
server.UDP.SendPacket(agent.Avatar.ID, reply, PacketCategory.Transaction);
|
||||
server.UDP.SendPacket(agent.ID, reply, PacketCategory.Transaction);
|
||||
}
|
||||
|
||||
void TeleportRequestHandler(Packet packet, Agent agent)
|
||||
@@ -103,26 +103,26 @@ namespace Simian.Extensions
|
||||
if (request.Info.RegionID == server.Scene.RegionID)
|
||||
{
|
||||
// Local teleport
|
||||
agent.Avatar.Position = request.Info.Position;
|
||||
agent.Avatar.Prim.Position = request.Info.Position;
|
||||
agent.CurrentLookAt = request.Info.LookAt;
|
||||
|
||||
TeleportLocalPacket reply = new TeleportLocalPacket();
|
||||
reply.Info.AgentID = agent.Avatar.ID;
|
||||
reply.Info.AgentID = agent.ID;
|
||||
reply.Info.LocationID = 0; // Unused by the client
|
||||
reply.Info.LookAt = agent.CurrentLookAt;
|
||||
reply.Info.Position = agent.Avatar.Position;
|
||||
reply.Info.Position = agent.Avatar.Prim.Position;
|
||||
// TODO: Need a "Flying" boolean for Agent
|
||||
reply.Info.TeleportFlags = (uint)TeleportFlags.ViaRegionID;
|
||||
|
||||
server.UDP.SendPacket(agent.Avatar.ID, reply, PacketCategory.Transaction);
|
||||
server.UDP.SendPacket(agent.ID, reply, PacketCategory.Transaction);
|
||||
}
|
||||
else
|
||||
{
|
||||
TeleportFailedPacket reply = new TeleportFailedPacket();
|
||||
reply.Info.AgentID = agent.Avatar.ID;
|
||||
reply.Info.AgentID = agent.ID;
|
||||
reply.Info.Reason = Utils.StringToBytes("Unknown region");
|
||||
|
||||
server.UDP.SendPacket(agent.Avatar.ID, reply, PacketCategory.Transaction);
|
||||
server.UDP.SendPacket(agent.ID, reply, PacketCategory.Transaction);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,18 +135,18 @@ namespace Simian.Extensions
|
||||
if (request.Info.RegionHandle == server.Scene.RegionHandle)
|
||||
{
|
||||
// Local teleport
|
||||
agent.Avatar.Position = request.Info.Position;
|
||||
agent.Avatar.Prim.Position = request.Info.Position;
|
||||
agent.CurrentLookAt = request.Info.LookAt;
|
||||
|
||||
TeleportLocalPacket reply = new TeleportLocalPacket();
|
||||
reply.Info.AgentID = agent.Avatar.ID;
|
||||
reply.Info.AgentID = agent.ID;
|
||||
reply.Info.LocationID = 0; // Unused by the client
|
||||
reply.Info.LookAt = agent.CurrentLookAt;
|
||||
reply.Info.Position = agent.Avatar.Position;
|
||||
reply.Info.Position = agent.Avatar.Prim.Position;
|
||||
// TODO: Need a "Flying" boolean for Agent
|
||||
reply.Info.TeleportFlags = (uint)TeleportFlags.ViaLocation;
|
||||
|
||||
server.UDP.SendPacket(agent.Avatar.ID, reply, PacketCategory.Transaction);
|
||||
server.UDP.SendPacket(agent.ID, reply, PacketCategory.Transaction);
|
||||
}
|
||||
else if (request.Info.RegionHandle == Utils.UIntsToLong((server.Scene.RegionX + 1) * 256, server.Scene.RegionY * 256))
|
||||
{
|
||||
@@ -156,10 +156,10 @@ namespace Simian.Extensions
|
||||
else
|
||||
{
|
||||
TeleportFailedPacket reply = new TeleportFailedPacket();
|
||||
reply.Info.AgentID = agent.Avatar.ID;
|
||||
reply.Info.AgentID = agent.ID;
|
||||
reply.Info.Reason = Utils.StringToBytes("Unknown region");
|
||||
|
||||
server.UDP.SendPacket(agent.Avatar.ID, reply, PacketCategory.Transaction);
|
||||
server.UDP.SendPacket(agent.ID, reply, PacketCategory.Transaction);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ namespace Simian.Extensions
|
||||
link.RegionName, x, y, destination), Helpers.LogLevel.Info);
|
||||
|
||||
OSDMap info = new OSDMap();
|
||||
info.Add("AgentID", OSD.FromUUID(agent.Avatar.ID));
|
||||
info.Add("AgentID", OSD.FromUUID(agent.ID));
|
||||
info.Add("LocationID", OSD.FromInteger(4)); // Unused by the client
|
||||
info.Add("RegionHandle", OSD.FromULong(link.RegionHandle));
|
||||
info.Add("SeedCapability", OSD.FromUri(seedCap));
|
||||
@@ -226,7 +226,7 @@ namespace Simian.Extensions
|
||||
Helpers.LogLevel.Warning);
|
||||
|
||||
TeleportFinishPacket teleport = new TeleportFinishPacket();
|
||||
teleport.Info.AgentID = agent.Avatar.ID;
|
||||
teleport.Info.AgentID = agent.ID;
|
||||
teleport.Info.LocationID = 0; // Unused by the client
|
||||
teleport.Info.RegionHandle = link.RegionHandle;
|
||||
teleport.Info.SeedCapability = Utils.StringToBytes(seedCap.ToString());
|
||||
@@ -235,11 +235,11 @@ namespace Simian.Extensions
|
||||
teleport.Info.SimPort = (ushort)link.UDPPort;
|
||||
teleport.Info.TeleportFlags = (uint)TeleportFlags.ViaLocation;
|
||||
|
||||
server.UDP.SendPacket(agent.Avatar.ID, teleport, PacketCategory.Transaction);
|
||||
server.UDP.SendPacket(agent.ID, teleport, PacketCategory.Transaction);
|
||||
}
|
||||
|
||||
// Remove the agent from the local scene (will also tear down the UDP connection)
|
||||
//server.Scene.ObjectRemove(this, agent.Avatar.ID);
|
||||
//server.Scene.ObjectRemove(this, agent.ID);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -401,7 +401,7 @@ namespace Simian.Extensions
|
||||
WriteStringMember(writer, "secure_session_id", agent.SecureSessionID.ToString());
|
||||
WriteStringMember(writer, "firstname", agent.FirstName);
|
||||
WriteStringMember(writer, "lastname", agent.LastName);
|
||||
WriteStringMember(writer, "agent_id", agent.Avatar.ID.ToString());
|
||||
WriteStringMember(writer, "agent_id", agent.ID.ToString());
|
||||
WriteStringMember(writer, "circuit_code", agent.CircuitCode.ToString());
|
||||
WriteStringMember(writer, "startpos_x", destPos.X.ToString(Utils.EnUsCulture));
|
||||
WriteStringMember(writer, "startpos_y", destPos.Y.ToString(Utils.EnUsCulture));
|
||||
@@ -513,10 +513,10 @@ namespace Simian.Extensions
|
||||
{
|
||||
try
|
||||
{
|
||||
destination = new Uri(destination, "/agent/" + agent.Avatar.ID.ToString() + "/");
|
||||
destination = new Uri(destination, "/agent/" + agent.ID.ToString() + "/");
|
||||
|
||||
OSDMap args = new OSDMap();
|
||||
args["agent_id"] = OSD.FromUUID(agent.Avatar.ID);
|
||||
args["agent_id"] = OSD.FromUUID(agent.ID);
|
||||
args["base_folder"] = OSD.FromUUID(UUID.Zero);
|
||||
args["caps_path"] = OSD.FromString(seedCapFragment);
|
||||
args["children_seeds"] = OSD.FromBoolean(false);
|
||||
@@ -565,11 +565,11 @@ namespace Simian.Extensions
|
||||
void TeleportProgress(Agent agent, string message, TeleportFlags flags)
|
||||
{
|
||||
TeleportProgressPacket progress = new TeleportProgressPacket();
|
||||
progress.AgentData.AgentID = agent.Avatar.ID;
|
||||
progress.AgentData.AgentID = agent.ID;
|
||||
progress.Info.Message = Utils.StringToBytes(message);
|
||||
progress.Info.TeleportFlags = (uint)flags;
|
||||
|
||||
server.UDP.SendPacket(agent.Avatar.ID, progress, PacketCategory.Transaction);
|
||||
server.UDP.SendPacket(agent.ID, progress, PacketCategory.Transaction);
|
||||
}
|
||||
|
||||
static void WriteStringMember(XmlWriter writer, string name, string value)
|
||||
|
||||
Reference in New Issue
Block a user