diff options
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SimStatsReporter.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SimStatsReporter.cs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs index 4c9c59d..70287fc 100644 --- a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs +++ b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs | |||
@@ -73,6 +73,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
73 | private float statsUpdateFactor = 0; | 73 | private float statsUpdateFactor = 0; |
74 | private float m_timeDilation = 0; | 74 | private float m_timeDilation = 0; |
75 | private int m_fps = 0; | 75 | private int m_fps = 0; |
76 | // saved last reported value so there is something available for llGetRegionFPS | ||
77 | private float lastReportedSimFPS = 0; | ||
76 | private float m_pfps = 0; | 78 | private float m_pfps = 0; |
77 | private int m_agentUpdates = 0; | 79 | private int m_agentUpdates = 0; |
78 | 80 | ||
@@ -155,6 +157,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
155 | // Our FPS is actually 10fps, so multiplying by 5 to get the amount that people expect there | 157 | // Our FPS is actually 10fps, so multiplying by 5 to get the amount that people expect there |
156 | // 0-50 is pretty close to 0-45 | 158 | // 0-50 is pretty close to 0-45 |
157 | float simfps = (int) ((m_fps * 5)); | 159 | float simfps = (int) ((m_fps * 5)); |
160 | // save the reported value so there is something available for llGetRegionFPS | ||
161 | lastReportedSimFPS = (float)simfps / statsUpdateFactor; | ||
158 | 162 | ||
159 | //if (simfps > 45) | 163 | //if (simfps > 45) |
160 | //simfps = simfps - (simfps - 45); | 164 | //simfps = simfps - (simfps - 45); |
@@ -397,6 +401,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
397 | objectCapacity = objects; | 401 | objectCapacity = objects; |
398 | } | 402 | } |
399 | 403 | ||
404 | /// <summary> | ||
405 | /// This is for llGetRegionFPS | ||
406 | /// </summary> | ||
407 | public float getLastReportedSimFPS() | ||
408 | { | ||
409 | return lastReportedSimFPS; | ||
410 | } | ||
411 | |||
400 | #endregion | 412 | #endregion |
401 | } | 413 | } |
402 | } | 414 | } |