diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/ApplicationPlugins/RegionModulesController/RegionModulesControllerPlugin.cs | 2 | ||||
-rwxr-xr-x | OpenSim/Region/Framework/Scenes/Scene.cs | 41 |
2 files changed, 42 insertions, 1 deletions
diff --git a/OpenSim/ApplicationPlugins/RegionModulesController/RegionModulesControllerPlugin.cs b/OpenSim/ApplicationPlugins/RegionModulesController/RegionModulesControllerPlugin.cs index 17edb67..8f38a29 100644 --- a/OpenSim/ApplicationPlugins/RegionModulesController/RegionModulesControllerPlugin.cs +++ b/OpenSim/ApplicationPlugins/RegionModulesController/RegionModulesControllerPlugin.cs | |||
@@ -509,6 +509,8 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController | |||
509 | { | 509 | { |
510 | module.RegionLoaded(scene); | 510 | module.RegionLoaded(scene); |
511 | } | 511 | } |
512 | |||
513 | scene.AllModulesLoaded(); | ||
512 | } | 514 | } |
513 | 515 | ||
514 | public void RemoveRegionFromModules (Scene scene) | 516 | public void RemoveRegionFromModules (Scene scene) |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index cca8963..2fe6e22 100755 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -39,6 +39,7 @@ using Nini.Config; | |||
39 | using OpenMetaverse; | 39 | using OpenMetaverse; |
40 | using OpenMetaverse.Packets; | 40 | using OpenMetaverse.Packets; |
41 | using OpenMetaverse.Imaging; | 41 | using OpenMetaverse.Imaging; |
42 | using OpenMetaverse.StructuredData; | ||
42 | using OpenSim.Framework; | 43 | using OpenSim.Framework; |
43 | using OpenSim.Framework.Monitoring; | 44 | using OpenSim.Framework.Monitoring; |
44 | using OpenSim.Services.Interfaces; | 45 | using OpenSim.Services.Interfaces; |
@@ -381,6 +382,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
381 | } | 382 | } |
382 | private int m_minFrameTicks; | 383 | private int m_minFrameTicks; |
383 | 384 | ||
385 | public int FrameTimeWarnPercent { get; private set; } | ||
386 | public int FrameTimeCritPercent { get; private set; } | ||
387 | |||
384 | // Normalize the frame related stats to nominal 55fps for viewer and scripts option | 388 | // Normalize the frame related stats to nominal 55fps for viewer and scripts option |
385 | // see SimStatsReporter.cs | 389 | // see SimStatsReporter.cs |
386 | public bool Normalized55FPS { get; private set; } | 390 | public bool Normalized55FPS { get; private set; } |
@@ -860,6 +864,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
860 | { | 864 | { |
861 | m_config = config; | 865 | m_config = config; |
862 | MinFrameTicks = 89; | 866 | MinFrameTicks = 89; |
867 | FrameTimeWarnPercent = 60; | ||
868 | FrameTimeCritPercent = 40; | ||
863 | Normalized55FPS = true; | 869 | Normalized55FPS = true; |
864 | MinMaintenanceTicks = 1000; | 870 | MinMaintenanceTicks = 1000; |
865 | SeeIntoRegion = true; | 871 | SeeIntoRegion = true; |
@@ -1088,6 +1094,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1088 | 1094 | ||
1089 | if (startupConfig.Contains("MinFrameTime")) | 1095 | if (startupConfig.Contains("MinFrameTime")) |
1090 | MinFrameTicks = (int)(startupConfig.GetFloat("MinFrameTime") * 1000); | 1096 | MinFrameTicks = (int)(startupConfig.GetFloat("MinFrameTime") * 1000); |
1097 | FrameTimeWarnPercent = startupConfig.GetInt( "FrameTimeWarnPercent", FrameTimeWarnPercent); | ||
1098 | FrameTimeCritPercent = startupConfig.GetInt( "FrameTimeCritPercent", FrameTimeCritPercent); | ||
1091 | Normalized55FPS = startupConfig.GetBoolean( "Normalized55FPS", Normalized55FPS); | 1099 | Normalized55FPS = startupConfig.GetBoolean( "Normalized55FPS", Normalized55FPS); |
1092 | 1100 | ||
1093 | m_update_backup = startupConfig.GetInt("UpdateStorageEveryNFrames", m_update_backup); | 1101 | m_update_backup = startupConfig.GetInt("UpdateStorageEveryNFrames", m_update_backup); |
@@ -1256,13 +1264,44 @@ namespace OpenSim.Region.Framework.Scenes | |||
1256 | get { return m_sceneGraph; } | 1264 | get { return m_sceneGraph; } |
1257 | } | 1265 | } |
1258 | 1266 | ||
1259 | protected virtual void RegisterDefaultSceneEvents() | 1267 | /// <summary> |
1268 | /// Called by the module loader when all modules are loaded, after each module's | ||
1269 | /// RegionLoaded hook is called. This is the earliest time where RequestModuleInterface | ||
1270 | /// may be used. | ||
1271 | /// </summary> | ||
1272 | public void AllModulesLoaded() | ||
1260 | { | 1273 | { |
1261 | IDialogModule dm = RequestModuleInterface<IDialogModule>(); | 1274 | IDialogModule dm = RequestModuleInterface<IDialogModule>(); |
1262 | 1275 | ||
1263 | if (dm != null) | 1276 | if (dm != null) |
1264 | m_eventManager.OnPermissionError += dm.SendAlertToUser; | 1277 | m_eventManager.OnPermissionError += dm.SendAlertToUser; |
1265 | 1278 | ||
1279 | ISimulatorFeaturesModule fm = RequestModuleInterface<ISimulatorFeaturesModule>(); | ||
1280 | if (fm != null) | ||
1281 | { | ||
1282 | OSD openSimExtras; | ||
1283 | OSDMap openSimExtrasMap; | ||
1284 | |||
1285 | if (!fm.TryGetFeature("OpenSimExtras", out openSimExtras)) | ||
1286 | openSimExtras = new OSDMap(); | ||
1287 | |||
1288 | float FrameTime = MinFrameTicks / 1000.0f; | ||
1289 | float statisticsFPSfactor = 1.0f; | ||
1290 | if(Normalized55FPS) | ||
1291 | statisticsFPSfactor = 55.0f * FrameTime; | ||
1292 | |||
1293 | openSimExtrasMap = (OSDMap)openSimExtras; | ||
1294 | openSimExtrasMap["SimulatorFPS"] = OSD.FromReal(1.0f / FrameTime); | ||
1295 | openSimExtrasMap["SimulatorFPSFactor"] = OSD.FromReal(statisticsFPSfactor); | ||
1296 | openSimExtrasMap["SimulatorFPSWarnPercent"] = OSD.FromInteger(FrameTimeWarnPercent); | ||
1297 | openSimExtrasMap["SimulatorFPSCritPercent"] = OSD.FromInteger(FrameTimeCritPercent); | ||
1298 | |||
1299 | fm.AddFeature("OpenSimExtras", openSimExtrasMap); | ||
1300 | } | ||
1301 | } | ||
1302 | |||
1303 | protected virtual void RegisterDefaultSceneEvents() | ||
1304 | { | ||
1266 | m_eventManager.OnSignificantClientMovement += HandleOnSignificantClientMovement; | 1305 | m_eventManager.OnSignificantClientMovement += HandleOnSignificantClientMovement; |
1267 | } | 1306 | } |
1268 | 1307 | ||