aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs2
-rwxr-xr-xOpenSim/Region/Framework/Scenes/SceneGraph.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs67
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs103
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs71
5 files changed, 54 insertions, 191 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
index 04605a2..0c080d2 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
@@ -156,7 +156,7 @@ namespace OpenSim.Region.Framework.Scenes
156 SceneObjectGroup sog = GetGroupByPrim(primLocalID); 156 SceneObjectGroup sog = GetGroupByPrim(primLocalID);
157 157
158 if (sog != null) 158 if (sog != null)
159 sog.SendFullUpdateToClient(remoteClient); 159 sog.SendFullAnimUpdateToClient(remoteClient);
160 } 160 }
161 161
162 /// <summary> 162 /// <summary>
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 68864cc..6ba9d7a 100755
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -626,6 +626,8 @@ namespace OpenSim.Region.Framework.Scenes
626 for (int i = 0; i < updates.Count; i++) 626 for (int i = 0; i < updates.Count; i++)
627 { 627 {
628 SceneObjectGroup sog = updates[i]; 628 SceneObjectGroup sog = updates[i];
629 if (sog.IsDeleted)
630 continue;
629 631
630 // Don't abort the whole update if one entity happens to give us an exception. 632 // Don't abort the whole update if one entity happens to give us an exception.
631 try 633 try
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index b5c8cf2..080faeb 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2506,24 +2506,6 @@ namespace OpenSim.Region.Framework.Scenes
2506 // don't backup while it's selected or you're asking for changes mid stream. 2506 // don't backup while it's selected or you're asking for changes mid stream.
2507 if (isTimeToPersist() || forcedBackup) 2507 if (isTimeToPersist() || forcedBackup)
2508 { 2508 {
2509 if (m_rootPart.PhysActor != null &&
2510 (!m_rootPart.PhysActor.IsPhysical))
2511 {
2512 // Possible ghost prim
2513 if (m_rootPart.PhysActor.Position != m_rootPart.GroupPosition)
2514 {
2515 foreach (SceneObjectPart part in m_parts.GetArray())
2516 {
2517 // Re-set physics actor positions and
2518 // orientations
2519 part.GroupPosition = m_rootPart.GroupPosition;
2520 }
2521 }
2522 }
2523// m_log.DebugFormat(
2524// "[SCENE]: Storing {0}, {1} in {2}",
2525// Name, UUID, m_scene.RegionInfo.RegionName);
2526
2527 if (RootPart.Shape.PCode == 9 && RootPart.Shape.State != 0) 2509 if (RootPart.Shape.PCode == 9 && RootPart.Shape.State != 0)
2528 { 2510 {
2529 RootPart.Shape.LastAttachPoint = RootPart.Shape.State; 2511 RootPart.Shape.LastAttachPoint = RootPart.Shape.State;
@@ -2557,12 +2539,6 @@ namespace OpenSim.Region.Framework.Scenes
2557 backup_group.Clear(); 2539 backup_group.Clear();
2558 backup_group = null; 2540 backup_group = null;
2559 } 2541 }
2560// else
2561// {
2562// m_log.DebugFormat(
2563// "[SCENE]: Did not update persistence of object {0} {1}, selected = {2}",
2564// Name, UUID, IsSelected);
2565// }
2566 } 2542 }
2567 } 2543 }
2568 catch (Exception e) 2544 catch (Exception e)
@@ -2582,35 +2558,20 @@ namespace OpenSim.Region.Framework.Scenes
2582 /// Used when the client initially connects and when client sends RequestPrim packet 2558 /// Used when the client initially connects and when client sends RequestPrim packet
2583 /// </remarks> 2559 /// </remarks>
2584 /// <param name="remoteClient"></param> 2560 /// <param name="remoteClient"></param>
2585 public void SendFullUpdateToClient(IClientAPI remoteClient)
2586 {
2587 PrimUpdateFlags update = PrimUpdateFlags.FullUpdate;
2588
2589 RootPart.SendFullUpdate(remoteClient, update);
2590
2591 SceneObjectPart[] parts = m_parts.GetArray();
2592 for (int i = 0; i < parts.Length; i++)
2593 {
2594 SceneObjectPart part = parts[i];
2595 if (part != RootPart)
2596 part.SendFullUpdate(remoteClient, update);
2597 }
2598 }
2599
2600 public void SendFullAnimUpdateToClient(IClientAPI remoteClient) 2561 public void SendFullAnimUpdateToClient(IClientAPI remoteClient)
2601 { 2562 {
2602 PrimUpdateFlags update = PrimUpdateFlags.FullUpdate; 2563 PrimUpdateFlags update = PrimUpdateFlags.FullUpdate;
2603 if (RootPart.Shape.MeshFlagEntry) 2564 if (RootPart.Shape.MeshFlagEntry)
2604 update = PrimUpdateFlags.FullUpdatewithAnim; 2565 update = PrimUpdateFlags.FullUpdatewithAnim;
2605 2566
2606 RootPart.SendFullUpdate(remoteClient, update); 2567 RootPart.SendUpdate(remoteClient, update);
2607 2568
2608 SceneObjectPart[] parts = m_parts.GetArray(); 2569 SceneObjectPart[] parts = m_parts.GetArray();
2609 for (int i = 0; i < parts.Length; i++) 2570 for (int i = 0; i < parts.Length; i++)
2610 { 2571 {
2611 SceneObjectPart part = parts[i]; 2572 SceneObjectPart part = parts[i];
2612 if (part != RootPart) 2573 if (part != RootPart)
2613 part.SendFullUpdate(remoteClient, update); 2574 part.SendUpdate(remoteClient, update);
2614 } 2575 }
2615 } 2576 }
2616 2577
@@ -3033,28 +2994,13 @@ namespace OpenSim.Region.Framework.Scenes
3033 // the race conditions. 2994 // the race conditions.
3034 if (IsDeleted || inTransit) 2995 if (IsDeleted || inTransit)
3035 return; 2996 return;
3036 2997
3037 // Even temporary objects take part in physics (e.g. temp-on-rez bullets)
3038 //if ((RootPart.Flags & PrimFlags.TemporaryOnRez) != 0)
3039 // return;
3040
3041 // If we somehow got here to updating the SOG and its root part is not scheduled for update,
3042 // check to see if the physical position or rotation warrant an update.
3043/*
3044 if (m_rootPart.UpdateFlag == UpdateRequired.NONE)
3045 {
3046 // rootpart SendScheduledUpdates will check if a update is needed
3047 m_rootPart.UpdateFlag = UpdateRequired.TERSE;
3048 }
3049*/
3050 if (IsAttachment) 2998 if (IsAttachment)
3051 { 2999 {
3052 ScenePresence sp = m_scene.GetScenePresence(AttachedAvatar); 3000 ScenePresence sp = m_scene.GetScenePresence(AttachedAvatar);
3053 if (sp != null) 3001 if (sp != null)
3054 {
3055 sp.SendAttachmentScheduleUpdate(this); 3002 sp.SendAttachmentScheduleUpdate(this);
3056 return; 3003 return;
3057 }
3058 } 3004 }
3059 3005
3060 // while physics doesn't suports LookAt, we do it in RootPart 3006 // while physics doesn't suports LookAt, we do it in RootPart
@@ -3134,13 +3080,13 @@ namespace OpenSim.Region.Framework.Scenes
3134 } 3080 }
3135 } 3081 }
3136 3082
3137 RootPart.SendFullUpdateToAllClientsInternal(); 3083 RootPart.SendFullUpdateToAllClientsNoAttachment();
3138 SceneObjectPart[] parts = m_parts.GetArray(); 3084 SceneObjectPart[] parts = m_parts.GetArray();
3139 for (int i = 0; i < parts.Length; i++) 3085 for (int i = 0; i < parts.Length; i++)
3140 { 3086 {
3141 SceneObjectPart part = parts[i]; 3087 SceneObjectPart part = parts[i];
3142 if (part != RootPart) 3088 if (part != RootPart)
3143 part.SendFullUpdateToAllClientsInternal(); 3089 part.SendFullUpdateToAllClientsNoAttachment();
3144 } 3090 }
3145 } 3091 }
3146 3092
@@ -5465,7 +5411,6 @@ namespace OpenSim.Region.Framework.Scenes
5465 private string GetLinkNumber_lastname; 5411 private string GetLinkNumber_lastname;
5466 private int GetLinkNumber_lastnumber; 5412 private int GetLinkNumber_lastnumber;
5467 5413
5468 // this scales bad but so does GetLinkNumPart
5469 public int GetLinkNumber(string name) 5414 public int GetLinkNumber(string name)
5470 { 5415 {
5471 if(String.IsNullOrEmpty(name) || name == "Object" || name == "Primitive") 5416 if(String.IsNullOrEmpty(name) || name == "Object" || name == "Primitive")
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
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index a308abb..5bd1cf1 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2168,11 +2168,6 @@ namespace OpenSim.Region.Framework.Scenes
2168 { 2168 {
2169 if( ParentPart != null && !IsNPC && (crossingFlags & 0x08) != 0) 2169 if( ParentPart != null && !IsNPC && (crossingFlags & 0x08) != 0)
2170 { 2170 {
2171
2172// SceneObjectPart root = ParentPart.ParentGroup.RootPart;
2173// if(root.LocalId != ParentPart.LocalId)
2174// ControllingClient.SendEntityTerseUpdateImmediate(root);
2175// ControllingClient.SendEntityTerseUpdateImmediate(ParentPart);
2176 ParentPart.ParentGroup.SendFullAnimUpdateToClient(ControllingClient); 2171 ParentPart.ParentGroup.SendFullAnimUpdateToClient(ControllingClient);
2177 } 2172 }
2178 2173
@@ -5439,35 +5434,34 @@ namespace OpenSim.Region.Framework.Scenes
5439 PrimUpdateFlags[] flags = new PrimUpdateFlags[origparts.Length]; 5434 PrimUpdateFlags[] flags = new PrimUpdateFlags[origparts.Length];
5440 5435
5441 SceneObjectPart rootpart = sog.RootPart; 5436 SceneObjectPart rootpart = sog.RootPart;
5442 PrimUpdateFlags rootreq = sog.RootPart.GetAndClearUpdateFlag(); 5437 PrimUpdateFlags cur = sog.RootPart.GetAndClearUpdateFlag();
5443 5438
5444 int j = 0; 5439 int nparts = 0;
5440 if (cur != PrimUpdateFlags.None)
5441 {
5442 flags[nparts] = cur;
5443 parts[nparts] = rootpart;
5444 ++nparts;
5445 }
5445 5446
5446 PrimUpdateFlags cur;
5447 for (int i = 0; i < origparts.Length; i++) 5447 for (int i = 0; i < origparts.Length; i++)
5448 { 5448 {
5449 if (origparts[i] != rootpart) 5449 if (origparts[i] == rootpart)
5450 { 5450 continue;
5451 cur = origparts[i].GetAndClearUpdateFlag(); 5451
5452 if(cur == PrimUpdateFlags.None) 5452 cur = origparts[i].GetAndClearUpdateFlag();
5453 continue; 5453 if(cur == PrimUpdateFlags.None)
5454 flags[j] = cur; 5454 continue;
5455 parts[j] = origparts[i]; 5455 flags[nparts] = cur;
5456 j++; 5456 parts[nparts] = origparts[i];
5457 } 5457 ++nparts;
5458 } 5458 }
5459 5459
5460 if (j == 0 && rootreq == PrimUpdateFlags.None) 5460 if (nparts == 0)
5461 return; 5461 return;
5462 5462
5463 int nparts = j;
5464
5465 ControllingClient.SendEntityUpdate(rootpart, rootreq);
5466
5467 for (int i = 0; i < nparts; i++) 5463 for (int i = 0; i < nparts; i++)
5468 {
5469 ControllingClient.SendEntityUpdate(parts[i], flags[i]); 5464 ControllingClient.SendEntityUpdate(parts[i], flags[i]);
5470 }
5471 5465
5472 if (sog.HasPrivateAttachmentPoint) 5466 if (sog.HasPrivateAttachmentPoint)
5473 return; 5467 return;
@@ -5481,12 +5475,8 @@ namespace OpenSim.Region.Framework.Scenes
5481 if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod) 5475 if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod)
5482 continue; 5476 continue;
5483 5477
5484 p.ControllingClient.SendEntityUpdate(rootpart, rootreq);
5485
5486 for (int i = 0; i < nparts; i++) 5478 for (int i = 0; i < nparts; i++)
5487 {
5488 p.ControllingClient.SendEntityUpdate(parts[i], flags[i]); 5479 p.ControllingClient.SendEntityUpdate(parts[i], flags[i]);
5489 }
5490 } 5480 }
5491 } 5481 }
5492 5482
@@ -5532,31 +5522,6 @@ namespace OpenSim.Region.Framework.Scenes
5532 } 5522 }
5533 } 5523 }
5534 5524
5535 public void SendAttachmentScheduleUpdate(SceneObjectPart part)
5536 {
5537 if (IsChildAgent || IsInTransit)
5538 return;
5539
5540 PrimUpdateFlags flag = part.GetAndClearUpdateFlag();
5541
5542 ControllingClient.SendEntityUpdate(part, flag);
5543
5544 if (part.ParentGroup.HasPrivateAttachmentPoint)
5545 return;
5546
5547 List<ScenePresence> allPresences = m_scene.GetScenePresences();
5548 foreach (ScenePresence p in allPresences)
5549 {
5550 if (p == this)
5551 continue;
5552
5553 if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod)
5554 continue;
5555
5556 p.ControllingClient.SendEntityUpdate(part, flag);
5557 }
5558 }
5559
5560 public void SendAttachmentUpdate(SceneObjectPart part, PrimUpdateFlags flag) 5525 public void SendAttachmentUpdate(SceneObjectPart part, PrimUpdateFlags flag)
5561 { 5526 {
5562 if (IsChildAgent || IsInTransit) 5527 if (IsChildAgent || IsInTransit)