diff options
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SimStatsReporter.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SimStatsReporter.cs | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs index e2afa5a..efda140 100644 --- a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs +++ b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs | |||
@@ -39,10 +39,16 @@ namespace OpenSim.Region.Environment.Scenes | |||
39 | { | 39 | { |
40 | public delegate void SendStatResult(SimStats stats); | 40 | public delegate void SendStatResult(SimStats stats); |
41 | 41 | ||
42 | public delegate void YourStatsAreWrong(); | ||
43 | |||
42 | public event SendStatResult OnSendStatsResult; | 44 | public event SendStatResult OnSendStatsResult; |
43 | 45 | ||
46 | public event YourStatsAreWrong OnStatsIncorrect; | ||
47 | |||
44 | private SendStatResult handlerSendStatResult = null; | 48 | private SendStatResult handlerSendStatResult = null; |
45 | 49 | ||
50 | private YourStatsAreWrong handlerStatsIncorrect = null; | ||
51 | |||
46 | private enum Stats : uint | 52 | private enum Stats : uint |
47 | { | 53 | { |
48 | TimeDilation = 0, | 54 | TimeDilation = 0, |
@@ -306,15 +312,30 @@ namespace OpenSim.Region.Environment.Scenes | |||
306 | public void SetRootAgents(int rootAgents) | 312 | public void SetRootAgents(int rootAgents) |
307 | { | 313 | { |
308 | m_rootAgents = rootAgents; | 314 | m_rootAgents = rootAgents; |
315 | CheckStatSanity(); | ||
316 | |||
309 | } | 317 | } |
310 | 318 | ||
311 | public void SetChildAgents(int childAgents) | 319 | internal void CheckStatSanity() |
312 | { | 320 | { |
313 | m_childAgents = (childAgents > 0) ? childAgents : 0; | 321 | if (m_rootAgents < 0 || m_childAgents < 0) |
314 | if (childAgents < 0) | ||
315 | { | 322 | { |
316 | //List<ScenePresence> avs= m_scene.GetScenePresences(); | 323 | handlerStatsIncorrect = OnStatsIncorrect; |
324 | if (handlerStatsIncorrect != null) | ||
325 | { | ||
326 | handlerStatsIncorrect(); | ||
327 | } | ||
317 | } | 328 | } |
329 | if (m_rootAgents == 0 && m_childAgents == 0) | ||
330 | { | ||
331 | m_unAckedBytes = 0; | ||
332 | } | ||
333 | } | ||
334 | |||
335 | public void SetChildAgents(int childAgents) | ||
336 | { | ||
337 | m_childAgents = childAgents; | ||
338 | CheckStatSanity(); | ||
318 | } | 339 | } |
319 | 340 | ||
320 | public void SetObjects(int objects) | 341 | public void SetObjects(int objects) |