aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorUbitUmarov2014-08-16 14:52:09 +0100
committerUbitUmarov2014-08-16 14:52:09 +0100
commitdc178959c5c4e29890e09056e5528e9bf311fe5f (patch)
treebea31fe62b6f34ae2394512dd41c3a77762a1382
parentNextAnimationSequenceNumber be a udpserver variable with random start (diff)
downloadopensim-SC_OLD-dc178959c5c4e29890e09056e5528e9bf311fe5f.zip
opensim-SC_OLD-dc178959c5c4e29890e09056e5528e9bf311fe5f.tar.gz
opensim-SC_OLD-dc178959c5c4e29890e09056e5528e9bf311fe5f.tar.bz2
opensim-SC_OLD-dc178959c5c4e29890e09056e5528e9bf311fe5f.tar.xz
change how avatar data, appearance and animations are sent, specially
the order
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs210
1 files changed, 98 insertions, 112 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 0f67d07..faa5334 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1806,6 +1806,17 @@ namespace OpenSim.Region.Framework.Scenes
1806 look = new Vector3(0.99f, 0.042f, 0); 1806 look = new Vector3(0.99f, 0.042f, 0);
1807 } 1807 }
1808 1808
1809 if (!IsChildAgent)
1810 {
1811 InventoryFolderBase cof = m_scene.InventoryService.GetFolderForType(client.AgentId, (AssetType)46);
1812 if (cof == null)
1813 COF = UUID.Zero;
1814 else
1815 COF = cof.ID;
1816
1817 m_log.DebugFormat("[ScenePresence]: CompleteMovement COF for {0} is {1}", client.AgentId, COF);
1818 }
1819
1809 // Tell the client that we're totally ready 1820 // Tell the client that we're totally ready
1810 ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look); 1821 ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look);
1811 1822
@@ -2776,34 +2787,15 @@ namespace OpenSim.Region.Framework.Scenes
2776 2787
2777 if (satOnObject) 2788 if (satOnObject)
2778 { 2789 {
2779// SendAvatarDataToAllAgents();
2780 m_requestedSitTargetID = 0; 2790 m_requestedSitTargetID = 0;
2781
2782 part.RemoveSittingAvatar(UUID); 2791 part.RemoveSittingAvatar(UUID);
2783
2784 part.ParentGroup.TriggerScriptChangedEvent(Changed.LINK); 2792 part.ParentGroup.TriggerScriptChangedEvent(Changed.LINK);
2785 }
2786 2793
2787 else if (PhysicsActor == null) 2794 SendAvatarDataToAllAgents();
2788 AddToPhysicalScene(false); 2795 }
2789 2796
2790 Animator.TrySetMovementAnimation("STAND"); 2797 Animator.TrySetMovementAnimation("STAND");
2791 2798
2792 if (satOnObject)
2793 {
2794 ILandObject land = m_scene.LandChannel.GetLandObject(AbsolutePosition.X,AbsolutePosition.Y);
2795 if (land != null)
2796 {
2797 UUID parcelID = land.LandData.GlobalID;
2798 if (m_currentParcelUUID != parcelID)
2799 currentParcelUUID = parcelID;
2800 else
2801 SendAvatarDataToAllAgents();
2802 }
2803 else
2804 SendAvatarDataToAllAgents();
2805 }
2806
2807 TriggerScenePresenceUpdated(); 2799 TriggerScenePresenceUpdated();
2808 } 2800 }
2809 2801
@@ -3078,11 +3070,14 @@ namespace OpenSim.Region.Framework.Scenes
3078 3070
3079 ParentPart = part; 3071 ParentPart = part;
3080 ParentID = part.LocalId; 3072 ParentID = part.LocalId;
3073
3074 SendAvatarDataToAllAgents();
3075
3081 if(status == 3) 3076 if(status == 3)
3082 Animator.TrySetMovementAnimation("SIT_GROUND"); 3077 Animator.TrySetMovementAnimation("SIT_GROUND");
3083 else 3078 else
3084 Animator.TrySetMovementAnimation("SIT"); 3079 Animator.TrySetMovementAnimation("SIT");
3085 SendAvatarDataToAllAgents(); 3080
3086 3081
3087 part.ParentGroup.TriggerScriptChangedEvent(Changed.LINK); 3082 part.ParentGroup.TriggerScriptChangedEvent(Changed.LINK);
3088 } 3083 }
@@ -3182,13 +3177,14 @@ namespace OpenSim.Region.Framework.Scenes
3182 Velocity = Vector3.Zero; 3177 Velocity = Vector3.Zero;
3183 RemoveFromPhysicalScene(); 3178 RemoveFromPhysicalScene();
3184 3179
3180 SendAvatarDataToAllAgents();
3181
3185 String sitAnimation = "SIT"; 3182 String sitAnimation = "SIT";
3186 if (!String.IsNullOrEmpty(part.SitAnimation)) 3183 if (!String.IsNullOrEmpty(part.SitAnimation))
3187 { 3184 {
3188 sitAnimation = part.SitAnimation; 3185 sitAnimation = part.SitAnimation;
3189 } 3186 }
3190 Animator.TrySetMovementAnimation(sitAnimation); 3187 Animator.TrySetMovementAnimation(sitAnimation);
3191 SendAvatarDataToAllAgents();
3192 TriggerScenePresenceUpdated(); 3188 TriggerScenePresenceUpdated();
3193 } 3189 }
3194 } 3190 }
@@ -3478,8 +3474,8 @@ namespace OpenSim.Region.Framework.Scenes
3478 landch.sendClientInitialLandInfo(ControllingClient); 3474 landch.sendClientInitialLandInfo(ControllingClient);
3479 } 3475 }
3480 } 3476 }
3481 SendOtherAgentsAvatarDataToMe(); 3477
3482 SendOtherAgentsAppearanceToMe(); 3478 SendOtherAgentsAvatarFullToMe();
3483 3479
3484 EntityBase[] entities = Scene.Entities.GetEntities(); 3480 EntityBase[] entities = Scene.Entities.GetEntities();
3485 foreach (EntityBase e in entities) 3481 foreach (EntityBase e in entities)
@@ -3508,40 +3504,45 @@ namespace OpenSim.Region.Framework.Scenes
3508 // to see if all the baked textures are already here. 3504 // to see if all the baked textures are already here.
3509 if (m_scene.AvatarFactory != null) 3505 if (m_scene.AvatarFactory != null)
3510 cachedappearance = m_scene.AvatarFactory.ValidateBakedTextureCache(this); 3506 cachedappearance = m_scene.AvatarFactory.ValidateBakedTextureCache(this);
3511 3507
3512 // If we aren't using a cached appearance, then clear out the baked textures 3508 // If we aren't using a cached appearance, then clear out the baked textures
3513 if (!cachedappearance) 3509 if (!cachedappearance)
3514 { 3510 {
3515// Appearance.ResetAppearance();
3516// save what ????
3517// maybe needed so the tryretry repair works?
3518 if (m_scene.AvatarFactory != null) 3511 if (m_scene.AvatarFactory != null)
3519 m_scene.AvatarFactory.QueueAppearanceSave(UUID); 3512 m_scene.AvatarFactory.QueueAppearanceSave(UUID);
3520 } 3513 }
3521 3514
3522
3523 // This agent just became root. We are going to tell everyone about it. The process of
3524 // getting other avatars information was initiated elsewhere immediately after the child circuit connected... don't do it
3525 // again here... this comes after the cached appearance check because the avatars
3526 // appearance goes into the avatar update packet
3527 SendAvatarDataToAllAgents(); 3515 SendAvatarDataToAllAgents();
3528
3529 // This invocation always shows up in the viewer logs as an error. Is it needed?
3530 // send all information we have
3531 // possible not needed since viewer should ask about it
3532 // least it all ask for baked
3533 SendAppearanceToAgent(this); 3516 SendAppearanceToAgent(this);
3534 3517
3535 // If we are using the the cached appearance then send it out to everyone 3518// if (cachedappearance)
3536 // send even grays 3519// {
3537 if (cachedappearance) 3520 SendAppearanceToAllOtherAgents();
3521// }
3522 Animator.SendAnimPack();
3523 }
3524
3525 /// <summary>
3526 /// Send avatar full data appearance and animations for all other root agents to this agent, this agent
3527 /// can be either a child or root
3528 /// </summary>
3529 public void SendOtherAgentsAvatarFullToMe()
3530 {
3531 int count = 0;
3532 m_scene.ForEachRootScenePresence(delegate(ScenePresence scenePresence)
3538 { 3533 {
3539// m_log.DebugFormat("[SCENE PRESENCE]: Baked textures are in the cache for {0} in {1}", Name, m_scene.Name); 3534 // only send information about other root agents
3540 // If the avatars baked textures are all in the cache, then we have a 3535 if (scenePresence.UUID == UUID)
3541 // complete appearance... send it out, if not, then we'll send it when 3536 return;
3542 // the avatar finishes updating its appearance 3537
3543 SendAppearanceToAllOtherAgents(); 3538 scenePresence.SendAvatarDataToAgent(this);
3544 } 3539 scenePresence.SendAppearanceToAgent(this);
3540 scenePresence.SendAnimPackToAgent(this);
3541 // for now attachments are sent with all SOG
3542 count++;
3543 });
3544
3545 m_scene.StatsReporter.AddAgentUpdates(count);
3545 } 3546 }
3546 3547
3547 /// <summary> 3548 /// <summary>
@@ -3566,33 +3567,12 @@ namespace OpenSim.Region.Framework.Scenes
3566 3567
3567 m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) 3568 m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence)
3568 { 3569 {
3569 SendAvatarDataToAgent(scenePresence); 3570 SendAvatarDataToAgent(scenePresence);
3570 count++; 3571 count++;
3571 }); 3572 });
3572 3573
3573 m_scene.StatsReporter.AddAgentUpdates(count); 3574 m_scene.StatsReporter.AddAgentUpdates(count);
3574 } 3575 }
3575
3576 /// <summary>
3577 /// Send avatar data for all other root agents to this agent, this agent
3578 /// can be either a child or root
3579 /// </summary>
3580 public void SendOtherAgentsAvatarDataToMe()
3581 {
3582 int count = 0;
3583
3584 m_scene.ForEachRootScenePresence(delegate(ScenePresence scenePresence)
3585 {
3586 // only send information about other root agents
3587 if (scenePresence.UUID == UUID)
3588 return;
3589
3590 scenePresence.SendAvatarDataToAgent(this);
3591 count++;
3592 });
3593
3594 m_scene.StatsReporter.AddAgentUpdates(count);
3595 }
3596 3576
3597 /// <summary> 3577 /// <summary>
3598 /// Send avatar data to an agent. 3578 /// Send avatar data to an agent.
@@ -3604,7 +3584,6 @@ namespace OpenSim.Region.Framework.Scenes
3604 if (ParcelHideThisAvatar && currentParcelUUID != avatar.currentParcelUUID && avatar.GodLevel < 200) 3584 if (ParcelHideThisAvatar && currentParcelUUID != avatar.currentParcelUUID && avatar.GodLevel < 200)
3605 return; 3585 return;
3606 avatar.ControllingClient.SendAvatarDataImmediate(this); 3586 avatar.ControllingClient.SendAvatarDataImmediate(this);
3607 Animator.SendAnimPackToClient(avatar.ControllingClient);
3608 } 3587 }
3609 3588
3610 /// <summary> 3589 /// <summary>
@@ -3639,28 +3618,6 @@ namespace OpenSim.Region.Framework.Scenes
3639 } 3618 }
3640 3619
3641 /// <summary> 3620 /// <summary>
3642 /// Send appearance from all other root agents to this agent. this agent
3643 /// can be either root or child
3644 /// </summary>
3645 public void SendOtherAgentsAppearanceToMe()
3646 {
3647// m_log.DebugFormat("[SCENE PRESENCE] SendOtherAgentsAppearanceToMe: {0} {1}", Name, UUID);
3648
3649 int count = 0;
3650 m_scene.ForEachRootScenePresence(delegate(ScenePresence scenePresence)
3651 {
3652 // only send information about other root agents
3653 if (scenePresence.UUID == UUID)
3654 return;
3655
3656 scenePresence.SendAppearanceToAgent(this);
3657 count++;
3658 });
3659
3660 m_scene.StatsReporter.AddAgentUpdates(count);
3661 }
3662
3663 /// <summary>
3664 /// Send appearance data to an agent. 3621 /// Send appearance data to an agent.
3665 /// </summary> 3622 /// </summary>
3666 /// <param name="avatar"></param> 3623 /// <param name="avatar"></param>
@@ -3674,6 +3631,30 @@ namespace OpenSim.Region.Framework.Scenes
3674 UUID, Appearance.VisualParams, Appearance.Texture.GetBytes()); 3631 UUID, Appearance.VisualParams, Appearance.Texture.GetBytes());
3675 } 3632 }
3676 3633
3634 public void SendAnimPackToAgent(ScenePresence p)
3635 {
3636 if (IsChildAgent || Animator == null)
3637 return;
3638
3639 if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200)
3640 return;
3641
3642 Animator.SendAnimPackToClient(p.ControllingClient);
3643 }
3644
3645 public void SendAnimPack(UUID[] animations, int[] seqs, UUID[] objectIDs)
3646 {
3647 if (IsChildAgent)
3648 return;
3649
3650 m_scene.ForEachScenePresence(delegate(ScenePresence p)
3651 {
3652 if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200)
3653 return;
3654 p.ControllingClient.SendAnimations(animations, seqs, ControllingClient.AgentId, objectIDs);
3655 });
3656 }
3657
3677 #endregion 3658 #endregion
3678 3659
3679 #region Significant Movement Method 3660 #region Significant Movement Method
@@ -4193,13 +4174,15 @@ namespace OpenSim.Region.Framework.Scenes
4193 } 4174 }
4194 catch { } 4175 catch { }
4195 4176
4177 Animator.ResetAnimations();
4178
4196 // FIXME: Why is this null check necessary? Where are the cases where we get a null Anims object? 4179 // FIXME: Why is this null check necessary? Where are the cases where we get a null Anims object?
4197 if (cAgent.Anims != null)
4198 Animator.Animations.FromArray(cAgent.Anims);
4199 if (cAgent.DefaultAnim != null) 4180 if (cAgent.DefaultAnim != null)
4200 Animator.Animations.SetDefaultAnimation(cAgent.DefaultAnim.AnimID, cAgent.DefaultAnim.SequenceNum, UUID.Zero); 4181 Animator.Animations.SetDefaultAnimation(cAgent.DefaultAnim.AnimID, cAgent.DefaultAnim.SequenceNum, UUID.Zero);
4201 if (cAgent.AnimState != null) 4182 if (cAgent.AnimState != null)
4202 Animator.Animations.SetImplicitDefaultAnimation(cAgent.AnimState.AnimID, cAgent.AnimState.SequenceNum, UUID.Zero); 4183 Animator.Animations.SetImplicitDefaultAnimation(cAgent.AnimState.AnimID, cAgent.AnimState.SequenceNum, UUID.Zero);
4184 if (cAgent.Anims != null)
4185 Animator.Animations.FromArray(cAgent.Anims);
4203 4186
4204 if (Scene.AttachmentsModule != null) 4187 if (Scene.AttachmentsModule != null)
4205 Scene.AttachmentsModule.CopyAttachments(cAgent, this); 4188 Scene.AttachmentsModule.CopyAttachments(cAgent, this);
@@ -5442,6 +5425,7 @@ namespace OpenSim.Region.Framework.Scenes
5442 p.SendAttachmentsToClient(ControllingClient); 5425 p.SendAttachmentsToClient(ControllingClient);
5443 if (p.Animator != null) 5426 if (p.Animator != null)
5444 p.Animator.SendAnimPackToClient(ControllingClient); 5427 p.Animator.SendAnimPackToClient(ControllingClient);
5428
5445 } 5429 }
5446 } 5430 }
5447 } 5431 }
@@ -5597,36 +5581,37 @@ namespace OpenSim.Region.Framework.Scenes
5597 if (GodLevel >= 200) 5581 if (GodLevel >= 200)
5598 return; 5582 return;
5599 5583
5600 List<ScenePresence> killsToSendme = new List<ScenePresence>(); 5584 List<uint> killsToSendme = new List<uint>();
5601 foreach (ScenePresence p in allpresences) 5585 foreach (ScenePresence p in allpresences)
5602 { 5586 {
5603 if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive) 5587 if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive)
5604 continue; 5588 continue;
5605 5589
5606 if (p.currentParcelUUID == m_currentParcelUUID) 5590 if (p.currentParcelUUID == m_currentParcelUUID)
5607 { 5591 {
5608 killsToSendme.Add(p); 5592 m_log.Debug("[AVATAR]: killMe: " + Lastname + " " + p.Lastname);
5593 killsToSendme.Add(p.LocalId);
5609 } 5594 }
5610 } 5595 }
5611 5596
5612 if (killsToSendme.Count > 0) 5597 if (killsToSendme.Count > 0)
5613 { 5598 {
5614 foreach (ScenePresence p in killsToSendme) 5599 try
5615 { 5600 {
5616 m_log.Debug("[AVATAR]: killMe: " + Lastname + " " + p.Lastname); 5601 ControllingClient.SendKillObject(killsToSendme);
5617 try { ControllingClient.SendKillObject(new List<uint> { p.LocalId }); }
5618 catch (NullReferenceException) { }
5619 } 5602 }
5603 catch (NullReferenceException) { }
5620 } 5604 }
5605
5606
5621 } 5607 }
5622 } 5608 }
5623
5624 5609
5625 private void ParcelCrossCheck(UUID currentParcelID,UUID previusParcelID, 5610 private void ParcelCrossCheck(UUID currentParcelID,UUID previusParcelID,
5626 bool currentParcelHide, bool previusParcelHide, bool oldhide,bool check) 5611 bool currentParcelHide, bool previusParcelHide, bool oldhide,bool check)
5627 { 5612 {
5628 List<ScenePresence> killsToSendto = new List<ScenePresence>(); 5613 List<ScenePresence> killsToSendto = new List<ScenePresence>();
5629 List<ScenePresence> killsToSendme = new List<ScenePresence>(); 5614 List<uint> killsToSendme = new List<uint>();
5630 List<ScenePresence> viewsToSendto = new List<ScenePresence>(); 5615 List<ScenePresence> viewsToSendto = new List<ScenePresence>();
5631 List<ScenePresence> viewsToSendme = new List<ScenePresence>(); 5616 List<ScenePresence> viewsToSendme = new List<ScenePresence>();
5632 List<ScenePresence> allpresences = null; 5617 List<ScenePresence> allpresences = null;
@@ -5697,7 +5682,7 @@ namespace OpenSim.Region.Framework.Scenes
5697 if(p.GodLevel < 200) 5682 if(p.GodLevel < 200)
5698 killsToSendto.Add(p); // they dont see me 5683 killsToSendto.Add(p); // they dont see me
5699 if(GodLevel < 200) 5684 if(GodLevel < 200)
5700 killsToSendme.Add(p); // i dont see them 5685 killsToSendme.Add(p.LocalId); // i dont see them
5701 } 5686 }
5702 // only those on new parcel need see 5687 // only those on new parcel need see
5703 if (currentParcelID == p.currentParcelUUID) 5688 if (currentParcelID == p.currentParcelUUID)
@@ -5746,7 +5731,7 @@ namespace OpenSim.Region.Framework.Scenes
5746 // only those old parcel need receive kills 5731 // only those old parcel need receive kills
5747 if (previusParcelID == p.currentParcelUUID && GodLevel < 200) 5732 if (previusParcelID == p.currentParcelUUID && GodLevel < 200)
5748 { 5733 {
5749 killsToSendme.Add(p); // i dont see them 5734 killsToSendme.Add(p.LocalId); // i dont see them
5750 } 5735 }
5751 else 5736 else
5752 { 5737 {
@@ -5771,14 +5756,15 @@ namespace OpenSim.Region.Framework.Scenes
5771 } 5756 }
5772 } 5757 }
5773 5758
5774 if (killsToSendme.Count > 0 ) 5759 if (killsToSendme.Count > 0)
5775 { 5760 {
5776 foreach (ScenePresence p in killsToSendme) 5761 m_log.Debug("[AVATAR]: killtoMe: " + Lastname + " " + killsToSendme.Count.ToString());
5762 try
5777 { 5763 {
5778 m_log.Debug("[AVATAR]: killMe: " + Lastname + " " + p.Lastname); 5764 ControllingClient.SendKillObject(killsToSendme);
5779 try {ControllingClient.SendKillObject(new List<uint> { p.LocalId }); }
5780 catch (NullReferenceException) { }
5781 } 5765 }
5766 catch (NullReferenceException) { }
5767
5782 } 5768 }
5783 5769
5784 if (viewsToSendto.Count > 0 && PresenceType != PresenceType.Npc) 5770 if (viewsToSendto.Count > 0 && PresenceType != PresenceType.Npc)