diff options
author | UbitUmarov | 2018-12-29 19:04:39 +0000 |
---|---|---|
committer | UbitUmarov | 2018-12-29 19:04:39 +0000 |
commit | b1563788198dae9e10531802a55e7a6e6dbc39ed (patch) | |
tree | 0f54738c0cfbdf58e5988cf626516c6cfadba1c5 /OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |
parent | changes on updates (diff) | |
download | opensim-SC-b1563788198dae9e10531802a55e7a6e6dbc39ed.zip opensim-SC-b1563788198dae9e10531802a55e7a6e6dbc39ed.tar.gz opensim-SC-b1563788198dae9e10531802a55e7a6e6dbc39ed.tar.bz2 opensim-SC-b1563788198dae9e10531802a55e7a6e6dbc39ed.tar.xz |
changes on updates
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 103 |
1 files changed, 27 insertions, 76 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index b427c1a..fd3a96b 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -660,7 +660,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
660 | } | 660 | } |
661 | } | 661 | } |
662 | 662 | ||
663 | |||
664 | public Dictionary<int, string> CollisionFilter | 663 | public Dictionary<int, string> CollisionFilter |
665 | { | 664 | { |
666 | get { return m_CollisionFilter; } | 665 | get { return m_CollisionFilter; } |
@@ -3282,8 +3281,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3282 | /// </summary> | 3281 | /// </summary> |
3283 | public void ScheduleFullUpdate() | 3282 | public void ScheduleFullUpdate() |
3284 | { | 3283 | { |
3285 | // m_log.DebugFormat("[SCENE OBJECT PART]: Scheduling full update for {0} {1}", Name, LocalId); | ||
3286 | |||
3287 | if (ParentGroup == null || ParentGroup.IsDeleted || ParentGroup.Scene == null) | 3284 | if (ParentGroup == null || ParentGroup.IsDeleted || ParentGroup.Scene == null) |
3288 | return; | 3285 | return; |
3289 | 3286 | ||
@@ -3315,16 +3312,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
3315 | ParentGroup.QueueForUpdateCheck(); | 3312 | ParentGroup.QueueForUpdateCheck(); |
3316 | 3313 | ||
3317 | bool isfull = false; | 3314 | bool isfull = false; |
3318 | lock (UpdateFlagLock) | 3315 | PrimUpdateFlags update; |
3316 | if (ParentGroup.IsAttachment) | ||
3319 | { | 3317 | { |
3320 | if (ParentGroup.IsAttachment) | 3318 | update = PrimUpdateFlags.FullUpdate; |
3321 | { | 3319 | isfull = true; |
3322 | UpdateFlag |= PrimUpdateFlags.FullUpdate; | ||
3323 | isfull = true; | ||
3324 | } | ||
3325 | else | ||
3326 | UpdateFlag |= PrimUpdateFlags.TerseUpdate; | ||
3327 | } | 3320 | } |
3321 | else | ||
3322 | update = PrimUpdateFlags.TerseUpdate; | ||
3323 | |||
3324 | lock (UpdateFlagLock) | ||
3325 | UpdateFlag |= update; | ||
3326 | |||
3328 | ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this, isfull); | 3327 | ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this, isfull); |
3329 | } | 3328 | } |
3330 | 3329 | ||
@@ -3341,17 +3340,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
3341 | ParentGroup.QueueForUpdateCheck(); | 3340 | ParentGroup.QueueForUpdateCheck(); |
3342 | 3341 | ||
3343 | bool isfull = false; | 3342 | bool isfull = false; |
3344 | lock (UpdateFlagLock) | 3343 | if (ParentGroup.IsAttachment) |
3345 | { | 3344 | { |
3346 | if (ParentGroup.IsAttachment) | 3345 | update |= PrimUpdateFlags.FullUpdate; |
3347 | { | 3346 | isfull = true; |
3348 | UpdateFlag |= update | PrimUpdateFlags.FullUpdate; | ||
3349 | isfull = true; | ||
3350 | } | ||
3351 | else | ||
3352 | UpdateFlag |= update; | ||
3353 | } | 3347 | } |
3354 | 3348 | ||
3349 | lock (UpdateFlagLock) | ||
3350 | UpdateFlag |= update; | ||
3351 | |||
3355 | ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this, isfull); | 3352 | ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this, isfull); |
3356 | } | 3353 | } |
3357 | 3354 | ||
@@ -3369,40 +3366,28 @@ namespace OpenSim.Region.Framework.Scenes | |||
3369 | if (ParentGroup == null) | 3366 | if (ParentGroup == null) |
3370 | return; | 3367 | return; |
3371 | 3368 | ||
3372 | // m_log.DebugFormat( | ||
3373 | // "[SOG]: Sendinging part full update to {0} for {1} {2}", remoteClient.Name, part.Name, part.LocalId); | ||
3374 | |||
3375 | |||
3376 | if (ParentGroup.IsAttachment) | 3369 | if (ParentGroup.IsAttachment) |
3377 | { | 3370 | { |
3378 | ScenePresence sp = ParentGroup.Scene.GetScenePresence(ParentGroup.AttachedAvatar); | 3371 | ScenePresence sp = ParentGroup.Scene.GetScenePresence(ParentGroup.AttachedAvatar); |
3379 | if (sp != null) | 3372 | if (sp != null) |
3380 | { | ||
3381 | sp.SendAttachmentUpdate(this, PrimUpdateFlags.FullUpdate); | 3373 | sp.SendAttachmentUpdate(this, PrimUpdateFlags.FullUpdate); |
3382 | } | ||
3383 | } | 3374 | } |
3384 | else | 3375 | else |
3385 | { | 3376 | { |
3386 | SendFullUpdateToClient(remoteClient); | 3377 | SendUpdateToClient(remoteClient, PrimUpdateFlags.FullUpdate); |
3387 | } | 3378 | } |
3388 | } | 3379 | } |
3389 | 3380 | ||
3390 | protected internal void SendFullUpdate(IClientAPI remoteClient, PrimUpdateFlags update) | 3381 | protected internal void SendUpdate(IClientAPI remoteClient, PrimUpdateFlags update) |
3391 | { | 3382 | { |
3392 | if (ParentGroup == null) | 3383 | if (ParentGroup == null) |
3393 | return; | 3384 | return; |
3394 | 3385 | ||
3395 | // m_log.DebugFormat( | ||
3396 | // "[SOG]: Sendinging part full update to {0} for {1} {2}", remoteClient.Name, part.Name, part.LocalId); | ||
3397 | |||
3398 | |||
3399 | if (ParentGroup.IsAttachment) | 3386 | if (ParentGroup.IsAttachment) |
3400 | { | 3387 | { |
3401 | ScenePresence sp = ParentGroup.Scene.GetScenePresence(ParentGroup.AttachedAvatar); | 3388 | ScenePresence sp = ParentGroup.Scene.GetScenePresence(ParentGroup.AttachedAvatar); |
3402 | if (sp != null) | 3389 | if (sp != null) |
3403 | { | ||
3404 | sp.SendAttachmentUpdate(this, update); | 3390 | sp.SendAttachmentUpdate(this, update); |
3405 | } | ||
3406 | } | 3391 | } |
3407 | else | 3392 | else |
3408 | { | 3393 | { |
@@ -3413,7 +3398,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3413 | /// <summary> | 3398 | /// <summary> |
3414 | /// Send a full update for this part to all clients. | 3399 | /// Send a full update for this part to all clients. |
3415 | /// </summary> | 3400 | /// </summary> |
3416 | public void SendFullUpdateToAllClientsInternal() | 3401 | public void SendFullUpdateToAllClientsNoAttachment() |
3417 | { | 3402 | { |
3418 | if (ParentGroup == null) | 3403 | if (ParentGroup == null) |
3419 | return; | 3404 | return; |
@@ -3427,11 +3412,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
3427 | m_lastAcceleration = Acceleration; | 3412 | m_lastAcceleration = Acceleration; |
3428 | m_lastAngularVelocity = AngularVelocity; | 3413 | m_lastAngularVelocity = AngularVelocity; |
3429 | m_lastUpdateSentTime = Util.GetTimeStampMS(); | 3414 | m_lastUpdateSentTime = Util.GetTimeStampMS(); |
3415 | UpdateFlag &= ~PrimUpdateFlags.FullUpdate; | ||
3430 | } | 3416 | } |
3431 | 3417 | ||
3432 | ParentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar) | 3418 | ParentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar) |
3433 | { | 3419 | { |
3434 | SendFullUpdate(avatar.ControllingClient); | 3420 | SendUpdateToClient(avatar.ControllingClient, PrimUpdateFlags.FullUpdate); |
3435 | }); | 3421 | }); |
3436 | } | 3422 | } |
3437 | 3423 | ||
@@ -3449,52 +3435,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
3449 | m_lastAcceleration = Acceleration; | 3435 | m_lastAcceleration = Acceleration; |
3450 | m_lastAngularVelocity = AngularVelocity; | 3436 | m_lastAngularVelocity = AngularVelocity; |
3451 | m_lastUpdateSentTime = Util.GetTimeStampMS(); | 3437 | m_lastUpdateSentTime = Util.GetTimeStampMS(); |
3438 | UpdateFlag &= ~PrimUpdateFlags.FullUpdate; | ||
3452 | } | 3439 | } |
3453 | 3440 | ||
3454 | if (ParentGroup.IsAttachment) | 3441 | if (ParentGroup.IsAttachment) |
3455 | { | 3442 | { |
3456 | ScenePresence sp = ParentGroup.Scene.GetScenePresence(ParentGroup.AttachedAvatar); | 3443 | ScenePresence sp = ParentGroup.Scene.GetScenePresence(ParentGroup.AttachedAvatar); |
3457 | if (sp != null) | 3444 | if (sp != null) |
3458 | { | ||
3459 | sp.SendAttachmentUpdate(this, PrimUpdateFlags.FullUpdate); | 3445 | sp.SendAttachmentUpdate(this, PrimUpdateFlags.FullUpdate); |
3460 | } | ||
3461 | } | 3446 | } |
3462 | else | 3447 | else |
3463 | { | 3448 | { |
3464 | ParentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar) | 3449 | ParentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar) |
3465 | { | 3450 | { |
3466 | SendFullUpdate(avatar.ControllingClient); | 3451 | SendUpdateToClient(avatar.ControllingClient, PrimUpdateFlags.FullUpdate); |
3467 | }); | 3452 | }); |
3468 | } | 3453 | } |
3469 | } | 3454 | } |
3470 | 3455 | ||
3471 | /// <summary> | ||
3472 | /// Sends a full update to the client | ||
3473 | /// </summary> | ||
3474 | /// <param name="remoteClient"></param> | ||
3475 | public void SendFullUpdateToClient(IClientAPI remoteClient) | ||
3476 | { | ||
3477 | if (ParentGroup == null || ParentGroup.IsDeleted) | ||
3478 | return; | ||
3479 | |||
3480 | if (ParentGroup.IsAttachment | ||
3481 | && ParentGroup.AttachedAvatar != remoteClient.AgentId | ||
3482 | && ParentGroup.HasPrivateAttachmentPoint) | ||
3483 | return; | ||
3484 | |||
3485 | if (remoteClient.AgentId == OwnerID) | ||
3486 | { | ||
3487 | if ((Flags & PrimFlags.CreateSelected) != 0) | ||
3488 | Flags &= ~PrimFlags.CreateSelected; | ||
3489 | } | ||
3490 | //bool isattachment = IsAttachment; | ||
3491 | //if (LocalId != ParentGroup.RootPart.LocalId) | ||
3492 | //isattachment = ParentGroup.RootPart.IsAttachment; | ||
3493 | |||
3494 | remoteClient.SendEntityUpdate(this, PrimUpdateFlags.FullUpdate); | ||
3495 | ParentGroup.Scene.StatsReporter.AddObjectUpdates(1); | ||
3496 | } | ||
3497 | |||
3498 | private const float ROTATION_TOLERANCE = 0.01f; | 3456 | private const float ROTATION_TOLERANCE = 0.01f; |
3499 | private const float VELOCITY_TOLERANCE = 0.1f; | 3457 | private const float VELOCITY_TOLERANCE = 0.1f; |
3500 | private const float ANGVELOCITY_TOLERANCE = 0.005f; | 3458 | private const float ANGVELOCITY_TOLERANCE = 0.005f; |
@@ -3546,17 +3504,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
3546 | if(vz > 128.0) | 3504 | if(vz > 128.0) |
3547 | break; | 3505 | break; |
3548 | 3506 | ||
3549 | if( | 3507 | if(vx < VELOCITY_TOLERANCE && vy < VELOCITY_TOLERANCE && vz < VELOCITY_TOLERANCE |
3550 | vx < VELOCITY_TOLERANCE && | ||
3551 | vy < VELOCITY_TOLERANCE && | ||
3552 | vz < VELOCITY_TOLERANCE | ||
3553 | ) | 3508 | ) |
3554 | { | 3509 | { |
3555 | if(!AbsolutePosition.ApproxEquals(m_lastPosition, POSITION_TOLERANCE)) | 3510 | if(!AbsolutePosition.ApproxEquals(m_lastPosition, POSITION_TOLERANCE)) |
3556 | break; | 3511 | break; |
3557 | if(vx < 1e-4 && | 3512 | if(vx < 1e-4 && vy < 1e-4 && vz < 1e-4 && |
3558 | vy < 1e-4 && | ||
3559 | vz < 1e-4 && | ||
3560 | ( | 3513 | ( |
3561 | Math.Abs(m_lastVelocity.X) > 1e-4 || | 3514 | Math.Abs(m_lastVelocity.X) > 1e-4 || |
3562 | Math.Abs(m_lastVelocity.Y) > 1e-4 || | 3515 | Math.Abs(m_lastVelocity.Y) > 1e-4 || |
@@ -4750,10 +4703,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
4750 | 4703 | ||
4751 | AggregateInnerPerms(); | 4704 | AggregateInnerPerms(); |
4752 | 4705 | ||
4753 | if (OwnerMask != prevOwnerMask || | 4706 | if (OwnerMask != prevOwnerMask || GroupMask != prevGroupMask || |
4754 | GroupMask != prevGroupMask || | 4707 | EveryoneMask != prevEveryoneMask || NextOwnerMask != prevNextOwnerMask) |
4755 | EveryoneMask != prevEveryoneMask || | ||
4756 | NextOwnerMask != prevNextOwnerMask) | ||
4757 | SendFullUpdateToAllClients(); | 4708 | SendFullUpdateToAllClients(); |
4758 | } | 4709 | } |
4759 | 4710 | ||