aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorUbitUmarov2012-10-05 06:00:45 +0100
committerUbitUmarov2012-10-05 06:00:45 +0100
commit5254c0de8fdc8c173efdf17d14800dcb80ae4ec1 (patch)
tree7c5904796634cc9fd7fd6b74134cef1b4d7efe69
parentmake sure a buffer is closed, and changed a misleading log msg (diff)
parentFix threading in remote asset connector (diff)
downloadopensim-SC-5254c0de8fdc8c173efdf17d14800dcb80ae4ec1.zip
opensim-SC-5254c0de8fdc8c173efdf17d14800dcb80ae4ec1.tar.gz
opensim-SC-5254c0de8fdc8c173efdf17d14800dcb80ae4ec1.tar.bz2
opensim-SC-5254c0de8fdc8c173efdf17d14800dcb80ae4ec1.tar.xz
Merge branch 'avination' into ubitwork
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs27
-rw-r--r--OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs18
-rw-r--r--OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs37
3 files changed, 50 insertions, 32 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs
index 33041e9..ad421ee 100644
--- a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs
+++ b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs
@@ -87,7 +87,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
87 { 87 {
88 if (m_defaultAnimation.AnimID == animID) 88 if (m_defaultAnimation.AnimID == animID)
89 { 89 {
90 ResetDefaultAnimation(); 90 m_defaultAnimation = new OpenSim.Framework.Animation(UUID.Zero, 1, UUID.Zero);
91 } 91 }
92 else if (HasAnimation(animID)) 92 else if (HasAnimation(animID))
93 { 93 {
@@ -149,19 +149,26 @@ namespace OpenSim.Region.Framework.Scenes.Animation
149 { 149 {
150 lock (m_animations) 150 lock (m_animations)
151 { 151 {
152 animIDs = new UUID[m_animations.Count + 1]; 152 int defaultSize = 0;
153 sequenceNums = new int[m_animations.Count + 1]; 153 if (m_defaultAnimation.AnimID != UUID.Zero)
154 objectIDs = new UUID[m_animations.Count + 1]; 154 defaultSize++;
155 155
156 animIDs[0] = m_defaultAnimation.AnimID; 156 animIDs = new UUID[m_animations.Count + defaultSize];
157 sequenceNums[0] = m_defaultAnimation.SequenceNum; 157 sequenceNums = new int[m_animations.Count + defaultSize];
158 objectIDs[0] = m_defaultAnimation.ObjectID; 158 objectIDs = new UUID[m_animations.Count + defaultSize];
159
160 if (m_defaultAnimation.AnimID != UUID.Zero)
161 {
162 animIDs[0] = m_defaultAnimation.AnimID;
163 sequenceNums[0] = m_defaultAnimation.SequenceNum;
164 objectIDs[0] = m_defaultAnimation.ObjectID;
165 }
159 166
160 for (int i = 0; i < m_animations.Count; ++i) 167 for (int i = 0; i < m_animations.Count; ++i)
161 { 168 {
162 animIDs[i + 1] = m_animations[i].AnimID; 169 animIDs[i + defaultSize] = m_animations[i].AnimID;
163 sequenceNums[i + 1] = m_animations[i].SequenceNum; 170 sequenceNums[i + defaultSize] = m_animations[i].SequenceNum;
164 objectIDs[i + 1] = m_animations[i].ObjectID; 171 objectIDs[i + defaultSize] = m_animations[i].ObjectID;
165 } 172 }
166 } 173 }
167 } 174 }
diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
index 50a176b..9458079 100644
--- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
+++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
@@ -424,13 +424,19 @@ namespace OpenSim.Region.Framework.Scenes.Animation
424 { 424 {
425 lock (m_animations) 425 lock (m_animations)
426 { 426 {
427 CurrentMovementAnimation = DetermineMovementAnimation(); 427 string newMovementAnimation = DetermineMovementAnimation();
428 if (CurrentMovementAnimation != newMovementAnimation)
429 {
430 CurrentMovementAnimation = DetermineMovementAnimation();
428 431
429// m_log.DebugFormat( 432// m_log.DebugFormat(
430// "[SCENE PRESENCE ANIMATOR]: Determined animation {0} for {1} in UpdateMovementAnimations()", 433// "[SCENE PRESENCE ANIMATOR]: Determined animation {0} for {1} in UpdateMovementAnimations()",
431// CurrentMovementAnimation, m_scenePresence.Name); 434// CurrentMovementAnimation, m_scenePresence.Name);
432 435
433 TrySetMovementAnimation(CurrentMovementAnimation); 436 // Only set it if it's actually changed, give a script
437 // a chance to stop a default animation
438 TrySetMovementAnimation(CurrentMovementAnimation);
439 }
434 } 440 }
435 } 441 }
436 442
@@ -552,4 +558,4 @@ namespace OpenSim.Region.Framework.Scenes.Animation
552 SendAnimPack(animIDs, sequenceNums, objectIDs); 558 SendAnimPack(animIDs, sequenceNums, objectIDs);
553 } 559 }
554 } 560 }
555} \ No newline at end of file 561}
diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs
index 9d6d9ad..7f32ad3 100644
--- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs
+++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs
@@ -295,25 +295,30 @@ namespace OpenSim.Services.Connectors
295 bool success = false; 295 bool success = false;
296 try 296 try
297 { 297 {
298 AsynchronousRestObjectRequester.MakeRequest<int, AssetBase>("GET", uri, 0, 298 AssetBase a = SynchronousRestObjectRequester.MakeRequest<int, AssetBase>("GET", uri, 0, 30);
299 delegate(AssetBase a) 299 if (a != null)
300 { 300 {
301 if (m_Cache != null) 301 if (m_Cache != null)
302 m_Cache.Cache(a); 302 m_Cache.Cache(a);
303 303
304 List<AssetRetrievedEx> handlers; 304 List<AssetRetrievedEx> handlers;
305 lock (m_AssetHandlers) 305 lock (m_AssetHandlers)
306 {
307 handlers = m_AssetHandlers[id];
308 m_AssetHandlers.Remove(id);
309 }
310 foreach (AssetRetrievedEx h in handlers)
311 {
312 Util.FireAndForget(x =>
306 { 313 {
307 handlers = m_AssetHandlers[id];
308 m_AssetHandlers.Remove(id);
309 }
310 foreach (AssetRetrievedEx h in handlers)
311 h.Invoke(a); 314 h.Invoke(a);
312 if (handlers != null) 315 });
313 handlers.Clear(); 316 }
314 }, 30); 317 if (handlers != null)
318 handlers.Clear();
315 319
316 success = true; 320 success = true;
321 }
317 } 322 }
318 finally 323 finally
319 { 324 {
@@ -326,7 +331,7 @@ namespace OpenSim.Services.Connectors
326 m_AssetHandlers.Remove(id); 331 m_AssetHandlers.Remove(id);
327 } 332 }
328 if (handlers != null) 333 if (handlers != null)
329 handlers.Clear(); 334 handlers.Clear();
330 } 335 }
331 } 336 }
332 } 337 }