2007-12-11 01:26:06 +00:00
|
|
|
/*
|
2008-03-18 05:16:43 +00:00
|
|
|
* Copyright (c) Contributors, http://opensimulator.org/
|
|
|
|
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions are met:
|
|
|
|
* * Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* * Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
2009-06-01 06:37:14 +00:00
|
|
|
* * Neither the name of the OpenSimulator Project nor the
|
2008-03-18 05:16:43 +00:00
|
|
|
* names of its contributors may be used to endorse or promote products
|
|
|
|
* derived from this software without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
|
|
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
|
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
|
|
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
|
|
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
|
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
|
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
|
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
|
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
2007-12-11 01:26:06 +00:00
|
|
|
|
2007-12-09 05:59:49 +00:00
|
|
|
using System;
|
2008-12-29 21:10:35 +00:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
2010-10-26 19:54:28 +00:00
|
|
|
using System.Reflection;
|
|
|
|
using log4net;
|
2009-02-12 09:53:12 +00:00
|
|
|
using OpenMetaverse;
|
|
|
|
using OpenMetaverse.StructuredData;
|
2007-12-09 05:59:49 +00:00
|
|
|
|
|
|
|
namespace OpenSim.Framework
|
|
|
|
{
|
2008-12-29 21:10:35 +00:00
|
|
|
// Soon to be dismissed
|
2007-12-09 05:59:49 +00:00
|
|
|
[Serializable]
|
|
|
|
public class ChildAgentDataUpdate
|
|
|
|
{
|
2008-04-29 14:04:55 +00:00
|
|
|
public Guid ActiveGroupID;
|
2007-12-09 05:59:49 +00:00
|
|
|
public Guid AgentID;
|
2008-01-22 08:52:51 +00:00
|
|
|
public bool alwaysrun;
|
2008-04-29 14:04:55 +00:00
|
|
|
public float AVHeight;
|
2010-03-03 20:12:32 +00:00
|
|
|
public Vector3 cameraPosition;
|
2008-04-29 14:04:55 +00:00
|
|
|
public float drawdistance;
|
|
|
|
public float godlevel;
|
2008-01-22 08:52:51 +00:00
|
|
|
public uint GroupAccess;
|
2010-03-03 20:12:32 +00:00
|
|
|
public Vector3 Position;
|
2008-04-29 14:04:55 +00:00
|
|
|
public ulong regionHandle;
|
|
|
|
public byte[] throttles;
|
2010-03-03 20:12:32 +00:00
|
|
|
public Vector3 Velocity;
|
2008-04-29 14:04:55 +00:00
|
|
|
|
|
|
|
public ChildAgentDataUpdate()
|
|
|
|
{
|
|
|
|
}
|
2008-12-29 21:10:35 +00:00
|
|
|
}
|
|
|
|
|
2009-01-03 02:29:49 +00:00
|
|
|
public interface IAgentData
|
|
|
|
{
|
|
|
|
UUID AgentID { get; set; }
|
|
|
|
|
2009-04-01 19:50:09 +00:00
|
|
|
OSDMap Pack();
|
2011-04-29 03:19:54 +00:00
|
|
|
void Unpack(OSDMap map, IScene scene);
|
2009-01-03 02:29:49 +00:00
|
|
|
}
|
|
|
|
|
2009-01-03 00:00:37 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Replacement for ChildAgentDataUpdate. Used over RESTComms and LocalComms.
|
|
|
|
/// </summary>
|
2009-01-03 02:29:49 +00:00
|
|
|
public class AgentPosition : IAgentData
|
2009-01-03 00:00:37 +00:00
|
|
|
{
|
2009-01-03 02:29:49 +00:00
|
|
|
private UUID m_id;
|
|
|
|
public UUID AgentID
|
|
|
|
{
|
|
|
|
get { return m_id; }
|
|
|
|
set { m_id = value; }
|
|
|
|
}
|
|
|
|
|
2009-01-03 00:00:37 +00:00
|
|
|
public ulong RegionHandle;
|
|
|
|
public uint CircuitCode;
|
|
|
|
public UUID SessionID;
|
|
|
|
|
|
|
|
public float Far;
|
|
|
|
public Vector3 Position;
|
|
|
|
public Vector3 Velocity;
|
|
|
|
public Vector3 Center;
|
|
|
|
public Vector3 Size;
|
|
|
|
public Vector3 AtAxis;
|
|
|
|
public Vector3 LeftAxis;
|
|
|
|
public Vector3 UpAxis;
|
|
|
|
public bool ChangedGrid;
|
|
|
|
|
|
|
|
// This probably shouldn't be here
|
|
|
|
public byte[] Throttles;
|
|
|
|
|
|
|
|
|
2009-04-01 19:50:09 +00:00
|
|
|
public OSDMap Pack()
|
2009-01-03 00:00:37 +00:00
|
|
|
{
|
|
|
|
OSDMap args = new OSDMap();
|
|
|
|
args["message_type"] = OSD.FromString("AgentPosition");
|
|
|
|
|
|
|
|
args["region_handle"] = OSD.FromString(RegionHandle.ToString());
|
|
|
|
args["circuit_code"] = OSD.FromString(CircuitCode.ToString());
|
|
|
|
args["agent_uuid"] = OSD.FromUUID(AgentID);
|
|
|
|
args["session_uuid"] = OSD.FromUUID(SessionID);
|
|
|
|
|
|
|
|
args["position"] = OSD.FromString(Position.ToString());
|
|
|
|
args["velocity"] = OSD.FromString(Velocity.ToString());
|
|
|
|
args["center"] = OSD.FromString(Center.ToString());
|
|
|
|
args["size"] = OSD.FromString(Size.ToString());
|
|
|
|
args["at_axis"] = OSD.FromString(AtAxis.ToString());
|
|
|
|
args["left_axis"] = OSD.FromString(LeftAxis.ToString());
|
|
|
|
args["up_axis"] = OSD.FromString(UpAxis.ToString());
|
|
|
|
|
|
|
|
args["far"] = OSD.FromReal(Far);
|
|
|
|
args["changed_grid"] = OSD.FromBoolean(ChangedGrid);
|
|
|
|
|
|
|
|
if ((Throttles != null) && (Throttles.Length > 0))
|
|
|
|
args["throttles"] = OSD.FromBinary(Throttles);
|
|
|
|
|
|
|
|
return args;
|
|
|
|
}
|
|
|
|
|
2011-04-29 03:19:54 +00:00
|
|
|
public void Unpack(OSDMap args, IScene scene)
|
2009-01-03 00:00:37 +00:00
|
|
|
{
|
|
|
|
if (args.ContainsKey("region_handle"))
|
|
|
|
UInt64.TryParse(args["region_handle"].AsString(), out RegionHandle);
|
|
|
|
|
|
|
|
if (args["circuit_code"] != null)
|
|
|
|
UInt32.TryParse((string)args["circuit_code"].AsString(), out CircuitCode);
|
|
|
|
|
|
|
|
if (args["agent_uuid"] != null)
|
|
|
|
AgentID = args["agent_uuid"].AsUUID();
|
|
|
|
|
|
|
|
if (args["session_uuid"] != null)
|
|
|
|
SessionID = args["session_uuid"].AsUUID();
|
|
|
|
|
|
|
|
if (args["position"] != null)
|
|
|
|
Vector3.TryParse(args["position"].AsString(), out Position);
|
|
|
|
|
|
|
|
if (args["velocity"] != null)
|
|
|
|
Vector3.TryParse(args["velocity"].AsString(), out Velocity);
|
|
|
|
|
|
|
|
if (args["center"] != null)
|
|
|
|
Vector3.TryParse(args["center"].AsString(), out Center);
|
|
|
|
|
|
|
|
if (args["size"] != null)
|
|
|
|
Vector3.TryParse(args["size"].AsString(), out Size);
|
|
|
|
|
|
|
|
if (args["at_axis"] != null)
|
|
|
|
Vector3.TryParse(args["at_axis"].AsString(), out AtAxis);
|
|
|
|
|
|
|
|
if (args["left_axis"] != null)
|
2010-09-17 22:41:12 +00:00
|
|
|
Vector3.TryParse(args["left_axis"].AsString(), out LeftAxis);
|
2009-01-03 00:00:37 +00:00
|
|
|
|
|
|
|
if (args["up_axis"] != null)
|
2010-09-17 22:41:12 +00:00
|
|
|
Vector3.TryParse(args["up_axis"].AsString(), out UpAxis);
|
2009-01-03 00:00:37 +00:00
|
|
|
|
|
|
|
if (args["changed_grid"] != null)
|
|
|
|
ChangedGrid = args["changed_grid"].AsBoolean();
|
|
|
|
|
|
|
|
if (args["far"] != null)
|
|
|
|
Far = (float)(args["far"].AsReal());
|
|
|
|
|
|
|
|
if (args["throttles"] != null)
|
|
|
|
Throttles = args["throttles"].AsBinary();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Soon to be decommissioned
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="cAgent"></param>
|
2013-07-14 16:21:28 +00:00
|
|
|
public void CopyFrom(ChildAgentDataUpdate cAgent, UUID sid)
|
2009-01-03 00:00:37 +00:00
|
|
|
{
|
|
|
|
AgentID = new UUID(cAgent.AgentID);
|
2013-07-14 16:21:28 +00:00
|
|
|
SessionID = sid;
|
2009-01-03 00:00:37 +00:00
|
|
|
|
|
|
|
// next: ???
|
|
|
|
Size = new Vector3();
|
|
|
|
Size.Z = cAgent.AVHeight;
|
|
|
|
|
2010-03-03 20:12:32 +00:00
|
|
|
Center = cAgent.cameraPosition;
|
2009-01-03 00:00:37 +00:00
|
|
|
Far = cAgent.drawdistance;
|
2010-03-03 20:12:32 +00:00
|
|
|
Position = cAgent.Position;
|
2009-01-03 00:00:37 +00:00
|
|
|
RegionHandle = cAgent.regionHandle;
|
|
|
|
Throttles = cAgent.throttles;
|
2010-03-03 20:12:32 +00:00
|
|
|
Velocity = cAgent.Velocity;
|
2009-01-03 00:00:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-12-29 21:10:35 +00:00
|
|
|
public class AgentGroupData
|
|
|
|
{
|
|
|
|
public UUID GroupID;
|
|
|
|
public ulong GroupPowers;
|
|
|
|
public bool AcceptNotices;
|
|
|
|
|
|
|
|
public AgentGroupData(UUID id, ulong powers, bool notices)
|
|
|
|
{
|
|
|
|
GroupID = id;
|
|
|
|
GroupPowers = powers;
|
|
|
|
AcceptNotices = notices;
|
|
|
|
}
|
2009-01-03 00:00:37 +00:00
|
|
|
|
|
|
|
public AgentGroupData(OSDMap args)
|
|
|
|
{
|
|
|
|
UnpackUpdateMessage(args);
|
|
|
|
}
|
|
|
|
|
|
|
|
public OSDMap PackUpdateMessage()
|
|
|
|
{
|
|
|
|
OSDMap groupdata = new OSDMap();
|
|
|
|
groupdata["group_id"] = OSD.FromUUID(GroupID);
|
|
|
|
groupdata["group_powers"] = OSD.FromString(GroupPowers.ToString());
|
|
|
|
groupdata["accept_notices"] = OSD.FromBoolean(AcceptNotices);
|
|
|
|
|
|
|
|
return groupdata;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void UnpackUpdateMessage(OSDMap args)
|
|
|
|
{
|
|
|
|
if (args["group_id"] != null)
|
|
|
|
GroupID = args["group_id"].AsUUID();
|
|
|
|
if (args["group_powers"] != null)
|
|
|
|
UInt64.TryParse((string)args["group_powers"].AsString(), out GroupPowers);
|
|
|
|
if (args["accept_notices"] != null)
|
|
|
|
AcceptNotices = args["accept_notices"].AsBoolean();
|
|
|
|
}
|
2008-12-29 21:10:35 +00:00
|
|
|
}
|
|
|
|
|
2010-07-11 12:26:57 +00:00
|
|
|
public class ControllerData
|
|
|
|
{
|
2013-12-11 01:39:56 +00:00
|
|
|
public UUID ObjectID;
|
2010-07-11 12:26:57 +00:00
|
|
|
public UUID ItemID;
|
|
|
|
public uint IgnoreControls;
|
|
|
|
public uint EventControls;
|
|
|
|
|
2013-12-11 01:39:56 +00:00
|
|
|
public ControllerData(UUID obj, UUID item, uint ignore, uint ev)
|
2010-07-11 12:26:57 +00:00
|
|
|
{
|
2013-12-11 01:39:56 +00:00
|
|
|
ObjectID = obj;
|
2010-07-11 12:26:57 +00:00
|
|
|
ItemID = item;
|
|
|
|
IgnoreControls = ignore;
|
|
|
|
EventControls = ev;
|
|
|
|
}
|
|
|
|
|
|
|
|
public ControllerData(OSDMap args)
|
|
|
|
{
|
|
|
|
UnpackUpdateMessage(args);
|
|
|
|
}
|
|
|
|
|
|
|
|
public OSDMap PackUpdateMessage()
|
|
|
|
{
|
|
|
|
OSDMap controldata = new OSDMap();
|
2013-12-11 01:39:56 +00:00
|
|
|
controldata["object"] = OSD.FromUUID(ObjectID);
|
2010-07-11 12:26:57 +00:00
|
|
|
controldata["item"] = OSD.FromUUID(ItemID);
|
|
|
|
controldata["ignore"] = OSD.FromInteger(IgnoreControls);
|
|
|
|
controldata["event"] = OSD.FromInteger(EventControls);
|
|
|
|
|
|
|
|
return controldata;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void UnpackUpdateMessage(OSDMap args)
|
|
|
|
{
|
2013-12-11 01:39:56 +00:00
|
|
|
if (args["object"] != null)
|
|
|
|
ObjectID = args["object"].AsUUID();
|
2010-07-11 12:26:57 +00:00
|
|
|
if (args["item"] != null)
|
|
|
|
ItemID = args["item"].AsUUID();
|
|
|
|
if (args["ignore"] != null)
|
|
|
|
IgnoreControls = (uint)args["ignore"].AsInteger();
|
|
|
|
if (args["event"] != null)
|
|
|
|
EventControls = (uint)args["event"].AsInteger();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-01-03 02:29:49 +00:00
|
|
|
public class AgentData : IAgentData
|
2008-12-29 21:10:35 +00:00
|
|
|
{
|
2009-01-03 02:29:49 +00:00
|
|
|
private UUID m_id;
|
|
|
|
public UUID AgentID
|
|
|
|
{
|
|
|
|
get { return m_id; }
|
|
|
|
set { m_id = value; }
|
|
|
|
}
|
2010-01-07 23:53:55 +00:00
|
|
|
public UUID RegionID;
|
2008-12-29 21:10:35 +00:00
|
|
|
public uint CircuitCode;
|
|
|
|
public UUID SessionID;
|
|
|
|
|
|
|
|
public Vector3 Position;
|
|
|
|
public Vector3 Velocity;
|
|
|
|
public Vector3 Center;
|
|
|
|
public Vector3 Size;
|
|
|
|
public Vector3 AtAxis;
|
|
|
|
public Vector3 LeftAxis;
|
|
|
|
public Vector3 UpAxis;
|
2013-08-07 22:17:31 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Signal on a V2 teleport that Scene.IncomingChildAgentDataUpdate(AgentData ad) should wait for the
|
|
|
|
/// scene presence to become root (triggered when the viewer sends a CompleteAgentMovement UDP packet after
|
|
|
|
/// establishing the connection triggered by it's receipt of a TeleportFinish EQ message).
|
|
|
|
/// </summary>
|
New Teleport protocol (V2), still compatible with V1 and older. (version of the destination is being checked)
In this new protocol, and as committed before, the viewer is not sent EnableSimulator/EstablishChildCommunication for the destination. Instead, it is sent TeleportFinish directly. TeleportFinish, in turn, makes the viewer send a UserCircuitCode packet followed by CompleteMovementIntoRegion packet. These 2 packets tend to occur one after the other almost immediately to the point that when CMIR arrives the client is not even connected yet and that packet is ignored (there might have been some race conditions here before); then the viewer sends CMIR again within 5-8 secs. But the delay between them may be higher in busier regions, which may lead to race conditions.
This commit improves the process so there are are no race conditions at the destination. CompleteMovement (triggered by the viewer) waits until Update has been sent from the origin. Update, in turn, waits until there is a *root* scene presence -- so making sure CompleteMovement has run MakeRoot. In other words, there are two threadlets at the destination, one from the viewer and one from the origin region, waiting for each other to do the right thing. That makes it safe to close the agent at the origin upon return of the Update call without having to wait for callback, because we are absolutely sure that the viewer knows it is in th new region.
Note also that in the V1 protocol, the destination was getting UseCircuitCode from the viewer twice -- once on EstablishAgentCommunication and then again on TeleportFinish. The second UCC was being ignored, but it shows how we were not following the expected steps...
2013-07-22 18:54:35 +00:00
|
|
|
public bool SenderWantsToWaitForRoot;
|
2008-12-29 21:10:35 +00:00
|
|
|
|
|
|
|
public float Far;
|
|
|
|
public float Aspect;
|
|
|
|
//public int[] Throttles;
|
|
|
|
public byte[] Throttles;
|
|
|
|
|
|
|
|
public uint LocomotionState;
|
|
|
|
public Quaternion HeadRotation;
|
|
|
|
public Quaternion BodyRotation;
|
|
|
|
public uint ControlFlags;
|
|
|
|
public float EnergyLevel;
|
|
|
|
public Byte GodLevel;
|
|
|
|
public bool AlwaysRun;
|
|
|
|
public UUID PreyAgent;
|
|
|
|
public Byte AgentAccess;
|
|
|
|
public UUID ActiveGroupID;
|
|
|
|
|
|
|
|
public AgentGroupData[] Groups;
|
2009-04-01 19:50:09 +00:00
|
|
|
public Animation[] Anims;
|
2012-10-30 20:45:39 +00:00
|
|
|
public Animation DefaultAnim = null;
|
|
|
|
public Animation AnimState = null;
|
2008-12-29 21:10:35 +00:00
|
|
|
|
|
|
|
public UUID GranterID;
|
2013-12-11 01:39:56 +00:00
|
|
|
public UUID ParentPart;
|
|
|
|
public Vector3 SitOffset;
|
2008-12-29 21:10:35 +00:00
|
|
|
|
2009-04-01 19:50:09 +00:00
|
|
|
// Appearance
|
2010-10-20 23:17:54 +00:00
|
|
|
public AvatarAppearance Appearance;
|
|
|
|
|
2010-10-26 19:54:28 +00:00
|
|
|
// DEBUG ON
|
|
|
|
private static readonly ILog m_log =
|
|
|
|
LogManager.GetLogger(
|
|
|
|
MethodBase.GetCurrentMethod().DeclaringType);
|
|
|
|
// DEBUG OFF
|
|
|
|
|
2010-10-20 23:17:54 +00:00
|
|
|
/*
|
2009-04-01 19:50:09 +00:00
|
|
|
public byte[] AgentTextures;
|
2009-01-03 00:00:37 +00:00
|
|
|
public byte[] VisualParams;
|
2009-04-01 19:50:09 +00:00
|
|
|
public UUID[] Wearables;
|
2010-10-20 23:17:54 +00:00
|
|
|
public AvatarAttachment[] Attachments;
|
|
|
|
*/
|
2010-07-11 12:26:57 +00:00
|
|
|
// Scripted
|
|
|
|
public ControllerData[] Controllers;
|
|
|
|
|
2009-01-01 19:42:24 +00:00
|
|
|
public string CallbackURI;
|
2008-12-29 21:10:35 +00:00
|
|
|
|
2011-04-29 03:19:54 +00:00
|
|
|
// These two must have the same Count
|
|
|
|
public List<ISceneObject> AttachmentObjects;
|
|
|
|
public List<string> AttachmentObjectStates;
|
|
|
|
|
2009-04-01 19:50:09 +00:00
|
|
|
public virtual OSDMap Pack()
|
2008-12-29 21:10:35 +00:00
|
|
|
{
|
2011-12-09 23:24:52 +00:00
|
|
|
// m_log.InfoFormat("[CHILDAGENTDATAUPDATE] Pack data");
|
2010-10-26 19:54:28 +00:00
|
|
|
|
2008-12-29 21:10:35 +00:00
|
|
|
OSDMap args = new OSDMap();
|
2009-01-03 00:00:37 +00:00
|
|
|
args["message_type"] = OSD.FromString("AgentData");
|
|
|
|
|
2010-01-07 23:53:55 +00:00
|
|
|
args["region_id"] = OSD.FromString(RegionID.ToString());
|
2008-12-29 21:10:35 +00:00
|
|
|
args["circuit_code"] = OSD.FromString(CircuitCode.ToString());
|
2008-12-30 23:53:51 +00:00
|
|
|
args["agent_uuid"] = OSD.FromUUID(AgentID);
|
|
|
|
args["session_uuid"] = OSD.FromUUID(SessionID);
|
|
|
|
|
|
|
|
args["position"] = OSD.FromString(Position.ToString());
|
|
|
|
args["velocity"] = OSD.FromString(Velocity.ToString());
|
|
|
|
args["center"] = OSD.FromString(Center.ToString());
|
|
|
|
args["size"] = OSD.FromString(Size.ToString());
|
|
|
|
args["at_axis"] = OSD.FromString(AtAxis.ToString());
|
|
|
|
args["left_axis"] = OSD.FromString(LeftAxis.ToString());
|
|
|
|
args["up_axis"] = OSD.FromString(UpAxis.ToString());
|
2008-12-29 21:10:35 +00:00
|
|
|
|
New Teleport protocol (V2), still compatible with V1 and older. (version of the destination is being checked)
In this new protocol, and as committed before, the viewer is not sent EnableSimulator/EstablishChildCommunication for the destination. Instead, it is sent TeleportFinish directly. TeleportFinish, in turn, makes the viewer send a UserCircuitCode packet followed by CompleteMovementIntoRegion packet. These 2 packets tend to occur one after the other almost immediately to the point that when CMIR arrives the client is not even connected yet and that packet is ignored (there might have been some race conditions here before); then the viewer sends CMIR again within 5-8 secs. But the delay between them may be higher in busier regions, which may lead to race conditions.
This commit improves the process so there are are no race conditions at the destination. CompleteMovement (triggered by the viewer) waits until Update has been sent from the origin. Update, in turn, waits until there is a *root* scene presence -- so making sure CompleteMovement has run MakeRoot. In other words, there are two threadlets at the destination, one from the viewer and one from the origin region, waiting for each other to do the right thing. That makes it safe to close the agent at the origin upon return of the Update call without having to wait for callback, because we are absolutely sure that the viewer knows it is in th new region.
Note also that in the V1 protocol, the destination was getting UseCircuitCode from the viewer twice -- once on EstablishAgentCommunication and then again on TeleportFinish. The second UCC was being ignored, but it shows how we were not following the expected steps...
2013-07-22 18:54:35 +00:00
|
|
|
//backwards compatibility
|
|
|
|
args["changed_grid"] = OSD.FromBoolean(SenderWantsToWaitForRoot);
|
|
|
|
args["wait_for_root"] = OSD.FromBoolean(SenderWantsToWaitForRoot);
|
2008-12-29 21:10:35 +00:00
|
|
|
args["far"] = OSD.FromReal(Far);
|
|
|
|
args["aspect"] = OSD.FromReal(Aspect);
|
|
|
|
|
|
|
|
if ((Throttles != null) && (Throttles.Length > 0))
|
|
|
|
args["throttles"] = OSD.FromBinary(Throttles);
|
|
|
|
|
|
|
|
args["locomotion_state"] = OSD.FromString(LocomotionState.ToString());
|
2008-12-30 23:53:51 +00:00
|
|
|
args["head_rotation"] = OSD.FromString(HeadRotation.ToString());
|
|
|
|
args["body_rotation"] = OSD.FromString(BodyRotation.ToString());
|
2008-12-29 21:10:35 +00:00
|
|
|
args["control_flags"] = OSD.FromString(ControlFlags.ToString());
|
|
|
|
|
|
|
|
args["energy_level"] = OSD.FromReal(EnergyLevel);
|
|
|
|
args["god_level"] = OSD.FromString(GodLevel.ToString());
|
|
|
|
args["always_run"] = OSD.FromBoolean(AlwaysRun);
|
2008-12-30 23:53:51 +00:00
|
|
|
args["prey_agent"] = OSD.FromUUID(PreyAgent);
|
2008-12-29 21:10:35 +00:00
|
|
|
args["agent_access"] = OSD.FromString(AgentAccess.ToString());
|
|
|
|
|
2008-12-30 23:53:51 +00:00
|
|
|
args["active_group_id"] = OSD.FromUUID(ActiveGroupID);
|
2010-01-12 17:22:58 +00:00
|
|
|
|
2009-01-03 00:00:37 +00:00
|
|
|
if ((Groups != null) && (Groups.Length > 0))
|
|
|
|
{
|
|
|
|
OSDArray groups = new OSDArray(Groups.Length);
|
|
|
|
foreach (AgentGroupData agd in Groups)
|
|
|
|
groups.Add(agd.PackUpdateMessage());
|
|
|
|
args["groups"] = groups;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((Anims != null) && (Anims.Length > 0))
|
|
|
|
{
|
|
|
|
OSDArray anims = new OSDArray(Anims.Length);
|
2009-04-01 19:50:09 +00:00
|
|
|
foreach (Animation aanim in Anims)
|
2009-01-03 00:00:37 +00:00
|
|
|
anims.Add(aanim.PackUpdateMessage());
|
|
|
|
args["animations"] = anims;
|
|
|
|
}
|
|
|
|
|
2012-10-30 20:45:39 +00:00
|
|
|
if (DefaultAnim != null)
|
|
|
|
{
|
|
|
|
args["default_animation"] = DefaultAnim.PackUpdateMessage();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (AnimState != null)
|
|
|
|
{
|
|
|
|
args["animation_state"] = AnimState.PackUpdateMessage();
|
|
|
|
}
|
|
|
|
|
2010-10-20 23:17:54 +00:00
|
|
|
if (Appearance != null)
|
|
|
|
args["packed_appearance"] = Appearance.Pack();
|
|
|
|
|
2009-04-01 19:50:09 +00:00
|
|
|
//if ((AgentTextures != null) && (AgentTextures.Length > 0))
|
|
|
|
//{
|
|
|
|
// OSDArray textures = new OSDArray(AgentTextures.Length);
|
|
|
|
// foreach (UUID uuid in AgentTextures)
|
|
|
|
// textures.Add(OSD.FromUUID(uuid));
|
|
|
|
// args["agent_textures"] = textures;
|
|
|
|
//}
|
|
|
|
|
2010-10-25 16:41:08 +00:00
|
|
|
// The code to pack textures, visuals, wearables and attachments
|
|
|
|
// should be removed; packed appearance contains the full appearance
|
|
|
|
// This is retained for backward compatibility only
|
2010-10-25 21:11:47 +00:00
|
|
|
if (Appearance.Texture != null)
|
|
|
|
{
|
|
|
|
byte[] rawtextures = Appearance.Texture.GetBytes();
|
|
|
|
args["texture_entry"] = OSD.FromBinary(rawtextures);
|
|
|
|
}
|
2009-04-01 19:50:09 +00:00
|
|
|
|
2010-10-25 16:41:08 +00:00
|
|
|
if ((Appearance.VisualParams != null) && (Appearance.VisualParams.Length > 0))
|
|
|
|
args["visual_params"] = OSD.FromBinary(Appearance.VisualParams);
|
2009-01-03 00:00:37 +00:00
|
|
|
|
2009-04-01 19:50:09 +00:00
|
|
|
// We might not pass this in all cases...
|
2010-10-25 16:41:08 +00:00
|
|
|
if ((Appearance.Wearables != null) && (Appearance.Wearables.Length > 0))
|
2009-04-01 19:50:09 +00:00
|
|
|
{
|
2010-10-29 23:41:36 +00:00
|
|
|
OSDArray wears = new OSDArray(Appearance.Wearables.Length);
|
2010-10-25 16:41:08 +00:00
|
|
|
foreach (AvatarWearable awear in Appearance.Wearables)
|
2010-10-29 23:41:36 +00:00
|
|
|
wears.Add(awear.Pack());
|
|
|
|
|
2009-04-01 19:50:09 +00:00
|
|
|
args["wearables"] = wears;
|
|
|
|
}
|
|
|
|
|
2010-10-25 21:11:47 +00:00
|
|
|
List<AvatarAttachment> attachments = Appearance.GetAttachments();
|
|
|
|
if ((attachments != null) && (attachments.Count > 0))
|
2009-08-16 23:17:19 +00:00
|
|
|
{
|
2010-10-25 21:11:47 +00:00
|
|
|
OSDArray attachs = new OSDArray(attachments.Count);
|
2010-10-25 16:41:08 +00:00
|
|
|
foreach (AvatarAttachment att in attachments)
|
2010-10-20 23:17:54 +00:00
|
|
|
attachs.Add(att.Pack());
|
2009-08-16 23:17:19 +00:00
|
|
|
args["attachments"] = attachs;
|
|
|
|
}
|
2010-10-25 16:41:08 +00:00
|
|
|
// End of code to remove
|
|
|
|
|
2010-07-11 12:26:57 +00:00
|
|
|
if ((Controllers != null) && (Controllers.Length > 0))
|
|
|
|
{
|
|
|
|
OSDArray controls = new OSDArray(Controllers.Length);
|
|
|
|
foreach (ControllerData ctl in Controllers)
|
|
|
|
controls.Add(ctl.PackUpdateMessage());
|
|
|
|
args["controllers"] = controls;
|
|
|
|
}
|
|
|
|
|
2009-01-01 19:42:24 +00:00
|
|
|
if ((CallbackURI != null) && (!CallbackURI.Equals("")))
|
|
|
|
args["callback_uri"] = OSD.FromString(CallbackURI);
|
|
|
|
|
2011-04-29 03:19:54 +00:00
|
|
|
// Attachment objects for fatpack messages
|
|
|
|
if (AttachmentObjects != null)
|
|
|
|
{
|
|
|
|
int i = 0;
|
|
|
|
OSDArray attObjs = new OSDArray(AttachmentObjects.Count);
|
|
|
|
foreach (ISceneObject so in AttachmentObjects)
|
|
|
|
{
|
|
|
|
OSDMap info = new OSDMap(4);
|
|
|
|
info["sog"] = OSD.FromString(so.ToXml2());
|
|
|
|
info["extra"] = OSD.FromString(so.ExtraToXmlString());
|
|
|
|
info["modified"] = OSD.FromBoolean(so.HasGroupChanged);
|
|
|
|
try
|
|
|
|
{
|
|
|
|
info["state"] = OSD.FromString(AttachmentObjectStates[i++]);
|
|
|
|
}
|
2011-05-06 21:45:03 +00:00
|
|
|
catch (IndexOutOfRangeException)
|
2011-04-29 03:19:54 +00:00
|
|
|
{
|
2011-04-30 23:53:43 +00:00
|
|
|
m_log.WarnFormat("[CHILD AGENT DATA]: scripts list is shorter than object list.");
|
2011-04-29 03:19:54 +00:00
|
|
|
}
|
2010-01-12 17:22:58 +00:00
|
|
|
|
2011-04-29 03:19:54 +00:00
|
|
|
attObjs.Add(info);
|
|
|
|
}
|
|
|
|
args["attach_objects"] = attObjs;
|
|
|
|
}
|
2013-12-11 01:39:56 +00:00
|
|
|
|
|
|
|
args["parent_part"] = OSD.FromUUID(ParentPart);
|
|
|
|
args["sit_offset"] = OSD.FromString(SitOffset.ToString());
|
|
|
|
|
2008-12-29 21:10:35 +00:00
|
|
|
return args;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Deserialization of agent data.
|
|
|
|
/// Avoiding reflection makes it painful to write, but that's the price!
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="hash"></param>
|
2011-04-29 03:19:54 +00:00
|
|
|
public virtual void Unpack(OSDMap args, IScene scene)
|
2008-12-29 21:10:35 +00:00
|
|
|
{
|
2011-12-17 01:23:30 +00:00
|
|
|
//m_log.InfoFormat("[CHILDAGENTDATAUPDATE] Unpack data");
|
2010-10-26 19:54:28 +00:00
|
|
|
|
2010-01-07 23:53:55 +00:00
|
|
|
if (args.ContainsKey("region_id"))
|
|
|
|
UUID.TryParse(args["region_id"].AsString(), out RegionID);
|
2008-12-29 21:10:35 +00:00
|
|
|
|
|
|
|
if (args["circuit_code"] != null)
|
|
|
|
UInt32.TryParse((string)args["circuit_code"].AsString(), out CircuitCode);
|
|
|
|
|
|
|
|
if (args["agent_uuid"] != null)
|
|
|
|
AgentID = args["agent_uuid"].AsUUID();
|
|
|
|
|
|
|
|
if (args["session_uuid"] != null)
|
|
|
|
SessionID = args["session_uuid"].AsUUID();
|
|
|
|
|
|
|
|
if (args["position"] != null)
|
|
|
|
Vector3.TryParse(args["position"].AsString(), out Position);
|
|
|
|
|
|
|
|
if (args["velocity"] != null)
|
|
|
|
Vector3.TryParse(args["velocity"].AsString(), out Velocity);
|
|
|
|
|
|
|
|
if (args["center"] != null)
|
|
|
|
Vector3.TryParse(args["center"].AsString(), out Center);
|
|
|
|
|
|
|
|
if (args["size"] != null)
|
|
|
|
Vector3.TryParse(args["size"].AsString(), out Size);
|
|
|
|
|
|
|
|
if (args["at_axis"] != null)
|
|
|
|
Vector3.TryParse(args["at_axis"].AsString(), out AtAxis);
|
|
|
|
|
|
|
|
if (args["left_axis"] != null)
|
|
|
|
Vector3.TryParse(args["left_axis"].AsString(), out AtAxis);
|
|
|
|
|
|
|
|
if (args["up_axis"] != null)
|
|
|
|
Vector3.TryParse(args["up_axis"].AsString(), out AtAxis);
|
|
|
|
|
New Teleport protocol (V2), still compatible with V1 and older. (version of the destination is being checked)
In this new protocol, and as committed before, the viewer is not sent EnableSimulator/EstablishChildCommunication for the destination. Instead, it is sent TeleportFinish directly. TeleportFinish, in turn, makes the viewer send a UserCircuitCode packet followed by CompleteMovementIntoRegion packet. These 2 packets tend to occur one after the other almost immediately to the point that when CMIR arrives the client is not even connected yet and that packet is ignored (there might have been some race conditions here before); then the viewer sends CMIR again within 5-8 secs. But the delay between them may be higher in busier regions, which may lead to race conditions.
This commit improves the process so there are are no race conditions at the destination. CompleteMovement (triggered by the viewer) waits until Update has been sent from the origin. Update, in turn, waits until there is a *root* scene presence -- so making sure CompleteMovement has run MakeRoot. In other words, there are two threadlets at the destination, one from the viewer and one from the origin region, waiting for each other to do the right thing. That makes it safe to close the agent at the origin upon return of the Update call without having to wait for callback, because we are absolutely sure that the viewer knows it is in th new region.
Note also that in the V1 protocol, the destination was getting UseCircuitCode from the viewer twice -- once on EstablishAgentCommunication and then again on TeleportFinish. The second UCC was being ignored, but it shows how we were not following the expected steps...
2013-07-22 18:54:35 +00:00
|
|
|
if (args.ContainsKey("wait_for_root") && args["wait_for_root"] != null)
|
|
|
|
SenderWantsToWaitForRoot = args["wait_for_root"].AsBoolean();
|
2008-12-29 21:10:35 +00:00
|
|
|
|
|
|
|
if (args["far"] != null)
|
|
|
|
Far = (float)(args["far"].AsReal());
|
|
|
|
|
|
|
|
if (args["aspect"] != null)
|
|
|
|
Aspect = (float)args["aspect"].AsReal();
|
|
|
|
|
|
|
|
if (args["throttles"] != null)
|
|
|
|
Throttles = args["throttles"].AsBinary();
|
|
|
|
|
|
|
|
if (args["locomotion_state"] != null)
|
|
|
|
UInt32.TryParse(args["locomotion_state"].AsString(), out LocomotionState);
|
|
|
|
|
|
|
|
if (args["head_rotation"] != null)
|
|
|
|
Quaternion.TryParse(args["head_rotation"].AsString(), out HeadRotation);
|
|
|
|
|
|
|
|
if (args["body_rotation"] != null)
|
|
|
|
Quaternion.TryParse(args["body_rotation"].AsString(), out BodyRotation);
|
|
|
|
|
|
|
|
if (args["control_flags"] != null)
|
|
|
|
UInt32.TryParse(args["control_flags"].AsString(), out ControlFlags);
|
|
|
|
|
|
|
|
if (args["energy_level"] != null)
|
|
|
|
EnergyLevel = (float)(args["energy_level"].AsReal());
|
|
|
|
|
|
|
|
if (args["god_level"] != null)
|
|
|
|
Byte.TryParse(args["god_level"].AsString(), out GodLevel);
|
|
|
|
|
|
|
|
if (args["always_run"] != null)
|
|
|
|
AlwaysRun = args["always_run"].AsBoolean();
|
|
|
|
|
|
|
|
if (args["prey_agent"] != null)
|
|
|
|
PreyAgent = args["prey_agent"].AsUUID();
|
|
|
|
|
|
|
|
if (args["agent_access"] != null)
|
|
|
|
Byte.TryParse(args["agent_access"].AsString(), out AgentAccess);
|
|
|
|
|
|
|
|
if (args["active_group_id"] != null)
|
|
|
|
ActiveGroupID = args["active_group_id"].AsUUID();
|
2009-01-01 19:42:24 +00:00
|
|
|
|
2009-02-12 09:53:12 +00:00
|
|
|
if ((args["groups"] != null) && (args["groups"]).Type == OSDType.Array)
|
2009-01-03 00:00:37 +00:00
|
|
|
{
|
|
|
|
OSDArray groups = (OSDArray)(args["groups"]);
|
|
|
|
Groups = new AgentGroupData[groups.Count];
|
|
|
|
int i = 0;
|
|
|
|
foreach (OSD o in groups)
|
|
|
|
{
|
2009-02-12 09:53:12 +00:00
|
|
|
if (o.Type == OSDType.Map)
|
2009-01-03 00:00:37 +00:00
|
|
|
{
|
|
|
|
Groups[i++] = new AgentGroupData((OSDMap)o);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-02-12 09:53:12 +00:00
|
|
|
if ((args["animations"] != null) && (args["animations"]).Type == OSDType.Array)
|
2009-01-03 00:00:37 +00:00
|
|
|
{
|
|
|
|
OSDArray anims = (OSDArray)(args["animations"]);
|
2009-04-01 19:50:09 +00:00
|
|
|
Anims = new Animation[anims.Count];
|
2009-01-03 00:00:37 +00:00
|
|
|
int i = 0;
|
|
|
|
foreach (OSD o in anims)
|
|
|
|
{
|
2009-02-12 09:53:12 +00:00
|
|
|
if (o.Type == OSDType.Map)
|
2009-01-03 00:00:37 +00:00
|
|
|
{
|
2009-04-01 19:50:09 +00:00
|
|
|
Anims[i++] = new Animation((OSDMap)o);
|
2009-01-03 00:00:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-10-30 20:45:39 +00:00
|
|
|
if (args["default_animation"] != null)
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
DefaultAnim = new Animation((OSDMap)args["default_animation"]);
|
|
|
|
}
|
|
|
|
catch
|
|
|
|
{
|
|
|
|
DefaultAnim = null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (args["animation_state"] != null)
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
AnimState = new Animation((OSDMap)args["animation_state"]);
|
|
|
|
}
|
|
|
|
catch
|
|
|
|
{
|
|
|
|
AnimState = null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-04-01 19:50:09 +00:00
|
|
|
//if ((args["agent_textures"] != null) && (args["agent_textures"]).Type == OSDType.Array)
|
|
|
|
//{
|
|
|
|
// OSDArray textures = (OSDArray)(args["agent_textures"]);
|
|
|
|
// AgentTextures = new UUID[textures.Count];
|
|
|
|
// int i = 0;
|
|
|
|
// foreach (OSD o in textures)
|
|
|
|
// AgentTextures[i++] = o.AsUUID();
|
|
|
|
//}
|
|
|
|
|
2011-08-01 23:13:04 +00:00
|
|
|
Appearance = new AvatarAppearance();
|
2010-10-25 16:41:08 +00:00
|
|
|
|
2010-10-26 19:54:28 +00:00
|
|
|
// The code to unpack textures, visuals, wearables and attachments
|
2010-10-25 16:41:08 +00:00
|
|
|
// should be removed; packed appearance contains the full appearance
|
|
|
|
// This is retained for backward compatibility only
|
2009-04-01 19:50:09 +00:00
|
|
|
if (args["texture_entry"] != null)
|
2010-10-25 21:11:47 +00:00
|
|
|
{
|
|
|
|
byte[] rawtextures = args["texture_entry"].AsBinary();
|
|
|
|
Primitive.TextureEntry textures = new Primitive.TextureEntry(rawtextures,0,rawtextures.Length);
|
|
|
|
Appearance.SetTextureEntries(textures);
|
|
|
|
}
|
2009-04-01 19:50:09 +00:00
|
|
|
|
2009-01-03 00:00:37 +00:00
|
|
|
if (args["visual_params"] != null)
|
2010-10-25 16:41:08 +00:00
|
|
|
Appearance.SetVisualParams(args["visual_params"].AsBinary());
|
2009-01-03 00:00:37 +00:00
|
|
|
|
2009-04-01 19:50:09 +00:00
|
|
|
if ((args["wearables"] != null) && (args["wearables"]).Type == OSDType.Array)
|
|
|
|
{
|
|
|
|
OSDArray wears = (OSDArray)(args["wearables"]);
|
2010-10-25 16:41:08 +00:00
|
|
|
for (int i = 0; i < wears.Count / 2; i++)
|
|
|
|
{
|
2010-10-29 23:41:36 +00:00
|
|
|
AvatarWearable awear = new AvatarWearable((OSDArray)wears[i]);
|
2010-10-26 19:54:28 +00:00
|
|
|
Appearance.SetWearable(i,awear);
|
2010-10-25 16:41:08 +00:00
|
|
|
}
|
2009-04-01 19:50:09 +00:00
|
|
|
}
|
2009-08-16 23:17:19 +00:00
|
|
|
|
|
|
|
if ((args["attachments"] != null) && (args["attachments"]).Type == OSDType.Array)
|
|
|
|
{
|
|
|
|
OSDArray attachs = (OSDArray)(args["attachments"]);
|
|
|
|
foreach (OSD o in attachs)
|
|
|
|
{
|
|
|
|
if (o.Type == OSDType.Map)
|
|
|
|
{
|
2010-10-25 21:11:47 +00:00
|
|
|
// We know all of these must end up as attachments so we
|
|
|
|
// append rather than replace to ensure multiple attachments
|
|
|
|
// per point continues to work
|
2011-09-06 00:59:21 +00:00
|
|
|
// m_log.DebugFormat("[CHILDAGENTDATAUPDATE]: Appending attachments for {0}", AgentID);
|
2010-10-25 21:11:47 +00:00
|
|
|
Appearance.AppendAttachment(new AvatarAttachment((OSDMap)o));
|
2009-08-16 23:17:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2010-10-25 16:41:08 +00:00
|
|
|
// end of code to remove
|
|
|
|
|
2010-10-25 21:11:47 +00:00
|
|
|
if (args.ContainsKey("packed_appearance") && (args["packed_appearance"]).Type == OSDType.Map)
|
2011-08-01 23:13:04 +00:00
|
|
|
Appearance = new AvatarAppearance((OSDMap)args["packed_appearance"]);
|
2010-10-25 21:11:47 +00:00
|
|
|
else
|
2010-10-26 19:54:28 +00:00
|
|
|
m_log.WarnFormat("[CHILDAGENTDATAUPDATE] No packed appearance");
|
2010-10-25 16:41:08 +00:00
|
|
|
|
2010-07-11 12:26:57 +00:00
|
|
|
if ((args["controllers"] != null) && (args["controllers"]).Type == OSDType.Array)
|
|
|
|
{
|
|
|
|
OSDArray controls = (OSDArray)(args["controllers"]);
|
|
|
|
Controllers = new ControllerData[controls.Count];
|
|
|
|
int i = 0;
|
|
|
|
foreach (OSD o in controls)
|
|
|
|
{
|
|
|
|
if (o.Type == OSDType.Map)
|
|
|
|
{
|
|
|
|
Controllers[i++] = new ControllerData((OSDMap)o);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-01-01 19:42:24 +00:00
|
|
|
if (args["callback_uri"] != null)
|
|
|
|
CallbackURI = args["callback_uri"].AsString();
|
2011-04-29 03:19:54 +00:00
|
|
|
|
|
|
|
// Attachment objects
|
|
|
|
if (args["attach_objects"] != null && args["attach_objects"].Type == OSDType.Array)
|
|
|
|
{
|
|
|
|
OSDArray attObjs = (OSDArray)(args["attach_objects"]);
|
|
|
|
AttachmentObjects = new List<ISceneObject>();
|
|
|
|
AttachmentObjectStates = new List<string>();
|
|
|
|
foreach (OSD o in attObjs)
|
|
|
|
{
|
|
|
|
if (o.Type == OSDType.Map)
|
|
|
|
{
|
|
|
|
OSDMap info = (OSDMap)o;
|
|
|
|
ISceneObject so = scene.DeserializeObject(info["sog"].AsString());
|
|
|
|
so.ExtraFromXmlString(info["extra"].AsString());
|
|
|
|
so.HasGroupChanged = info["modified"].AsBoolean();
|
|
|
|
AttachmentObjects.Add(so);
|
|
|
|
AttachmentObjectStates.Add(info["state"].AsString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-12-11 01:39:56 +00:00
|
|
|
|
|
|
|
if (args["parent_part"] != null)
|
|
|
|
ParentPart = args["parent_part"].AsUUID();
|
|
|
|
if (args["sit_offset"] != null)
|
|
|
|
Vector3.TryParse(args["sit_offset"].AsString(), out SitOffset);
|
2008-12-29 21:10:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public AgentData()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public AgentData(Hashtable hash)
|
|
|
|
{
|
|
|
|
//UnpackUpdateMessage(hash);
|
|
|
|
}
|
|
|
|
|
2009-04-01 19:50:09 +00:00
|
|
|
public void Dump()
|
2008-12-29 21:10:35 +00:00
|
|
|
{
|
2009-04-01 19:50:09 +00:00
|
|
|
System.Console.WriteLine("------------ AgentData ------------");
|
|
|
|
System.Console.WriteLine("UUID: " + AgentID);
|
2010-01-07 23:53:55 +00:00
|
|
|
System.Console.WriteLine("Region: " + RegionID);
|
2009-04-01 19:50:09 +00:00
|
|
|
System.Console.WriteLine("Position: " + Position);
|
|
|
|
}
|
|
|
|
}
|
2008-12-29 21:10:35 +00:00
|
|
|
|
2009-04-01 19:50:09 +00:00
|
|
|
public class CompleteAgentData : AgentData
|
|
|
|
{
|
|
|
|
public override OSDMap Pack()
|
|
|
|
{
|
|
|
|
return base.Pack();
|
2008-12-29 21:10:35 +00:00
|
|
|
}
|
|
|
|
|
2011-04-29 03:19:54 +00:00
|
|
|
public override void Unpack(OSDMap map, IScene scene)
|
2008-12-29 21:10:35 +00:00
|
|
|
{
|
2011-04-29 03:19:54 +00:00
|
|
|
base.Unpack(map, scene);
|
2008-12-29 21:10:35 +00:00
|
|
|
}
|
2007-12-09 05:59:49 +00:00
|
|
|
}
|
2008-09-06 07:52:41 +00:00
|
|
|
}
|