* remove now unused serialization code

0.6.4-rc1
Justin Clarke Casey 2009-03-05 18:36:37 +00:00
parent 7768f3aa8b
commit 0de34e9a18
6 changed files with 32 additions and 676 deletions

View File

@ -34,8 +34,7 @@ using OpenMetaverse;
namespace OpenSim.Framework
{
[Serializable]
public class AvatarAppearance : ISerializable
public class AvatarAppearance
{
// private static readonly ILog m_log
// = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@ -105,102 +104,127 @@ namespace OpenSim.Framework
get { return m_wearables[BODY].ItemID; }
set { m_wearables[BODY].ItemID = value; }
}
public virtual UUID BodyAsset {
get { return m_wearables[BODY].AssetID; }
set { m_wearables[BODY].AssetID = value; }
}
public virtual UUID SkinItem {
get { return m_wearables[SKIN].ItemID; }
set { m_wearables[SKIN].ItemID = value; }
}
public virtual UUID SkinAsset {
get { return m_wearables[SKIN].AssetID; }
set { m_wearables[SKIN].AssetID = value; }
}
public virtual UUID HairItem {
get { return m_wearables[HAIR].ItemID; }
set { m_wearables[HAIR].ItemID = value; }
}
public virtual UUID HairAsset {
get { return m_wearables[HAIR].AssetID; }
set { m_wearables[HAIR].AssetID = value; }
}
public virtual UUID EyesItem {
get { return m_wearables[EYES].ItemID; }
set { m_wearables[EYES].ItemID = value; }
}
public virtual UUID EyesAsset {
get { return m_wearables[EYES].AssetID; }
set { m_wearables[EYES].AssetID = value; }
}
public virtual UUID ShirtItem {
get { return m_wearables[SHIRT].ItemID; }
set { m_wearables[SHIRT].ItemID = value; }
}
public virtual UUID ShirtAsset {
get { return m_wearables[SHIRT].AssetID; }
set { m_wearables[SHIRT].AssetID = value; }
}
public virtual UUID PantsItem {
get { return m_wearables[PANTS].ItemID; }
set { m_wearables[PANTS].ItemID = value; }
}
public virtual UUID PantsAsset {
get { return m_wearables[PANTS].AssetID; }
set { m_wearables[PANTS].AssetID = value; }
}
public virtual UUID ShoesItem {
get { return m_wearables[SHOES].ItemID; }
set { m_wearables[SHOES].ItemID = value; }
}
public virtual UUID ShoesAsset {
get { return m_wearables[SHOES].AssetID; }
set { m_wearables[SHOES].AssetID = value; }
}
public virtual UUID SocksItem {
get { return m_wearables[SOCKS].ItemID; }
set { m_wearables[SOCKS].ItemID = value; }
}
public virtual UUID SocksAsset {
get { return m_wearables[SOCKS].AssetID; }
set { m_wearables[SOCKS].AssetID = value; }
}
public virtual UUID JacketItem {
get { return m_wearables[JACKET].ItemID; }
set { m_wearables[JACKET].ItemID = value; }
}
public virtual UUID JacketAsset {
get { return m_wearables[JACKET].AssetID; }
set { m_wearables[JACKET].AssetID = value; }
}
public virtual UUID GlovesItem {
get { return m_wearables[GLOVES].ItemID; }
set { m_wearables[GLOVES].ItemID = value; }
}
public virtual UUID GlovesAsset {
get { return m_wearables[GLOVES].AssetID; }
set { m_wearables[GLOVES].AssetID = value; }
}
public virtual UUID UnderShirtItem {
get { return m_wearables[UNDERSHIRT].ItemID; }
set { m_wearables[UNDERSHIRT].ItemID = value; }
}
public virtual UUID UnderShirtAsset {
get { return m_wearables[UNDERSHIRT].AssetID; }
set { m_wearables[UNDERSHIRT].AssetID = value; }
}
public virtual UUID UnderPantsItem {
get { return m_wearables[UNDERPANTS].ItemID; }
set { m_wearables[UNDERPANTS].ItemID = value; }
}
public virtual UUID UnderPantsAsset {
get { return m_wearables[UNDERPANTS].AssetID; }
set { m_wearables[UNDERPANTS].AssetID = value; }
}
public virtual UUID SkirtItem {
get { return m_wearables[SKIRT].ItemID; }
set { m_wearables[SKIRT].ItemID = value; }
}
public virtual UUID SkirtAsset {
get { return m_wearables[SKIRT].AssetID; }
set { m_wearables[SKIRT].AssetID = value; }
@ -333,26 +357,6 @@ namespace OpenSim.Framework
return s;
}
protected AvatarAppearance(SerializationInfo info, StreamingContext context)
{
if (info == null)
{
throw new ArgumentNullException("info");
}
m_owner = new UUID((Guid)info.GetValue("m_scenePresenceID", typeof(Guid)));
m_serial = (int)info.GetValue("m_wearablesSerial", typeof(int));
m_visualparams = (byte[])info.GetValue("m_visualParams", typeof(byte[]));
m_wearables = (AvatarWearable[])info.GetValue("m_wearables", typeof(AvatarWearable[]));
byte[] m_textureEntry_work = (byte[])info.GetValue("m_textureEntry", typeof(byte[]));
m_texture = new Primitive.TextureEntry(m_textureEntry_work, 0, m_textureEntry_work.Length);
m_avatarHeight = (float)info.GetValue("m_avatarHeight", typeof(float));
//m_log.Debug("AvatarAppearance Deserialize END");
}
// this is used for OGS1
public virtual Hashtable ToHashTable()
{
@ -444,24 +448,6 @@ namespace OpenSim.Framework
}
}
[SecurityPermission(SecurityAction.LinkDemand,
Flags = SecurityPermissionFlag.SerializationFormatter)]
public virtual void GetObjectData(
SerializationInfo info, StreamingContext context)
{
if (info == null)
{
throw new ArgumentNullException("info");
}
info.AddValue("m_scenePresenceID", m_owner.Guid);
info.AddValue("m_wearablesSerial", m_serial);
info.AddValue("m_visualParams", m_visualparams);
info.AddValue("m_wearables", m_wearables);
info.AddValue("m_textureEntry", m_texture.ToBytes());
info.AddValue("m_avatarHeight", m_avatarHeight);
}
private Dictionary<int, UUID[]> m_attachments = new Dictionary<int, UUID[]>();
public void SetAttachments(Hashtable data)

