aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMelanie Thielker2009-02-17 04:16:42 +0000
committerMelanie Thielker2009-02-17 04:16:42 +0000
commit31307849342c36c133b5cb8039296116c5456136 (patch)
tree1922584dea8426a8d81873d4d68b552e9761add2 /OpenSim
parentSmall change on dealing with ODE physics, so that this warning doesn't happen... (diff)
downloadopensim-SC-31307849342c36c133b5cb8039296116c5456136.zip
opensim-SC-31307849342c36c133b5cb8039296116c5456136.tar.gz
opensim-SC-31307849342c36c133b5cb8039296116c5456136.tar.bz2
opensim-SC-31307849342c36c133b5cb8039296116c5456136.tar.xz
Re-add the objectID field to the anim pack, that was deemed unneccessary
and dropped nonths ago, because it is required to get smooth region crossings with AO running. Without it, in some corner cases, anims will continue to run in an unstoppable state.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/IClientAPI.cs2
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs11
-rw-r--r--OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Animation.cs10
-rw-r--r--OpenSim/Region/Framework/Scenes/AnimationSet.cs18
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs29
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs2
-rw-r--r--OpenSim/Tests/Common/Mock/TestClient.cs2
10 files changed, 49 insertions, 33 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 759059f..673810e 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -794,7 +794,7 @@ namespace OpenSim.Framework
794 /// <param name="localID"></param> 794 /// <param name="localID"></param>
795 void SendKillObject(ulong regionHandle, uint localID); 795 void SendKillObject(ulong regionHandle, uint localID);
796 796
797 void SendAnimations(UUID[] animID, int[] seqs, UUID sourceAgentId); 797 void SendAnimations(UUID[] animID, int[] seqs, UUID sourceAgentId, UUID[] objectIDs);
798 void SendRegionHandshake(RegionInfo regionInfo, RegionHandshakeArgs args); 798 void SendRegionHandshake(RegionInfo regionInfo, RegionHandshakeArgs args);
799 799
800 void SendChatMessage(string message, byte type, Vector3 fromPos, string fromName, UUID fromAgentID, byte source, 800 void SendChatMessage(string message, byte type, Vector3 fromPos, string fromName, UUID fromAgentID, byte source,
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index dd0f6ac..3565e5a 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -2493,15 +2493,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2493 OutPacket(avp, ThrottleOutPacketType.Task); 2493 OutPacket(avp, ThrottleOutPacketType.Task);
2494 } 2494 }
2495 2495
2496 public void SendAnimations(UUID[] animations, int[] seqs, UUID sourceAgentId) 2496 public void SendAnimations(UUID[] animations, int[] seqs, UUID sourceAgentId, UUID[] objectIDs)
2497 { 2497 {
2498 //m_log.DebugFormat("[CLIENT]: Sending animations to {0}", Name); 2498 //m_log.DebugFormat("[CLIENT]: Sending animations to {0}", Name);
2499 2499
2500 AvatarAnimationPacket ani = (AvatarAnimationPacket)PacketPool.Instance.GetPacket(PacketType.AvatarAnimation); 2500 AvatarAnimationPacket ani = (AvatarAnimationPacket)PacketPool.Instance.GetPacket(PacketType.AvatarAnimation);
2501 // TODO: don't create new blocks if recycling an old packet 2501 // TODO: don't create new blocks if recycling an old packet
2502 ani.AnimationSourceList = new AvatarAnimationPacket.AnimationSourceListBlock[1]; 2502 ani.AnimationSourceList = new AvatarAnimationPacket.AnimationSourceListBlock[animations.Length];
2503 ani.AnimationSourceList[0] = new AvatarAnimationPacket.AnimationSourceListBlock();
2504 ani.AnimationSourceList[0].ObjectID = sourceAgentId;
2505 ani.Sender = new AvatarAnimationPacket.SenderBlock(); 2503 ani.Sender = new AvatarAnimationPacket.SenderBlock();
2506 ani.Sender.ID = sourceAgentId; 2504 ani.Sender.ID = sourceAgentId;
2507 ani.AnimationList = new AvatarAnimationPacket.AnimationListBlock[animations.Length]; 2505 ani.AnimationList = new AvatarAnimationPacket.AnimationListBlock[animations.Length];
@@ -2511,6 +2509,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2511 ani.AnimationList[i] = new AvatarAnimationPacket.AnimationListBlock(); 2509 ani.AnimationList[i] = new AvatarAnimationPacket.AnimationListBlock();
2512 ani.AnimationList[i].AnimID = animations[i]; 2510 ani.AnimationList[i].AnimID = animations[i];
2513 ani.AnimationList[i].AnimSequenceID = seqs[i]; 2511 ani.AnimationList[i].AnimSequenceID = seqs[i];
2512
2513 ani.AnimationSourceList[i] = new AvatarAnimationPacket.AnimationSourceListBlock();
2514 ani.AnimationSourceList[i].ObjectID = objectIDs[i];
2515 if (objectIDs[i] == UUID.Zero)
2516 ani.AnimationSourceList[i].ObjectID = sourceAgentId;
2514 } 2517 }
2515 ani.Header.Reliable = false; 2518 ani.Header.Reliable = false;
2516 OutPacket(ani, ThrottleOutPacketType.Task); 2519 OutPacket(ani, ThrottleOutPacketType.Task);
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
index 1ee4424..4e11759 100644
--- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
@@ -393,7 +393,7 @@ namespace OpenSim.Region.Examples.SimpleModule
393 } 393 }
394 394
395 395
396 public virtual void SendAnimations(UUID[] animations, int[] seqs, UUID sourceAgentId) 396 public virtual void SendAnimations(UUID[] animations, int[] seqs, UUID sourceAgentId, UUID[] objectIDs)
397 { 397 {
398 } 398 }
399 399
diff --git a/OpenSim/Region/Framework/Scenes/Animation.cs b/OpenSim/Region/Framework/Scenes/Animation.cs
index cb0afa7..6f0681c 100644
--- a/OpenSim/Region/Framework/Scenes/Animation.cs
+++ b/OpenSim/Region/Framework/Scenes/Animation.cs
@@ -45,14 +45,22 @@ namespace OpenSim.Region.Framework.Scenes
45 set { sequenceNum = value; } 45 set { sequenceNum = value; }
46 } 46 }
47 47
48 private UUID objectID;
49 public UUID ObjectID
50 {
51 get { return objectID; }
52 set { objectID = value; }
53 }
54
48 public Animation() 55 public Animation()
49 { 56 {
50 } 57 }
51 58
52 public Animation(UUID animID, int sequenceNum) 59 public Animation(UUID animID, int sequenceNum, UUID objectID)
53 { 60 {
54 this.animID = animID; 61 this.animID = animID;
55 this.sequenceNum = sequenceNum; 62 this.sequenceNum = sequenceNum;
63 this.objectID = objectID;
56 } 64 }
57 } 65 }
58} 66}
diff --git a/OpenSim/Region/Framework/Scenes/AnimationSet.cs b/OpenSim/Region/Framework/Scenes/AnimationSet.cs
index 49bcda8..864e599 100644
--- a/OpenSim/Region/Framework/Scenes/AnimationSet.cs
+++ b/OpenSim/Region/Framework/Scenes/AnimationSet.cs
@@ -60,13 +60,13 @@ namespace OpenSim.Region.Framework.Scenes
60 return false; 60 return false;
61 } 61 }
62 62
63 public bool Add(UUID animID, int sequenceNum) 63 public bool Add(UUID animID, int sequenceNum, UUID objectID)
64 { 64 {
65 lock (m_animations) 65 lock (m_animations)
66 { 66 {
67 if (!HasAnimation(animID)) 67 if (!HasAnimation(animID))
68 { 68 {
69 m_animations.Add(new Animation(animID, sequenceNum)); 69 m_animations.Add(new Animation(animID, sequenceNum, objectID));
70 return true; 70 return true;
71 } 71 }
72 } 72 }
@@ -106,11 +106,11 @@ namespace OpenSim.Region.Framework.Scenes
106 /// The default animation is reserved for "main" animations 106 /// The default animation is reserved for "main" animations
107 /// that are mutually exclusive, e.g. flying and sitting. 107 /// that are mutually exclusive, e.g. flying and sitting.
108 /// </summary> 108 /// </summary>
109 public bool SetDefaultAnimation(UUID animID, int sequenceNum) 109 public bool SetDefaultAnimation(UUID animID, int sequenceNum, UUID objectID)
110 { 110 {
111 if (m_defaultAnimation.AnimID != animID) 111 if (m_defaultAnimation.AnimID != animID)
112 { 112 {
113 m_defaultAnimation = new Animation(animID, sequenceNum); 113 m_defaultAnimation = new Animation(animID, sequenceNum, objectID);
114 return true; 114 return true;
115 } 115 }
116 return false; 116 return false;
@@ -118,27 +118,28 @@ namespace OpenSim.Region.Framework.Scenes
118 118
119 protected bool ResetDefaultAnimation() 119 protected bool ResetDefaultAnimation()
120 { 120 {
121 return TrySetDefaultAnimation("STAND", 1); 121 return TrySetDefaultAnimation("STAND", 1, UUID.Zero);
122 } 122 }
123 123
124 /// <summary> 124 /// <summary>
125 /// Set the animation as the default animation if it's known 125 /// Set the animation as the default animation if it's known
126 /// </summary> 126 /// </summary>
127 public bool TrySetDefaultAnimation(string anim, int sequenceNum) 127 public bool TrySetDefaultAnimation(string anim, int sequenceNum, UUID objectID)
128 { 128 {
129 if (Animations.AnimsUUID.ContainsKey(anim)) 129 if (Animations.AnimsUUID.ContainsKey(anim))
130 { 130 {
131 return SetDefaultAnimation(Animations.AnimsUUID[anim], sequenceNum); 131 return SetDefaultAnimation(Animations.AnimsUUID[anim], sequenceNum, objectID);
132 } 132 }
133 return false; 133 return false;
134 } 134 }
135 135
136 public void GetArrays(out UUID[] animIDs, out int[] sequenceNums) 136 public void GetArrays(out UUID[] animIDs, out int[] sequenceNums, out UUID[] objectIDs)
137 { 137 {
138 lock (m_animations) 138 lock (m_animations)
139 { 139 {
140 animIDs = new UUID[m_animations.Count + 1]; 140 animIDs = new UUID[m_animations.Count + 1];
141 sequenceNums = new int[m_animations.Count + 1]; 141 sequenceNums = new int[m_animations.Count + 1];
142 objectIDs = new UUID[m_animations.Count + 1];
142 143
143 animIDs[0] = m_defaultAnimation.AnimID; 144 animIDs[0] = m_defaultAnimation.AnimID;
144 sequenceNums[0] = m_defaultAnimation.SequenceNum; 145 sequenceNums[0] = m_defaultAnimation.SequenceNum;
@@ -147,6 +148,7 @@ namespace OpenSim.Region.Framework.Scenes
147 { 148 {
148 animIDs[i + 1] = m_animations[i].AnimID; 149 animIDs[i + 1] = m_animations[i].AnimID;
149 sequenceNums[i + 1] = m_animations[i].SequenceNum; 150 sequenceNums[i + 1] = m_animations[i].SequenceNum;
151 objectIDs[i + i] = m_animations[i].ObjectID;
150 } 152 }
151 } 153 }
152 } 154 }
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index fc3166a..a488f59 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1754,18 +1754,18 @@ namespace OpenSim.Region.Framework.Scenes
1754 } 1754 }
1755 } 1755 }
1756 1756
1757 public void AddAnimation(UUID animID) 1757 public void AddAnimation(UUID animID, UUID objectID)
1758 { 1758 {
1759 if (m_isChildAgent) 1759 if (m_isChildAgent)
1760 return; 1760 return;
1761 1761
1762 if (m_animations.Add(animID, m_controllingClient.NextAnimationSequenceNumber)) 1762 if (m_animations.Add(animID, m_controllingClient.NextAnimationSequenceNumber, objectID))
1763 { 1763 {
1764 SendAnimPack(); 1764 SendAnimPack();
1765 } 1765 }
1766 } 1766 }
1767 1767
1768 public void AddAnimation(string name) 1768 public void AddAnimation(string name, UUID objectID)
1769 { 1769 {
1770 if (m_isChildAgent) 1770 if (m_isChildAgent)
1771 return; 1771 return;
@@ -1774,7 +1774,7 @@ namespace OpenSim.Region.Framework.Scenes
1774 if (animID == UUID.Zero) 1774 if (animID == UUID.Zero)
1775 return; 1775 return;
1776 1776
1777 AddAnimation(animID); 1777 AddAnimation(animID, objectID);
1778 } 1778 }
1779 1779
1780 public void RemoveAnimation(UUID animID) 1780 public void RemoveAnimation(UUID animID)
@@ -1804,13 +1804,14 @@ namespace OpenSim.Region.Framework.Scenes
1804 { 1804 {
1805 UUID[] animIDs; 1805 UUID[] animIDs;
1806 int[] sequenceNums; 1806 int[] sequenceNums;
1807 m_animations.GetArrays( out animIDs, out sequenceNums ); 1807 UUID[] objectIDs;
1808 m_animations.GetArrays( out animIDs, out sequenceNums, out objectIDs);
1808 return animIDs; 1809 return animIDs;
1809 } 1810 }
1810 1811
1811 public void HandleStartAnim(IClientAPI remoteClient, UUID animID) 1812 public void HandleStartAnim(IClientAPI remoteClient, UUID animID)
1812 { 1813 {
1813 AddAnimation(animID); 1814 AddAnimation(animID, UUID.Zero);
1814 } 1815 }
1815 1816
1816 public void HandleStopAnim(IClientAPI remoteClient, UUID animID) 1817 public void HandleStopAnim(IClientAPI remoteClient, UUID animID)
@@ -1826,7 +1827,7 @@ namespace OpenSim.Region.Framework.Scenes
1826 { 1827 {
1827 //m_log.DebugFormat("Updating movement animation to {0}", anim); 1828 //m_log.DebugFormat("Updating movement animation to {0}", anim);
1828 1829
1829 if (m_animations.TrySetDefaultAnimation(anim, m_controllingClient.NextAnimationSequenceNumber)) 1830 if (m_animations.TrySetDefaultAnimation(anim, m_controllingClient.NextAnimationSequenceNumber, UUID.Zero))
1830 { 1831 {
1831 SendAnimPack(); 1832 SendAnimPack();
1832 } 1833 }
@@ -2284,13 +2285,13 @@ namespace OpenSim.Region.Framework.Scenes
2284 /// </summary> 2285 /// </summary>
2285 /// <param name="animations"></param> 2286 /// <param name="animations"></param>
2286 /// <param name="seqs"></param> 2287 /// <param name="seqs"></param>
2287 public void SendAnimPack(UUID[] animations, int[] seqs) 2288 public void SendAnimPack(UUID[] animations, int[] seqs, UUID[] objectIDs)
2288 { 2289 {
2289 if (m_isChildAgent) 2290 if (m_isChildAgent)
2290 return; 2291 return;
2291 2292
2292 m_scene.Broadcast( 2293 m_scene.Broadcast(
2293 delegate(IClientAPI client) { client.SendAnimations(animations, seqs, m_controllingClient.AgentId); }); 2294 delegate(IClientAPI client) { client.SendAnimations(animations, seqs, m_controllingClient.AgentId, objectIDs); });
2294 } 2295 }
2295 2296
2296 public void SendAnimPackToClient(IClientAPI client) 2297 public void SendAnimPackToClient(IClientAPI client)
@@ -2299,10 +2300,11 @@ namespace OpenSim.Region.Framework.Scenes
2299 return; 2300 return;
2300 UUID[] animIDs; 2301 UUID[] animIDs;
2301 int[] sequenceNums; 2302 int[] sequenceNums;
2303 UUID[] objectIDs;
2302 2304
2303 m_animations.GetArrays(out animIDs, out sequenceNums); 2305 m_animations.GetArrays(out animIDs, out sequenceNums, out objectIDs);
2304 2306
2305 client.SendAnimations(animIDs, sequenceNums, m_controllingClient.AgentId); 2307 client.SendAnimations(animIDs, sequenceNums, m_controllingClient.AgentId, objectIDs);
2306 } 2308 }
2307 2309
2308 /// <summary> 2310 /// <summary>
@@ -2317,10 +2319,11 @@ namespace OpenSim.Region.Framework.Scenes
2317 2319
2318 UUID[] animIDs; 2320 UUID[] animIDs;
2319 int[] sequenceNums; 2321 int[] sequenceNums;
2322 UUID[] objectIDs;
2320 2323
2321 m_animations.GetArrays(out animIDs, out sequenceNums); 2324 m_animations.GetArrays(out animIDs, out sequenceNums, out objectIDs);
2322 2325
2323 SendAnimPack(animIDs, sequenceNums); 2326 SendAnimPack(animIDs, sequenceNums, objectIDs);
2324 } 2327 }
2325 2328
2326 #endregion 2329 #endregion
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
index 91518e2..c84ede8 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
@@ -482,7 +482,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
482 } 482 }
483 483
484 484
485 public virtual void SendAnimations(UUID[] animations, int[] seqs, UUID sourceAgentId) 485 public virtual void SendAnimations(UUID[] animations, int[] seqs, UUID sourceAgentId, UUID[] objectIDs)
486 { 486 {
487 } 487 }
488 488
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index e5f097f..5f6ea16 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -2854,9 +2854,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2854 // Do NOT try to parse UUID, animations cannot be triggered by ID 2854 // Do NOT try to parse UUID, animations cannot be triggered by ID
2855 UUID animID=InventoryKey(anim, (int)AssetType.Animation); 2855 UUID animID=InventoryKey(anim, (int)AssetType.Animation);
2856 if (animID == UUID.Zero) 2856 if (animID == UUID.Zero)
2857 presence.AddAnimation(anim); 2857 presence.AddAnimation(anim, m_host.UUID);
2858 else 2858 else
2859 presence.AddAnimation(animID); 2859 presence.AddAnimation(animID, m_host.UUID);
2860 } 2860 }
2861 } 2861 }
2862 } 2862 }
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index eeef58b..564648b 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -559,7 +559,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
559 if (World.Entities.ContainsKey((UUID)avatar) && World.Entities[avatarID] is ScenePresence) 559 if (World.Entities.ContainsKey((UUID)avatar) && World.Entities[avatarID] is ScenePresence)
560 { 560 {
561 ScenePresence target = (ScenePresence)World.Entities[avatarID]; 561 ScenePresence target = (ScenePresence)World.Entities[avatarID];
562 target.AddAnimation(animation); 562 target.AddAnimation(animation, m_host.UUID);
563 } 563 }
564 } 564 }
565 565
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs
index 2463b3b..373ee13 100644
--- a/OpenSim/Tests/Common/Mock/TestClient.cs
+++ b/OpenSim/Tests/Common/Mock/TestClient.cs
@@ -443,7 +443,7 @@ namespace OpenSim.Tests.Common.Mock
443 } 443 }
444 444
445 445
446 public virtual void SendAnimations(UUID[] animations, int[] seqs, UUID sourceAgentId) 446 public virtual void SendAnimations(UUID[] animations, int[] seqs, UUID sourceAgentId, UUID[] objectIDs)
447 { 447 {
448 } 448 }
449 449