From b82b16c954a0f3921efbdcfe7d7eb378f71e96be Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 27 Aug 2015 15:01:15 +0100 Subject: take taints check terrain out of Onframe event and add a new event for it. Slow it down to 1/4 heartbeat rate (once every 363ms aprox) --- OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs index 0209d16..fa357f5 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs @@ -229,11 +229,11 @@ namespace OpenSim.Region.CoreModules.World.Terrain } m_scene.RegisterModuleInterface(this); - m_scene.EventManager.OnFrame += EventManager_OnFrame; m_scene.EventManager.OnNewClient += EventManager_OnNewClient; m_scene.EventManager.OnClientClosed += EventManager_OnClientClosed; m_scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole; m_scene.EventManager.OnTerrainTick += EventManager_OnTerrainTick; + m_scene.EventManager.OnTerrainCheckUpdates += EventManager_TerrainCheckUpdates; } InstallDefaultEffects(); @@ -272,7 +272,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain // remove the commands m_scene.UnregisterModuleCommander(m_commander.Name); // remove the event-handlers - m_scene.EventManager.OnFrame -= EventManager_OnFrame; + m_scene.EventManager.OnTerrainCheckUpdates -= EventManager_TerrainCheckUpdates; m_scene.EventManager.OnTerrainTick -= EventManager_OnTerrainTick; m_scene.EventManager.OnPluginConsole -= EventManager_OnPluginConsole; m_scene.EventManager.OnClientClosed -= EventManager_OnClientClosed; @@ -759,13 +759,12 @@ namespace OpenSim.Region.CoreModules.World.Terrain } /// - /// Called before processing of every simulation frame. /// This is used to check to see of any of the terrain is tainted and, if so, schedule /// updates for all the presences. /// This also checks to see if there are updates that need to be sent for each presence. /// This is where the logic is to send terrain updates to clients. /// - private void EventManager_OnFrame() + private void EventManager_TerrainCheckUpdates() { // this needs fixing TerrainData terrData = m_channel.GetTerrainData(); @@ -775,7 +774,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain { for (int y = 0; y < terrData.SizeY; y += Constants.TerrainPatchSize) { - if (terrData.IsTaintedAt(x, y)) + if (terrData.IsTaintedAt(x, y,true)) { // Found a patch that was modified. Push this flag into the clients. SendToClients(terrData, x, y); -- cgit v1.1