diff options
author | UbitUmarov | 2015-08-27 15:01:15 +0100 |
---|---|---|
committer | UbitUmarov | 2015-08-27 15:01:15 +0100 |
commit | b82b16c954a0f3921efbdcfe7d7eb378f71e96be (patch) | |
tree | 6bc64951ebdc7c6ec691c2e588d8c21ffda4bd21 /OpenSim/Region/CoreModules | |
parent | minor clear. Use isTainted in is read clear form (diff) | |
download | opensim-SC-b82b16c954a0f3921efbdcfe7d7eb378f71e96be.zip opensim-SC-b82b16c954a0f3921efbdcfe7d7eb378f71e96be.tar.gz opensim-SC-b82b16c954a0f3921efbdcfe7d7eb378f71e96be.tar.bz2 opensim-SC-b82b16c954a0f3921efbdcfe7d7eb378f71e96be.tar.xz |
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)
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs | 9 |
1 files changed, 4 insertions, 5 deletions
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 | |||
229 | } | 229 | } |
230 | 230 | ||
231 | m_scene.RegisterModuleInterface<ITerrainModule>(this); | 231 | m_scene.RegisterModuleInterface<ITerrainModule>(this); |
232 | m_scene.EventManager.OnFrame += EventManager_OnFrame; | ||
233 | m_scene.EventManager.OnNewClient += EventManager_OnNewClient; | 232 | m_scene.EventManager.OnNewClient += EventManager_OnNewClient; |
234 | m_scene.EventManager.OnClientClosed += EventManager_OnClientClosed; | 233 | m_scene.EventManager.OnClientClosed += EventManager_OnClientClosed; |
235 | m_scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole; | 234 | m_scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole; |
236 | m_scene.EventManager.OnTerrainTick += EventManager_OnTerrainTick; | 235 | m_scene.EventManager.OnTerrainTick += EventManager_OnTerrainTick; |
236 | m_scene.EventManager.OnTerrainCheckUpdates += EventManager_TerrainCheckUpdates; | ||
237 | } | 237 | } |
238 | 238 | ||
239 | InstallDefaultEffects(); | 239 | InstallDefaultEffects(); |
@@ -272,7 +272,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
272 | // remove the commands | 272 | // remove the commands |
273 | m_scene.UnregisterModuleCommander(m_commander.Name); | 273 | m_scene.UnregisterModuleCommander(m_commander.Name); |
274 | // remove the event-handlers | 274 | // remove the event-handlers |
275 | m_scene.EventManager.OnFrame -= EventManager_OnFrame; | 275 | m_scene.EventManager.OnTerrainCheckUpdates -= EventManager_TerrainCheckUpdates; |
276 | m_scene.EventManager.OnTerrainTick -= EventManager_OnTerrainTick; | 276 | m_scene.EventManager.OnTerrainTick -= EventManager_OnTerrainTick; |
277 | m_scene.EventManager.OnPluginConsole -= EventManager_OnPluginConsole; | 277 | m_scene.EventManager.OnPluginConsole -= EventManager_OnPluginConsole; |
278 | m_scene.EventManager.OnClientClosed -= EventManager_OnClientClosed; | 278 | m_scene.EventManager.OnClientClosed -= EventManager_OnClientClosed; |
@@ -759,13 +759,12 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
759 | } | 759 | } |
760 | 760 | ||
761 | /// <summary> | 761 | /// <summary> |
762 | /// Called before processing of every simulation frame. | ||
763 | /// This is used to check to see of any of the terrain is tainted and, if so, schedule | 762 | /// This is used to check to see of any of the terrain is tainted and, if so, schedule |
764 | /// updates for all the presences. | 763 | /// updates for all the presences. |
765 | /// This also checks to see if there are updates that need to be sent for each presence. | 764 | /// This also checks to see if there are updates that need to be sent for each presence. |
766 | /// This is where the logic is to send terrain updates to clients. | 765 | /// This is where the logic is to send terrain updates to clients. |
767 | /// </summary> | 766 | /// </summary> |
768 | private void EventManager_OnFrame() | 767 | private void EventManager_TerrainCheckUpdates() |
769 | { | 768 | { |
770 | // this needs fixing | 769 | // this needs fixing |
771 | TerrainData terrData = m_channel.GetTerrainData(); | 770 | TerrainData terrData = m_channel.GetTerrainData(); |
@@ -775,7 +774,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
775 | { | 774 | { |
776 | for (int y = 0; y < terrData.SizeY; y += Constants.TerrainPatchSize) | 775 | for (int y = 0; y < terrData.SizeY; y += Constants.TerrainPatchSize) |
777 | { | 776 | { |
778 | if (terrData.IsTaintedAt(x, y)) | 777 | if (terrData.IsTaintedAt(x, y,true)) |
779 | { | 778 | { |
780 | // Found a patch that was modified. Push this flag into the clients. | 779 | // Found a patch that was modified. Push this flag into the clients. |
781 | SendToClients(terrData, x, y); | 780 | SendToClients(terrData, x, y); |