aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs355
1 files changed, 2 insertions, 353 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index db0a2d2..6eb6ea4 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -66,8 +66,7 @@ namespace OpenSim.Region.Framework.Scenes
66 public ScriptControlled eventControls; 66 public ScriptControlled eventControls;
67 } 67 }
68 68
69 [Serializable] 69 public class ScenePresence : EntityBase
70 public class ScenePresence : EntityBase, ISerializable
71 { 70 {
72// ~ScenePresence() 71// ~ScenePresence()
73// { 72// {
@@ -2823,20 +2822,14 @@ namespace OpenSim.Region.Framework.Scenes
2823 DefaultTexture = textu.ToBytes(); 2822 DefaultTexture = textu.ToBytes();
2824 } 2823 }
2825 2824
2826 [Serializable]
2827 public class NewForce 2825 public class NewForce
2828 { 2826 {
2829 public float X; 2827 public float X;
2830 public float Y; 2828 public float Y;
2831 public float Z; 2829 public float Z;
2832
2833 public NewForce()
2834 {
2835 }
2836 } 2830 }
2837 2831
2838 [Serializable] 2832 public class ScenePartUpdate
2839 public class ScenePartUpdate : ISerializable
2840 { 2833 {
2841 public UUID FullID; 2834 public UUID FullID;
2842 public uint LastFullUpdateTime; 2835 public uint LastFullUpdateTime;
@@ -2848,37 +2841,6 @@ namespace OpenSim.Region.Framework.Scenes
2848 LastFullUpdateTime = 0; 2841 LastFullUpdateTime = 0;
2849 LastTerseUpdateTime = 0; 2842 LastTerseUpdateTime = 0;
2850 } 2843 }
2851
2852 protected ScenePartUpdate(SerializationInfo info, StreamingContext context)
2853 {
2854 //m_log.Debug("ScenePartUpdate Deserialize BGN");
2855
2856 if (info == null)
2857 {
2858 throw new ArgumentNullException("info");
2859 }
2860
2861 FullID = new UUID((Guid)info.GetValue("FullID", typeof(Guid)));
2862 LastFullUpdateTime = (uint)info.GetValue("LastFullUpdateTime", typeof(uint));
2863 LastTerseUpdateTime = (uint)info.GetValue("LastTerseUpdateTime", typeof(uint));
2864
2865 //m_log.Debug("ScenePartUpdate Deserialize END");
2866 }
2867
2868 [SecurityPermission(SecurityAction.LinkDemand,
2869 Flags = SecurityPermissionFlag.SerializationFormatter)]
2870 public virtual void GetObjectData(
2871 SerializationInfo info, StreamingContext context)
2872 {
2873 if (info == null)
2874 {
2875 throw new ArgumentNullException("info");
2876 }
2877
2878 info.AddValue("FullID", FullID.Guid);
2879 info.AddValue("LastFullUpdateTime", LastFullUpdateTime);
2880 info.AddValue("LastTerseUpdateTime", LastTerseUpdateTime);
2881 }
2882 } 2844 }
2883 2845
2884 public override void SetText(string text, Vector3 color, double alpha) 2846 public override void SetText(string text, Vector3 color, double alpha)
@@ -2992,13 +2954,6 @@ namespace OpenSim.Region.Framework.Scenes
2992 2954
2993 public ScenePresence() 2955 public ScenePresence()
2994 { 2956 {
2995/* JB
2996 if (Animations == null)
2997 {
2998 Animations = new AvatarAnimations();
2999 Animations.LoadAnims();
3000 }
3001*/
3002 if (DefaultTexture == null) 2957 if (DefaultTexture == null)
3003 { 2958 {
3004 Primitive.TextureEntry textu = AvatarAppearance.GetDefaultTexture(); 2959 Primitive.TextureEntry textu = AvatarAppearance.GetDefaultTexture();
@@ -3116,310 +3071,6 @@ namespace OpenSim.Region.Framework.Scenes
3116 */ 3071 */
3117 } 3072 }
3118 3073
3119 protected ScenePresence(SerializationInfo info, StreamingContext context)
3120 : base (info, context)
3121 {
3122 //m_log.Debug("ScenePresence Deserialize BGN");
3123
3124 if (info == null)
3125 {
3126 throw new ArgumentNullException("info");
3127 }
3128/* JB
3129 if (Animations == null)
3130 {
3131 Animations = new AvatarAnimations();
3132 Animations.LoadAnims();
3133 }
3134*/
3135 if (DefaultTexture == null)
3136 {
3137 Primitive.TextureEntry textu = AvatarAppearance.GetDefaultTexture();
3138 DefaultTexture = textu.ToBytes();
3139 }
3140
3141 m_animations = (AnimationSet)info.GetValue("m_animations", typeof(AnimationSet));
3142 m_updateflag = (bool)info.GetValue("m_updateflag", typeof(bool));
3143 m_movementflag = (byte)info.GetValue("m_movementflag", typeof(byte));
3144 m_forcesList = (List<NewForce>)info.GetValue("m_forcesList", typeof(List<NewForce>));
3145 m_updateCount = (short)info.GetValue("m_updateCount", typeof(short));
3146 m_requestedSitTargetID = (uint)info.GetValue("m_requestedSitTargetID", typeof(uint));
3147
3148 m_requestedSitOffset
3149 = new Vector3(
3150 (float)info.GetValue("m_requestedSitOffset.X", typeof(float)),
3151 (float)info.GetValue("m_requestedSitOffset.Y", typeof(float)),
3152 (float)info.GetValue("m_requestedSitOffset.Z", typeof(float)));
3153
3154 m_sitAvatarHeight = (float)info.GetValue("m_sitAvatarHeight", typeof(float));
3155 m_godlevel = (float)info.GetValue("m_godlevel", typeof(float));
3156 m_setAlwaysRun = (bool)info.GetValue("m_setAlwaysRun", typeof(bool));
3157
3158 m_bodyRot
3159 = new Quaternion(
3160 (float)info.GetValue("m_bodyRot.X", typeof(float)),
3161 (float)info.GetValue("m_bodyRot.Y", typeof(float)),
3162 (float)info.GetValue("m_bodyRot.Z", typeof(float)),
3163 (float)info.GetValue("m_bodyRot.W", typeof(float)));
3164
3165 IsRestrictedToRegion = (bool)info.GetValue("IsRestrictedToRegion", typeof(bool));
3166 m_newForce = (bool)info.GetValue("m_newForce", typeof(bool));
3167 //m_newAvatar = (bool)info.GetValue("m_newAvatar", typeof(bool));
3168 m_newCoarseLocations = (bool)info.GetValue("m_newCoarseLocations", typeof(bool));
3169 m_avHeight = (float)info.GetValue("m_avHeight", typeof(float));
3170 crossingFromRegion = (ulong)info.GetValue("crossingFromRegion", typeof(ulong));
3171
3172 List<float[]> Dir_Vectors_work = (List<float[]>)info.GetValue("Dir_Vectors", typeof(List<float[]>));
3173 List<Vector3> Dir_Vectors_work2 = new List<Vector3>();
3174
3175 foreach (float[] f3 in Dir_Vectors_work)
3176 {
3177 Dir_Vectors_work2.Add(new Vector3(f3[0], f3[1], f3[2]));
3178 }
3179
3180 Dir_Vectors = Dir_Vectors_work2.ToArray();
3181
3182 lastPhysPos
3183 = new Vector3(
3184 (float)info.GetValue("lastPhysPos.X", typeof(float)),
3185 (float)info.GetValue("lastPhysPos.Y", typeof(float)),
3186 (float)info.GetValue("lastPhysPos.Z", typeof(float)));
3187
3188 // Possibly we should store lastPhysRot. But there may well be not much point since rotation changes
3189 // wouldn't carry us across borders anyway
3190
3191 m_CameraCenter
3192 = new Vector3(
3193 (float)info.GetValue("m_CameraCenter.X", typeof(float)),
3194 (float)info.GetValue("m_CameraCenter.Y", typeof(float)),
3195 (float)info.GetValue("m_CameraCenter.Z", typeof(float)));
3196
3197 m_CameraAtAxis
3198 = new Vector3(
3199 (float)info.GetValue("m_CameraAtAxis.X", typeof(float)),
3200 (float)info.GetValue("m_CameraAtAxis.Y", typeof(float)),
3201 (float)info.GetValue("m_CameraAtAxis.Z", typeof(float)));
3202
3203 m_CameraLeftAxis
3204 = new Vector3(
3205 (float)info.GetValue("m_CameraLeftAxis.X", typeof(float)),
3206 (float)info.GetValue("m_CameraLeftAxis.Y", typeof(float)),
3207 (float)info.GetValue("m_CameraLeftAxis.Z", typeof(float)));
3208
3209 m_CameraUpAxis
3210 = new Vector3(
3211 (float)info.GetValue("m_CameraUpAxis.X", typeof(float)),
3212 (float)info.GetValue("m_CameraUpAxis.Y", typeof(float)),
3213 (float)info.GetValue("m_CameraUpAxis.Z", typeof(float)));
3214
3215 m_DrawDistance = (float)info.GetValue("m_DrawDistance", typeof(float));
3216 m_appearance = (AvatarAppearance)info.GetValue("m_appearance", typeof(AvatarAppearance));
3217
3218 m_knownChildRegions = (Dictionary<ulong, string>)info.GetValue("m_knownChildRegions", typeof(Dictionary<ulong, string>));
3219
3220 posLastSignificantMove
3221 = new Vector3(
3222 (float)info.GetValue("posLastSignificantMove.X", typeof(float)),
3223 (float)info.GetValue("posLastSignificantMove.Y", typeof(float)),
3224 (float)info.GetValue("posLastSignificantMove.Z", typeof(float)));
3225
3226 // m_partsUpdateQueue = (UpdateQueue)info.GetValue("m_partsUpdateQueue", typeof(UpdateQueue));
3227
3228 /*
3229 Dictionary<Guid, ScenePartUpdate> updateTimes_work
3230 = (Dictionary<Guid, ScenePartUpdate>)info.GetValue("m_updateTimes", typeof(Dictionary<Guid, ScenePartUpdate>));
3231
3232 foreach (Guid id in updateTimes_work.Keys)
3233 {
3234 m_updateTimes.Add(new UUID(id), updateTimes_work[id]);
3235 }
3236 */
3237 m_regionHandle = (ulong)info.GetValue("m_regionHandle", typeof(ulong));
3238 m_firstname = (string)info.GetValue("m_firstname", typeof(string));
3239 m_lastname = (string)info.GetValue("m_lastname", typeof(string));
3240 m_allowMovement = (bool)info.GetValue("m_allowMovement", typeof(bool));
3241 m_parentPosition = new Vector3((float)info.GetValue("m_parentPosition.X", typeof(float)),
3242 (float)info.GetValue("m_parentPosition.Y", typeof(float)),
3243 (float)info.GetValue("m_parentPosition.Z", typeof(float)));
3244
3245 m_isChildAgent = (bool)info.GetValue("m_isChildAgent", typeof(bool));
3246 m_parentID = (uint)info.GetValue("m_parentID", typeof(uint));
3247
3248// for OpenSim_v0.5
3249 currentParcelUUID = new UUID((Guid)info.GetValue("currentParcelUUID", typeof(Guid)));
3250
3251 lastKnownAllowedPosition
3252 = new Vector3(
3253 (float)info.GetValue("lastKnownAllowedPosition.X", typeof(float)),
3254 (float)info.GetValue("lastKnownAllowedPosition.Y", typeof(float)),
3255 (float)info.GetValue("lastKnownAllowedPosition.Z", typeof(float)));
3256
3257 sentMessageAboutRestrictedParcelFlyingDown = (bool)info.GetValue("sentMessageAboutRestrictedParcelFlyingDown", typeof(bool));
3258
3259 m_LastChildAgentUpdatePosition
3260 = new Vector3(
3261 (float)info.GetValue("m_LastChildAgentUpdatePosition.X", typeof(float)),
3262 (float)info.GetValue("m_LastChildAgentUpdatePosition.Y", typeof(float)),
3263 (float)info.GetValue("m_LastChildAgentUpdatePosition.Z", typeof(float)));
3264
3265 m_perfMonMS = (int)info.GetValue("m_perfMonMS", typeof(int));
3266 m_AgentControlFlags = (uint)info.GetValue("m_AgentControlFlags", typeof(uint));
3267
3268 m_headrotation
3269 = new Quaternion(
3270 (float)info.GetValue("m_headrotation.X", typeof(float)),
3271 (float)info.GetValue("m_headrotation.Y", typeof(float)),
3272 (float)info.GetValue("m_headrotation.Z", typeof(float)),
3273 (float)info.GetValue("m_headrotation.W", typeof(float)));
3274
3275 m_state = (byte)info.GetValue("m_state", typeof(byte));
3276
3277 //m_log.Debug("ScenePresence Deserialize END");
3278 }
3279
3280 [SecurityPermission(SecurityAction.LinkDemand,
3281 Flags = SecurityPermissionFlag.SerializationFormatter)]
3282 public override void GetObjectData(
3283 SerializationInfo info, StreamingContext context)
3284 {
3285 if (info == null)
3286 {
3287 throw new ArgumentNullException("info");
3288 }
3289
3290 base.GetObjectData(info, context);
3291
3292 info.AddValue("m_animations", m_animations);
3293 info.AddValue("m_updateflag", m_updateflag);
3294 info.AddValue("m_movementflag", m_movementflag);
3295 info.AddValue("m_forcesList", m_forcesList);
3296 info.AddValue("m_updateCount", m_updateCount);
3297 info.AddValue("m_requestedSitTargetID", m_requestedSitTargetID);
3298
3299 // Vector3
3300 info.AddValue("m_requestedSitOffset.X", m_requestedSitOffset.X);
3301 info.AddValue("m_requestedSitOffset.Y", m_requestedSitOffset.Y);
3302 info.AddValue("m_requestedSitOffset.Z", m_requestedSitOffset.Z);
3303
3304 info.AddValue("m_sitAvatarHeight", m_sitAvatarHeight);
3305 info.AddValue("m_godlevel", m_godlevel);
3306 info.AddValue("m_setAlwaysRun", m_setAlwaysRun);
3307
3308 // Quaternion
3309 info.AddValue("m_bodyRot.X", m_bodyRot.X);
3310 info.AddValue("m_bodyRot.Y", m_bodyRot.Y);
3311 info.AddValue("m_bodyRot.Z", m_bodyRot.Z);
3312 info.AddValue("m_bodyRot.W", m_bodyRot.W);
3313
3314 info.AddValue("IsRestrictedToRegion", IsRestrictedToRegion);
3315 info.AddValue("m_newForce", m_newForce);
3316 //info.AddValue("m_newAvatar", m_newAvatar);
3317 info.AddValue("m_newCoarseLocations", m_newCoarseLocations);
3318 info.AddValue("m_gotAPrimitivesInScene", false);
3319 info.AddValue("m_avHeight", m_avHeight);
3320
3321 // info.AddValue("m_regionInfo", m_regionInfo);
3322
3323 info.AddValue("crossingFromRegion", crossingFromRegion);
3324
3325 List<float[]> Dir_Vectors_work = new List<float[]>();
3326
3327 foreach (Vector3 v3 in Dir_Vectors)
3328 {
3329 Dir_Vectors_work.Add(new float[] { v3.X, v3.Y, v3.Z });
3330 }
3331
3332 info.AddValue("Dir_Vectors", Dir_Vectors_work);
3333
3334 // Vector3
3335 info.AddValue("lastPhysPos.X", lastPhysPos.X);
3336 info.AddValue("lastPhysPos.Y", lastPhysPos.Y);
3337 info.AddValue("lastPhysPos.Z", lastPhysPos.Z);
3338
3339 // Possibly we should retrieve lastPhysRot. But there may well be not much point since rotation changes
3340 // wouldn't carry us across borders anyway
3341
3342 // Vector3
3343 info.AddValue("m_CameraCenter.X", m_CameraCenter.X);
3344 info.AddValue("m_CameraCenter.Y", m_CameraCenter.Y);
3345 info.AddValue("m_CameraCenter.Z", m_CameraCenter.Z);
3346
3347 // Vector3
3348 info.AddValue("m_CameraAtAxis.X", m_CameraAtAxis.X);
3349 info.AddValue("m_CameraAtAxis.Y", m_CameraAtAxis.Y);
3350 info.AddValue("m_CameraAtAxis.Z", m_CameraAtAxis.Z);
3351
3352 // Vector3
3353 info.AddValue("m_CameraLeftAxis.X", m_CameraLeftAxis.X);
3354 info.AddValue("m_CameraLeftAxis.Y", m_CameraLeftAxis.Y);
3355 info.AddValue("m_CameraLeftAxis.Z", m_CameraLeftAxis.Z);
3356
3357 // Vector3
3358 info.AddValue("m_CameraUpAxis.X", m_CameraUpAxis.X);
3359 info.AddValue("m_CameraUpAxis.Y", m_CameraUpAxis.Y);
3360 info.AddValue("m_CameraUpAxis.Z", m_CameraUpAxis.Z);
3361
3362 info.AddValue("m_DrawDistance", m_DrawDistance);
3363 info.AddValue("m_appearance", m_appearance);
3364 info.AddValue("m_knownChildRegions", m_knownChildRegions);
3365
3366 // Vector3
3367 info.AddValue("posLastSignificantMove.X", posLastSignificantMove.X);
3368 info.AddValue("posLastSignificantMove.Y", posLastSignificantMove.Y);
3369 info.AddValue("posLastSignificantMove.Z", posLastSignificantMove.Z);
3370
3371 //info.AddValue("m_partsUpdateQueue", m_partsUpdateQueue);
3372
3373 /*
3374 Dictionary<Guid, ScenePartUpdate> updateTimes_work = new Dictionary<Guid, ScenePartUpdate>();
3375
3376 foreach (UUID id in m_updateTimes.Keys)
3377 {
3378 updateTimes_work.Add(id.UUID, m_updateTimes[id]);
3379 }
3380
3381 info.AddValue("m_updateTimes", updateTimes_work);
3382 */
3383
3384 info.AddValue("m_regionHandle", m_regionHandle);
3385 info.AddValue("m_firstname", m_firstname);
3386 info.AddValue("m_lastname", m_lastname);
3387 info.AddValue("m_allowMovement", m_allowMovement);
3388 //info.AddValue("m_physicsActor", m_physicsActor);
3389 info.AddValue("m_parentPosition.X", m_parentPosition.X);
3390 info.AddValue("m_parentPosition.Y", m_parentPosition.Y);
3391 info.AddValue("m_parentPosition.Z", m_parentPosition.Z);
3392 info.AddValue("m_isChildAgent", m_isChildAgent);
3393 info.AddValue("m_parentID", m_parentID);
3394
3395// for OpenSim_v0.5
3396 info.AddValue("currentParcelUUID", currentParcelUUID.Guid);
3397
3398 info.AddValue("lastKnownAllowedPosition.X", lastKnownAllowedPosition.X);
3399 info.AddValue("lastKnownAllowedPosition.Y", lastKnownAllowedPosition.Y);
3400 info.AddValue("lastKnownAllowedPosition.Z", lastKnownAllowedPosition.Z);
3401
3402 info.AddValue("sentMessageAboutRestrictedParcelFlyingDown", sentMessageAboutRestrictedParcelFlyingDown);
3403
3404 info.AddValue("m_LastChildAgentUpdatePosition.X", m_LastChildAgentUpdatePosition.X);
3405 info.AddValue("m_LastChildAgentUpdatePosition.Y", m_LastChildAgentUpdatePosition.Y);
3406 info.AddValue("m_LastChildAgentUpdatePosition.Z", m_LastChildAgentUpdatePosition.Z);
3407
3408 info.AddValue("m_perfMonMS", m_perfMonMS);
3409 info.AddValue("m_AgentControlFlags", m_AgentControlFlags);
3410
3411 info.AddValue("m_headrotation.W", m_headrotation.W);
3412 info.AddValue("m_headrotation.X", m_headrotation.X);
3413 info.AddValue("m_headrotation.Y", m_headrotation.Y);
3414 info.AddValue("m_headrotation.Z", m_headrotation.Z);
3415
3416 info.AddValue("m_state", m_state);
3417
3418 List<Guid> knownPrimUUID_work = new List<Guid>();
3419
3420 info.AddValue("m_knownPrimUUID", knownPrimUUID_work);
3421 }
3422
3423 internal void PushForce(PhysicsVector impulse) 3074 internal void PushForce(PhysicsVector impulse)
3424 { 3075 {
3425 if (PhysicsActor != null) 3076 if (PhysicsActor != null)
@@ -3514,7 +3165,6 @@ namespace OpenSim.Region.Framework.Scenes
3514 3165
3515 internal void SendControlToScripts(uint flags) 3166 internal void SendControlToScripts(uint flags)
3516 { 3167 {
3517
3518 ScriptControlled allflags = ScriptControlled.CONTROL_ZERO; 3168 ScriptControlled allflags = ScriptControlled.CONTROL_ZERO;
3519 3169
3520 if (MouseDown) 3170 if (MouseDown)
@@ -3671,7 +3321,6 @@ namespace OpenSim.Region.Framework.Scenes
3671 3321
3672 SceneObjectPart att = m_scene.GetSceneObjectPart(asset); 3322 SceneObjectPart att = m_scene.GetSceneObjectPart(asset);
3673 3323
3674
3675 // If this is null, then the asset has not yet appeared in world 3324 // If this is null, then the asset has not yet appeared in world
3676 // so we revisit this when it does 3325 // so we revisit this when it does
3677 // 3326 //