View File

@ -32,8 +32,7 @@ using OpenMetaverse;
namespace OpenSim.Framework
{
[Serializable]
public class AvatarWearable : ISerializable
public class AvatarWearable
{
public UUID AssetID = new UUID("00000000-0000-0000-0000-000000000000");
public UUID ItemID = new UUID("00000000-0000-0000-0000-000000000000");
@ -48,20 +47,6 @@ namespace OpenSim.Framework
ItemID = itemId;
}
protected AvatarWearable(SerializationInfo info, StreamingContext context)
{
//m_log.Debug("AvatarWearable Deserialize BGN");
if (info == null)
{
throw new ArgumentNullException("info");
}
AssetID = new UUID((Guid) info.GetValue("AssetID", typeof (Guid)));
ItemID = new UUID((Guid) info.GetValue("ItemID", typeof (Guid)));
//m_log.Debug("AvatarWearable Deserialize END");
}
public static AvatarWearable[] DefaultWearables
{
get
@ -91,23 +76,5 @@ namespace OpenSim.Framework
return defaultWearables;
}
}
#region ISerializable Members
[SecurityPermission(SecurityAction.LinkDemand,
Flags = SecurityPermissionFlag.SerializationFormatter)]
public virtual void GetObjectData(
SerializationInfo info, StreamingContext context)
{
if (info == null)
{
throw new ArgumentNullException("info");
}
info.AddValue("AssetID", AssetID.Guid);
info.AddValue("ItemID", ItemID.Guid);
}
#endregion
}
}

View File

