From 0d1b8675004a37c1a5590a6825b5204b08e285e6 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Tue, 6 Jan 2009 00:07:24 +0000 Subject: * Added a way for the sim stats reporter to say to the scene that the stats are illogical. --- .../Region/Environment/Scenes/SimStatsReporter.cs | 29 +++++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes/SimStatsReporter.cs') 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 { public delegate void SendStatResult(SimStats stats); + public delegate void YourStatsAreWrong(); + public event SendStatResult OnSendStatsResult; + public event YourStatsAreWrong OnStatsIncorrect; + private SendStatResult handlerSendStatResult = null; + private YourStatsAreWrong handlerStatsIncorrect = null; + private enum Stats : uint { TimeDilation = 0, @@ -306,15 +312,30 @@ namespace OpenSim.Region.Environment.Scenes public void SetRootAgents(int rootAgents) { m_rootAgents = rootAgents; + CheckStatSanity(); + } - public void SetChildAgents(int childAgents) + internal void CheckStatSanity() { - m_childAgents = (childAgents > 0) ? childAgents : 0; - if (childAgents < 0) + if (m_rootAgents < 0 || m_childAgents < 0) { - //List avs= m_scene.GetScenePresences(); + handlerStatsIncorrect = OnStatsIncorrect; + if (handlerStatsIncorrect != null) + { + handlerStatsIncorrect(); + } } + if (m_rootAgents == 0 && m_childAgents == 0) + { + m_unAckedBytes = 0; + } + } + + public void SetChildAgents(int childAgents) + { + m_childAgents = childAgents; + CheckStatSanity(); } public void SetObjects(int objects) -- cgit v1.1