aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs9
-rw-r--r--OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs27
-rw-r--r--OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs18
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/SimStatsReporter.cs33
5 files changed, 77 insertions, 16 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs
index 8155eab..620ec22 100644
--- a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs
@@ -109,6 +109,15 @@ namespace OpenSim.Region.Framework.Interfaces
109 void DetachSingleAttachmentToGround(IScenePresence sp, uint objectLocalID); 109 void DetachSingleAttachmentToGround(IScenePresence sp, uint objectLocalID);
110 110
111 /// <summary> 111 /// <summary>
112 /// Detach the given item to the ground at the specified coordinates & rotation
113 /// </summary>
114 /// <param name="sp"></param>
115 /// <param name="objectLocalID"></param>
116 /// <param name="absolutePos"></param>
117 /// <param name="absoluteRot"></param>
118 void DetachSingleAttachmentToGround(IScenePresence sp, uint objectLocalID, Vector3 absolutePos, Quaternion absoluteRot);
119
120 /// <summary>
112 /// Detach the given attachment so that it remains in the user's inventory. 121 /// Detach the given attachment so that it remains in the user's inventory.
113 /// </summary> 122 /// </summary>
114 /// <param name="sp">/param> 123 /// <param name="sp">/param>
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 ff53f45..bb33f07 100644
--- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
+++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
@@ -408,13 +408,19 @@ namespace OpenSim.Region.Framework.Scenes.Animation
408 { 408 {
409 lock (m_animations) 409 lock (m_animations)
410 { 410 {
411 CurrentMovementAnimation = DetermineMovementAnimation(); 411 string newMovementAnimation = DetermineMovementAnimation();
412 if (CurrentMovementAnimation != newMovementAnimation)
413 {
414 CurrentMovementAnimation = DetermineMovementAnimation();
412 415
413// m_log.DebugFormat( 416// m_log.DebugFormat(
414// "[SCENE PRESENCE ANIMATOR]: Determined animation {0} for {1} in UpdateMovementAnimations()", 417// "[SCENE PRESENCE ANIMATOR]: Determined animation {0} for {1} in UpdateMovementAnimations()",
415// CurrentMovementAnimation, m_scenePresence.Name); 418// CurrentMovementAnimation, m_scenePresence.Name);
416 419
417 TrySetMovementAnimation(CurrentMovementAnimation); 420 // Only set it if it's actually changed, give a script
421 // a chance to stop a default animation
422 TrySetMovementAnimation(CurrentMovementAnimation);
423 }
418 } 424 }
419 } 425 }
420 426
@@ -536,4 +542,4 @@ namespace OpenSim.Region.Framework.Scenes.Animation
536 SendAnimPack(animIDs, sequenceNums, objectIDs); 542 SendAnimPack(animIDs, sequenceNums, objectIDs);
537 } 543 }
538 } 544 }
539} \ No newline at end of file 545}
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 2e03874..0a4aa4a 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -5545,6 +5545,9 @@ namespace OpenSim.Region.Framework.Scenes
5545 5545
5546 public void StoreExtraSetting(string name, string val) 5546 public void StoreExtraSetting(string name, string val)
5547 { 5547 {
5548 if (m_extraSettings == null)
5549 return;
5550
5548 string oldVal; 5551 string oldVal;
5549 5552
5550 if (m_extraSettings.TryGetValue(name, out oldVal)) 5553 if (m_extraSettings.TryGetValue(name, out oldVal))
@@ -5562,6 +5565,9 @@ namespace OpenSim.Region.Framework.Scenes
5562 5565
5563 public void RemoveExtraSetting(string name) 5566 public void RemoveExtraSetting(string name)
5564 { 5567 {
5568 if (m_extraSettings == null)
5569 return;
5570
5565 if (!m_extraSettings.ContainsKey(name)) 5571 if (!m_extraSettings.ContainsKey(name))
5566 return; 5572 return;
5567 5573
diff --git a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
index 96317c3..2addb5b 100644
--- a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
+++ b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
@@ -47,6 +47,7 @@ namespace OpenSim.Region.Framework.Scenes
47 = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 47 = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
48 48
49 public const string LastReportedObjectUpdateStatName = "LastReportedObjectUpdates"; 49 public const string LastReportedObjectUpdateStatName = "LastReportedObjectUpdates";
50 public const string SlowFramesStatName = "SlowFrames";
50 51
51 public delegate void SendStatResult(SimStats stats); 52 public delegate void SendStatResult(SimStats stats);
52 53
@@ -129,6 +130,16 @@ namespace OpenSim.Region.Framework.Scenes
129 } 130 }
130 131
131 /// <summary> 132 /// <summary>
133 /// Number of frames that have taken longer to process than Scene.MIN_FRAME_TIME
134 /// </summary>
135 public Stat SlowFramesStat { get; private set; }
136
137 /// <summary>
138 /// The threshold at which we log a slow frame.
139 /// </summary>
140 public int SlowFramesStatReportThreshold { get; private set; }
141
142 /// <summary>
132 /// Extra sim statistics that are used by monitors but not sent to the client. 143 /// Extra sim statistics that are used by monitors but not sent to the client.
133 /// </summary> 144 /// </summary>
134 /// <value> 145 /// <value>
@@ -225,6 +236,22 @@ namespace OpenSim.Region.Framework.Scenes
225 236
226 if (StatsManager.SimExtraStats != null) 237 if (StatsManager.SimExtraStats != null)
227 OnSendStatsResult += StatsManager.SimExtraStats.ReceiveClassicSimStatsPacket; 238 OnSendStatsResult += StatsManager.SimExtraStats.ReceiveClassicSimStatsPacket;
239
240 /// At the moment, we'll only report if a frame is over 120% of target, since commonly frames are a bit
241 /// longer than ideal (which in itself is a concern).
242 SlowFramesStatReportThreshold = (int)Math.Ceiling(m_scene.MinFrameTime * 1000 * 1.2);
243
244 SlowFramesStat
245 = new Stat(
246 "SlowFrames",
247 "Slow Frames",
248 " frames",
249 "scene",
250 m_scene.Name,
251 StatVerbosity.Info,
252 "Number of frames where frame time has been significantly longer than the desired frame time.");
253
254 StatsManager.RegisterStat(SlowFramesStat);
228 } 255 }
229 256
230 public void Close() 257 public void Close()
@@ -418,6 +445,7 @@ namespace OpenSim.Region.Framework.Scenes
418 lock (m_lastReportedExtraSimStats) 445 lock (m_lastReportedExtraSimStats)
419 { 446 {
420 m_lastReportedExtraSimStats[LastReportedObjectUpdateStatName] = m_objectUpdates / m_statsUpdateFactor; 447 m_lastReportedExtraSimStats[LastReportedObjectUpdateStatName] = m_objectUpdates / m_statsUpdateFactor;
448 m_lastReportedExtraSimStats[SlowFramesStat.ShortName] = (float)SlowFramesStat.Value;
421 449
422 Dictionary<string, float> physicsStats = m_scene.PhysicsScene.GetStats(); 450 Dictionary<string, float> physicsStats = m_scene.PhysicsScene.GetStats();
423 451
@@ -535,6 +563,11 @@ namespace OpenSim.Region.Framework.Scenes
535 public void addFrameMS(int ms) 563 public void addFrameMS(int ms)
536 { 564 {
537 m_frameMS += ms; 565 m_frameMS += ms;
566
567 // At the moment, we'll only report if a frame is over 120% of target, since commonly frames are a bit
568 // longer than ideal due to the inaccuracy of the Sleep in Scene.Update() (which in itself is a concern).
569 if (ms > SlowFramesStatReportThreshold)
570 SlowFramesStat.Value++;
538 } 571 }
539 572
540 public void AddSpareMS(int ms) 573 public void AddSpareMS(int ms)