@ -32,8 +32,7 @@ using OpenMetaverse;
namespace OpenSim.Region.Framework.Scenes
{
[Serializable]
public abstract class EntityBase : ISerializable
public abstract class EntityBase
{
/// <summary>
/// The scene to which this entity belongs
@ -145,87 +144,7 @@ namespace OpenSim.Region.Framework.Scenes
return (EntityBase) MemberwiseClone();
}
public abstract void SetText(string text, Vector3 color, double alpha);
protected EntityBase(SerializationInfo info, StreamingContext context)
{
//m_log.Debug("EntityBase Deserialize BGN");
if (info == null)
{
throw new ArgumentNullException("info");
}
m_uuid = new UUID((Guid)info.GetValue("m_uuid", typeof(Guid)));
m_name = (string)info.GetValue("m_name", typeof(string));
m_pos
= new Vector3(
(float)info.GetValue("m_pos.X", typeof(float)),
(float)info.GetValue("m_pos.Y", typeof(float)),
(float)info.GetValue("m_pos.Z", typeof(float)));
m_velocity
= new Vector3(
(float)info.GetValue("m_velocity.X", typeof(float)),
(float)info.GetValue("m_velocity.Y", typeof(float)),
(float)info.GetValue("m_velocity.Z", typeof(float)));
m_rotationalvelocity
= new Vector3(
(float)info.GetValue("m_rotationalvelocity.X", typeof(float)),
(float)info.GetValue("m_rotationalvelocity.Y", typeof(float)),
(float)info.GetValue("m_rotationalvelocity.Z", typeof(float)));
m_rotation
= new Quaternion(
(float)info.GetValue("m_rotation.X", typeof(float)),
(float)info.GetValue("m_rotation.Y", typeof(float)),
(float)info.GetValue("m_rotation.Z", typeof(float)),
(float)info.GetValue("m_rotation.W", typeof(float)));
m_localId = (uint)info.GetValue("m_localId", typeof(uint));
//m_log.Debug("EntityBase Deserialize END");
}
[SecurityPermission(SecurityAction.LinkDemand,
Flags = SecurityPermissionFlag.SerializationFormatter)]
public virtual void GetObjectData(
SerializationInfo info, StreamingContext context)
{
if (info == null)
{
throw new ArgumentNullException("info");
}
info.AddValue("m_uuid", m_uuid.Guid);
info.AddValue("m_name", m_name);
// Vector3
info.AddValue("m_pos.X", m_pos.X);
info.AddValue("m_pos.Y", m_pos.Y);
info.AddValue("m_pos.Z", m_pos.Z);
// Vector3
info.AddValue("m_velocity.X", m_velocity.X);
info.AddValue("m_velocity.Y", m_velocity.Y);
info.AddValue("m_velocity.Z", m_velocity.Z);
// Vector3
info.AddValue("m_rotationalvelocity.X", m_rotationalvelocity.X);
info.AddValue("m_rotationalvelocity.Y", m_rotationalvelocity.Y);
info.AddValue("m_rotationalvelocity.Z", m_rotationalvelocity.Z);
// Quaternion
info.AddValue("m_rotation.X", m_rotation.X);
info.AddValue("m_rotation.Y", m_rotation.Y);
info.AddValue("m_rotation.Z", m_rotation.Z);
info.AddValue("m_rotation.W", m_rotation.W);
info.AddValue("m_localId", m_localId);
}
}
//Nested Classes

View File

@ -92,8 +92,7 @@ namespace OpenSim.Region.Framework.Scenes
#endregion Enumerations
[Serializable]
public class SceneObjectPart : IScriptHost, ISerializable
public class SceneObjectPart : IScriptHost
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@ -318,27 +317,6 @@ namespace OpenSim.Region.Framework.Scenes
m_inventory = new SceneObjectPartInventory(this);
}
protected SceneObjectPart(SerializationInfo info, StreamingContext context)
{
//m_log.Debug("SceneObjectPart Deserialize BGN");
m_TextureAnimation = new byte[0];
m_particleSystem = new byte[0];
if (info == null)
{
throw new ArgumentNullException("info");
}
/*
m_queue = (Queue<SceneObjectPart>)info.GetValue("m_queue", typeof(Queue<SceneObjectPart>));
m_ids = (List<UUID>)info.GetValue("m_ids", typeof(List<UUID>));
*/
//m_log.Debug("SceneObjectPart Deserialize END");
Rezzed = DateTime.Now;
m_inventory = new SceneObjectPartInventory(this);
}
#endregion Constructors
#region XML Schema
@ -1699,107 +1677,6 @@ if (m_shape != null) {
return new PhysicsVector();
}
[SecurityPermission(SecurityAction.LinkDemand,
Flags = SecurityPermissionFlag.SerializationFormatter)]
public virtual void GetObjectData(
SerializationInfo info, StreamingContext context)
{
if (info == null)
{
throw new ArgumentNullException("info");
}
info.AddValue("m_inventoryFileName", Inventory.GetInventoryFileName());
info.AddValue("m_folderID", UUID);
info.AddValue("PhysActor", PhysActor);
Dictionary<Guid, TaskInventoryItem> TaskInventory_work = new Dictionary<Guid, TaskInventoryItem>();
lock (TaskInventory)
{
foreach (UUID id in TaskInventory.Keys)
{
TaskInventory_work.Add(id.Guid, TaskInventory[id]);
}
}
info.AddValue("TaskInventory", TaskInventory_work);
info.AddValue("LastOwnerID", _lastOwnerID.Guid);
info.AddValue("OwnerID", _ownerID.Guid);
info.AddValue("GroupID", _groupID.Guid);
info.AddValue("OwnershipCost", _ownershipCost);
info.AddValue("ObjectSaleType", _objectSaleType);
info.AddValue("SalePrice", _salePrice);
info.AddValue("Category", _category);
info.AddValue("CreationDate", _creationDate);
info.AddValue("ParentID", _parentID);
info.AddValue("OwnerMask", _ownerMask);
info.AddValue("NextOwnerMask", _nextOwnerMask);
info.AddValue("GroupMask", _groupMask);
info.AddValue("EveryoneMask", _everyoneMask);
info.AddValue("BaseMask", _baseMask);
info.AddValue("m_particleSystem", m_particleSystem);
info.AddValue("TimeStampFull", TimeStampFull);
info.AddValue("TimeStampTerse", TimeStampTerse);
info.AddValue("TimeStampLastActivity", TimeStampLastActivity);
info.AddValue("m_updateFlag", m_updateFlag);
info.AddValue("CreatorID", _creatorID.Guid);
info.AddValue("m_inventorySerial", m_inventory.Serial);
info.AddValue("m_uuid", m_uuid.Guid);
info.AddValue("m_localID", m_localId);
info.AddValue("m_name", m_name);
info.AddValue("m_flags", _flags);
info.AddValue("m_material", m_material);
info.AddValue("m_regionHandle", m_regionHandle);
info.AddValue("m_groupPosition.X", m_groupPosition.X);
info.AddValue("m_groupPosition.Y", m_groupPosition.Y);
info.AddValue("m_groupPosition.Z", m_groupPosition.Z);
info.AddValue("m_offsetPosition.X", m_offsetPosition.X);
info.AddValue("m_offsetPosition.Y", m_offsetPosition.Y);
info.AddValue("m_offsetPosition.Z", m_offsetPosition.Z);
info.AddValue("m_rotationOffset.W", m_rotationOffset.W);
info.AddValue("m_rotationOffset.X", m_rotationOffset.X);
info.AddValue("m_rotationOffset.Y", m_rotationOffset.Y);
info.AddValue("m_rotationOffset.Z", m_rotationOffset.Z);
info.AddValue("m_velocity.X", m_velocity.X);
info.AddValue("m_velocity.Y", m_velocity.Y);
info.AddValue("m_velocity.Z", m_velocity.Z);
info.AddValue("m_rotationalvelocity.X", RotationalVelocity.X);
info.AddValue("m_rotationalvelocity.Y", RotationalVelocity.Y);
info.AddValue("m_rotationalvelocity.Z", RotationalVelocity.Z);
info.AddValue("m_angularVelocity.X", m_angularVelocity.X);
info.AddValue("m_angularVelocity.Y", m_angularVelocity.Y);
info.AddValue("m_angularVelocity.Z", m_angularVelocity.Z);
info.AddValue("m_acceleration.X", m_acceleration.X);
info.AddValue("m_acceleration.Y", m_acceleration.Y);
info.AddValue("m_acceleration.Z", m_acceleration.Z);
info.AddValue("m_description", m_description);
info.AddValue("m_color", m_color);
info.AddValue("m_text", m_text);
info.AddValue("m_sitName", m_sitName);
info.AddValue("m_touchName", m_touchName);
info.AddValue("m_clickAction", m_clickAction);
info.AddValue("m_shape", m_shape);
info.AddValue("m_parentGroup", m_parentGroup);
info.AddValue("PayPrice", PayPrice);
}
public void GetProperties(IClientAPI client)
{
client.SendObjectPropertiesReply(

View File

@ -66,8 +66,7 @@ namespace OpenSim.Region.Framework.Scenes
public ScriptControlled eventControls;
}
[Serializable]
public class ScenePresence : EntityBase, ISerializable
public class ScenePresence : EntityBase
{
// ~ScenePresence()
// {
@ -2823,20 +2822,14 @@ namespace OpenSim.Region.Framework.Scenes
DefaultTexture = textu.ToBytes();
}
[Serializable]
public class NewForce
{
public float X;
public float Y;
public float Z;
public NewForce()
{
}
}
[Serializable]
public class ScenePartUpdate : ISerializable
public class ScenePartUpdate
{
public UUID FullID;
public uint LastFullUpdateTime;
@ -2848,37 +2841,6 @@ namespace OpenSim.Region.Framework.Scenes
LastFullUpdateTime = 0;
LastTerseUpdateTime = 0;
}
protected ScenePartUpdate(SerializationInfo info, StreamingContext context)
{
//m_log.Debug("ScenePartUpdate Deserialize BGN");
if (info == null)
{
throw new ArgumentNullException("info");
}
FullID = new UUID((Guid)info.GetValue("FullID", typeof(Guid)));
LastFullUpdateTime = (uint)info.GetValue("LastFullUpdateTime", typeof(uint));
LastTerseUpdateTime = (uint)info.GetValue("LastTerseUpdateTime", typeof(uint));
//m_log.Debug("ScenePartUpdate Deserialize END");
}
[SecurityPermission(SecurityAction.LinkDemand,
Flags = SecurityPermissionFlag.SerializationFormatter)]
public virtual void GetObjectData(
SerializationInfo info, StreamingContext context)
{
if (info == null)
{
throw new ArgumentNullException("info");
}
info.AddValue("FullID", FullID.Guid);
info.AddValue("LastFullUpdateTime", LastFullUpdateTime);
info.AddValue("LastTerseUpdateTime", LastTerseUpdateTime);
}
}
public override void SetText(string text, Vector3 color, double alpha)
@ -2992,13 +2954,6 @@ namespace OpenSim.Region.Framework.Scenes
public ScenePresence()
{
/* JB
if (Animations == null)
{
Animations = new AvatarAnimations();
Animations.LoadAnims();
}
*/
if (DefaultTexture == null)
{
Primitive.TextureEntry textu = AvatarAppearance.GetDefaultTexture();
@ -3116,310 +3071,6 @@ namespace OpenSim.Region.Framework.Scenes
*/
}
protected ScenePresence(SerializationInfo info, StreamingContext context)
: base (info, context)
{
//m_log.Debug("ScenePresence Deserialize BGN");
if (info == null)
{
throw new ArgumentNullException("info");
}
/* JB
if (Animations == null)
{
Animations = new AvatarAnimations();
Animations.LoadAnims();
}
*/
if (DefaultTexture == null)
{
Primitive.TextureEntry textu = AvatarAppearance.GetDefaultTexture();
DefaultTexture = textu.ToBytes();
}
m_animations = (AnimationSet)info.GetValue("m_animations", typeof(AnimationSet));
m_updateflag = (bool)info.GetValue("m_updateflag", typeof(bool));
m_movementflag = (byte)info.GetValue("m_movementflag", typeof(byte));
m_forcesList = (List<NewForce>)info.GetValue("m_forcesList", typeof(List<NewForce>));
m_updateCount = (short)info.GetValue("m_updateCount", typeof(short));
m_requestedSitTargetID = (uint)info.GetValue("m_requestedSitTargetID", typeof(uint));
m_requestedSitOffset
= new Vector3(
(float)info.GetValue("m_requestedSitOffset.X", typeof(float)),
(float)info.GetValue("m_requestedSitOffset.Y", typeof(float)),
(float)info.GetValue("m_requestedSitOffset.Z", typeof(float)));
m_sitAvatarHeight = (float)info.GetValue("m_sitAvatarHeight", typeof(float));
m_godlevel = (float)info.GetValue("m_godlevel", typeof(float));
m_setAlwaysRun = (bool)info.GetValue("m_setAlwaysRun", typeof(bool));
m_bodyRot
= new Quaternion(
(float)info.GetValue("m_bodyRot.X", typeof(float)),
(float)info.GetValue("m_bodyRot.Y", typeof(float)),
(float)info.GetValue("m_bodyRot.Z", typeof(float)),
(float)info.GetValue("m_bodyRot.W", typeof(float)));
IsRestrictedToRegion = (bool)info.GetValue("IsRestrictedToRegion", typeof(bool));
m_newForce = (bool)info.GetValue("m_newForce", typeof(bool));
//m_newAvatar = (bool)info.GetValue("m_newAvatar", typeof(bool));
m_newCoarseLocations = (bool)info.GetValue("m_newCoarseLocations", typeof(bool));
m_avHeight = (float)info.GetValue("m_avHeight", typeof(float));
crossingFromRegion = (ulong)info.GetValue("crossingFromRegion", typeof(ulong));
List<float[]> Dir_Vectors_work = (List<float[]>)info.GetValue("Dir_Vectors", typeof(List<float[]>));
List<Vector3> Dir_Vectors_work2 = new List<Vector3>();
foreach (float[] f3 in Dir_Vectors_work)
{
Dir_Vectors_work2.Add(new Vector3(f3[0], f3[1], f3[2]));
}
Dir_Vectors = Dir_Vectors_work2.ToArray();
lastPhysPos
= new Vector3(
(float)info.GetValue("lastPhysPos.X", typeof(float)),
(float)info.GetValue("lastPhysPos.Y", typeof(float)),
(float)info.GetValue("lastPhysPos.Z", typeof(float)));
// Possibly we should store lastPhysRot. But there may well be not much point since rotation changes
// wouldn't carry us across borders anyway
m_CameraCenter
= new Vector3(
(float)info.GetValue("m_CameraCenter.X", typeof(float)),
(float)info.GetValue("m_CameraCenter.Y", typeof(float)),
(float)info.GetValue("m_CameraCenter.Z", typeof(float)));
m_CameraAtAxis
= new Vector3(
(float)info.GetValue("m_CameraAtAxis.X", typeof(float)),
(float)info.GetValue("m_CameraAtAxis.Y", typeof(float)),
(float)info.GetValue("m_CameraAtAxis.Z", typeof(float)));
m_CameraLeftAxis
= new Vector3(
(float)info.GetValue("m_CameraLeftAxis.X", typeof(float)),
(float)info.GetValue("m_CameraLeftAxis.Y", typeof(float)),
(float)info.GetValue("m_CameraLeftAxis.Z", typeof(float)));
m_CameraUpAxis
= new Vector3(
(float)info.GetValue("m_CameraUpAxis.X", typeof(float)),
(float)info.GetValue("m_CameraUpAxis.Y", typeof(float)),
(float)info.GetValue("m_CameraUpAxis.Z", typeof(float)));
m_DrawDistance = (float)info.GetValue("m_DrawDistance", typeof(float));
m_appearance = (AvatarAppearance)info.GetValue("m_appearance", typeof(AvatarAppearance));
m_knownChildRegions = (Dictionary<ulong, string>)info.GetValue("m_knownChildRegions", typeof(Dictionary<ulong, string>));
posLastSignificantMove
= new Vector3(
(float)info.GetValue("posLastSignificantMove.X", typeof(float)),
(float)info.GetValue("posLastSignificantMove.Y", typeof(float)),
(float)info.GetValue("posLastSignificantMove.Z", typeof(float)));
// m_partsUpdateQueue = (UpdateQueue)info.GetValue("m_partsUpdateQueue", typeof(UpdateQueue));
/*
Dictionary<Guid, ScenePartUpdate> updateTimes_work
= (Dictionary<Guid, ScenePartUpdate>)info.GetValue("m_updateTimes", typeof(Dictionary<Guid, ScenePartUpdate>));
foreach (Guid id in updateTimes_work.Keys)
{
m_updateTimes.Add(new UUID(id), updateTimes_work[id]);
}
*/
m_regionHandle = (ulong)info.GetValue("m_regionHandle", typeof(ulong));
m_firstname = (string)info.GetValue("m_firstname", typeof(string));
m_lastname = (string)info.GetValue("m_lastname", typeof(string));
m_allowMovement = (bool)info.GetValue("m_allowMovement", typeof(bool));
m_parentPosition = new Vector3((float)info.GetValue("m_parentPosition.X", typeof(float)),
(float)info.GetValue("m_parentPosition.Y", typeof(float)),
(float)info.GetValue("m_parentPosition.Z", typeof(float)));
m_isChildAgent = (bool)info.GetValue("m_isChildAgent", typeof(bool));
m_parentID = (uint)info.GetValue("m_parentID", typeof(uint));
// for OpenSim_v0.5
currentParcelUUID = new UUID((Guid)info.GetValue("currentParcelUUID", typeof(Guid)));
lastKnownAllowedPosition
= new Vector3(
(float)info.GetValue("lastKnownAllowedPosition.X", typeof(float)),
(float)info.GetValue("lastKnownAllowedPosition.Y", typeof(float)),
(float)info.GetValue("lastKnownAllowedPosition.Z", typeof(float)));
sentMessageAboutRestrictedParcelFlyingDown = (bool)info.GetValue("sentMessageAboutRestrictedParcelFlyingDown", typeof(bool));
m_LastChildAgentUpdatePosition
= new Vector3(
(float)info.GetValue("m_LastChildAgentUpdatePosition.X", typeof(float)),
(float)info.GetValue("m_LastChildAgentUpdatePosition.Y", typeof(float)),
(float)info.GetValue("m_LastChildAgentUpdatePosition.Z", typeof(float)));
m_perfMonMS = (int)info.GetValue("m_perfMonMS", typeof(int));
m_AgentControlFlags = (uint)info.GetValue("m_AgentControlFlags", typeof(uint));
m_headrotation
= new Quaternion(
(float)info.GetValue("m_headrotation.X", typeof(float)),
(float)info.GetValue("m_headrotation.Y", typeof(float)),
(float)info.GetValue("m_headrotation.Z", typeof(float)),
(float)info.GetValue("m_headrotation.W", typeof(float)));
m_state = (byte)info.GetValue("m_state", typeof(byte));
//m_log.Debug("ScenePresence Deserialize END");
}
[SecurityPermission(SecurityAction.LinkDemand,
Flags = SecurityPermissionFlag.SerializationFormatter)]
public override void GetObjectData(
SerializationInfo info, StreamingContext context)
{
if (info == null)
{
throw new ArgumentNullException("info");
}
base.GetObjectData(info, context);
info.AddValue("m_animations", m_animations);
info.AddValue("m_updateflag", m_updateflag);
info.AddValue("m_movementflag", m_movementflag);
info.AddValue("m_forcesList", m_forcesList);
info.AddValue("m_updateCount", m_updateCount);
info.AddValue("m_requestedSitTargetID", m_requestedSitTargetID);
// Vector3
info.AddValue("m_requestedSitOffset.X", m_requestedSitOffset.X);
info.AddValue("m_requestedSitOffset.Y", m_requestedSitOffset.Y);
info.AddValue("m_requestedSitOffset.Z", m_requestedSitOffset.Z);
info.AddValue("m_sitAvatarHeight", m_sitAvatarHeight);
info.AddValue("m_godlevel", m_godlevel);
info.AddValue("m_setAlwaysRun", m_setAlwaysRun);
// Quaternion
info.AddValue("m_bodyRot.X", m_bodyRot.X);
info.AddValue("m_bodyRot.Y", m_bodyRot.Y);
info.AddValue("m_bodyRot.Z", m_bodyRot.Z);
info.AddValue("m_bodyRot.W", m_bodyRot.W);
info.AddValue("IsRestrictedToRegion", IsRestrictedToRegion);
info.AddValue("m_newForce", m_newForce);
//info.AddValue("m_newAvatar", m_newAvatar);
info.AddValue("m_newCoarseLocations", m_newCoarseLocations);
info.AddValue("m_gotAPrimitivesInScene", false);
info.AddValue("m_avHeight", m_avHeight);
// info.AddValue("m_regionInfo", m_regionInfo);
info.AddValue("crossingFromRegion", crossingFromRegion);
List<float[]> Dir_Vectors_work = new List<float[]>();
foreach (Vector3 v3 in Dir_Vectors)
{
Dir_Vectors_work.Add(new float[] { v3.X, v3.Y, v3.Z });
}
info.AddValue("Dir_Vectors", Dir_Vectors_work);
// Vector3
info.AddValue("lastPhysPos.X", lastPhysPos.X);
info.AddValue("lastPhysPos.Y", lastPhysPos.Y);
info.AddValue("lastPhysPos.Z", lastPhysPos.Z);
// Possibly we should retrieve lastPhysRot. But there may well be not much point since rotation changes
// wouldn't carry us across borders anyway
// Vector3
info.AddValue("m_CameraCenter.X", m_CameraCenter.X);
info.AddValue("m_CameraCenter.Y", m_CameraCenter.Y);
info.AddValue("m_CameraCenter.Z", m_CameraCenter.Z);
// Vector3
info.AddValue("m_CameraAtAxis.X", m_CameraAtAxis.X);
info.AddValue("m_CameraAtAxis.Y", m_CameraAtAxis.Y);
info.AddValue("m_CameraAtAxis.Z", m_CameraAtAxis.Z);
// Vector3
info.AddValue("m_CameraLeftAxis.X", m_CameraLeftAxis.X);
info.AddValue("m_CameraLeftAxis.Y", m_CameraLeftAxis.Y);
info.AddValue("m_CameraLeftAxis.Z", m_CameraLeftAxis.Z);
// Vector3
info.AddValue("m_CameraUpAxis.X", m_CameraUpAxis.X);
info.AddValue("m_CameraUpAxis.Y", m_CameraUpAxis.Y);
info.AddValue("m_CameraUpAxis.Z", m_CameraUpAxis.Z);
info.AddValue("m_DrawDistance", m_DrawDistance);
info.AddValue("m_appearance", m_appearance);
info.AddValue("m_knownChildRegions", m_knownChildRegions);
// Vector3
info.AddValue("posLastSignificantMove.X", posLastSignificantMove.X);
info.AddValue("posLastSignificantMove.Y", posLastSignificantMove.Y);
info.AddValue("posLastSignificantMove.Z", posLastSignificantMove.Z);
//info.AddValue("m_partsUpdateQueue", m_partsUpdateQueue);
/*
Dictionary<Guid, ScenePartUpdate> updateTimes_work = new Dictionary<Guid, ScenePartUpdate>();
foreach (UUID id in m_updateTimes.Keys)
{
updateTimes_work.Add(id.UUID, m_updateTimes[id]);
}
info.AddValue("m_updateTimes", updateTimes_work);
*/
info.AddValue("m_regionHandle", m_regionHandle);
info.AddValue("m_firstname", m_firstname);
info.AddValue("m_lastname", m_lastname);
info.AddValue("m_allowMovement", m_allowMovement);
//info.AddValue("m_physicsActor", m_physicsActor);
info.AddValue("m_parentPosition.X", m_parentPosition.X);
info.AddValue("m_parentPosition.Y", m_parentPosition.Y);
info.AddValue("m_parentPosition.Z", m_parentPosition.Z);
info.AddValue("m_isChildAgent", m_isChildAgent);
info.AddValue("m_parentID", m_parentID);
// for OpenSim_v0.5
info.AddValue("currentParcelUUID", currentParcelUUID.Guid);
info.AddValue("lastKnownAllowedPosition.X", lastKnownAllowedPosition.X);
info.AddValue("lastKnownAllowedPosition.Y", lastKnownAllowedPosition.Y);
info.AddValue("lastKnownAllowedPosition.Z", lastKnownAllowedPosition.Z);
info.AddValue("sentMessageAboutRestrictedParcelFlyingDown", sentMessageAboutRestrictedParcelFlyingDown);
info.AddValue("m_LastChildAgentUpdatePosition.X", m_LastChildAgentUpdatePosition.X);
info.AddValue("m_LastChildAgentUpdatePosition.Y", m_LastChildAgentUpdatePosition.Y);
info.AddValue("m_LastChildAgentUpdatePosition.Z", m_LastChildAgentUpdatePosition.Z);
info.AddValue("m_perfMonMS", m_perfMonMS);
info.AddValue("m_AgentControlFlags", m_AgentControlFlags);
info.AddValue("m_headrotation.W", m_headrotation.W);
info.AddValue("m_headrotation.X", m_headrotation.X);
info.AddValue("m_headrotation.Y", m_headrotation.Y);
info.AddValue("m_headrotation.Z", m_headrotation.Z);
info.AddValue("m_state", m_state);
List<Guid> knownPrimUUID_work = new List<Guid>();
info.AddValue("m_knownPrimUUID", knownPrimUUID_work);
}
internal void PushForce(PhysicsVector impulse)
{
if (PhysicsActor != null)
@ -3514,7 +3165,6 @@ namespace OpenSim.Region.Framework.Scenes
internal void SendControlToScripts(uint flags)
{
ScriptControlled allflags = ScriptControlled.CONTROL_ZERO;
if (MouseDown)
@ -3671,7 +3321,6 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectPart att = m_scene.GetSceneObjectPart(asset);
// If this is null, then the asset has not yet appeared in world
// so we revisit this when it does
//

View File

@ -34,8 +34,7 @@ using OpenSim.Region.Framework.Scenes;
namespace OpenSim.Region.Framework.Scenes.Types
{
[Serializable]
public class UpdateQueue : ISerializable
public class UpdateQueue
{
private Queue<SceneObjectPart> m_queue;
@ -89,46 +88,5 @@ namespace OpenSim.Region.Framework.Scenes.Types
return part;
}
protected UpdateQueue(SerializationInfo info, StreamingContext context)
{
//m_log.Debug("UpdateQueue Deserialize BGN");
if (info == null)
{
throw new ArgumentNullException("info");
}
m_queue = (Queue<SceneObjectPart>)info.GetValue("m_queue", typeof(Queue<SceneObjectPart>));
List<Guid> ids_work = (List<Guid>)info.GetValue("m_ids", typeof(List<Guid>));
foreach (Guid guid in ids_work)
{
m_ids.Add(new UUID(guid));
}
//m_log.Debug("UpdateQueue Deserialize END");
}
[SecurityPermission(SecurityAction.LinkDemand,
Flags = SecurityPermissionFlag.SerializationFormatter)]
public virtual void GetObjectData(
SerializationInfo info, StreamingContext context)
{
if (info == null)
{
throw new ArgumentNullException("info");
}
List<Guid> ids_work = new List<Guid>();
foreach (UUID uuid in m_ids)
{
ids_work.Add(uuid.Guid);
}
info.AddValue("m_queue", m_queue);
info.AddValue("m_ids", ids_work);
}
}
}