diff options
author | Tom Grimshaw | 2010-06-26 18:51:19 -0700 |
---|---|---|
committer | Tom Grimshaw | 2010-06-26 18:51:19 -0700 |
commit | 592ff1288dd1fccc1d2efde90e94ca0ab4a57652 (patch) | |
tree | 8dfbc9098a41728a38cb26d80316a23f2e3fbcba /OpenSim/Region | |
parent | Reverting the ITerrainModule changes. Turns out this was useless. (diff) | |
download | opensim-SC-592ff1288dd1fccc1d2efde90e94ca0ab4a57652.zip opensim-SC-592ff1288dd1fccc1d2efde90e94ca0ab4a57652.tar.gz opensim-SC-592ff1288dd1fccc1d2efde90e94ca0ab4a57652.tar.bz2 opensim-SC-592ff1288dd1fccc1d2efde90e94ca0ab4a57652.tar.xz |
Add a new global event : OnTerrainUpdate
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/EventManager.cs | 24 |
2 files changed, 26 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs index 1e7ea7b..0c20393 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs | |||
@@ -544,6 +544,8 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
544 | m_scene.PhysicsScene.SetTerrain(m_channel.GetFloatsSerialised()); | 544 | m_scene.PhysicsScene.SetTerrain(m_channel.GetFloatsSerialised()); |
545 | m_scene.SaveTerrain(); | 545 | m_scene.SaveTerrain(); |
546 | 546 | ||
547 | m_scene.EventManager.TriggerTerrainUpdate(); | ||
548 | |||
547 | // Clients who look at the map will never see changes after they looked at the map, so i've commented this out. | 549 | // Clients who look at the map will never see changes after they looked at the map, so i've commented this out. |
548 | //m_scene.CreateTerrainTexture(true); | 550 | //m_scene.CreateTerrainTexture(true); |
549 | } | 551 | } |
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index ef125cd..0c9759d 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -55,8 +55,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
55 | 55 | ||
56 | public delegate void OnTerrainTickDelegate(); | 56 | public delegate void OnTerrainTickDelegate(); |
57 | 57 | ||
58 | public delegate void OnTerrainUpdateDelegate(); | ||
59 | |||
58 | public event OnTerrainTickDelegate OnTerrainTick; | 60 | public event OnTerrainTickDelegate OnTerrainTick; |
59 | 61 | ||
62 | public event OnTerrainUpdateDelegate OnTerrainUpdate; | ||
63 | |||
60 | public delegate void OnBackupDelegate(IRegionDataStore datastore, bool forceBackup); | 64 | public delegate void OnBackupDelegate(IRegionDataStore datastore, bool forceBackup); |
61 | 65 | ||
62 | public event OnBackupDelegate OnBackup; | 66 | public event OnBackupDelegate OnBackup; |
@@ -716,6 +720,26 @@ namespace OpenSim.Region.Framework.Scenes | |||
716 | } | 720 | } |
717 | } | 721 | } |
718 | } | 722 | } |
723 | public void TriggerTerrainUpdate() | ||
724 | { | ||
725 | OnTerrainUpdateDelegate handlerTerrainUpdate = OnTerrainUpdate; | ||
726 | if (handlerTerrainUpdate != null) | ||
727 | { | ||
728 | foreach (OnTerrainUpdateDelegate d in handlerTerrainUpdate.GetInvocationList()) | ||
729 | { | ||
730 | try | ||
731 | { | ||
732 | d(); | ||
733 | } | ||
734 | catch (Exception e) | ||
735 | { | ||
736 | m_log.ErrorFormat( | ||
737 | "[EVENT MANAGER]: Delegate for TriggerTerrainUpdate failed - continuing. {0} {1}", | ||
738 | e.Message, e.StackTrace); | ||
739 | } | ||
740 | } | ||
741 | } | ||
742 | } | ||
719 | 743 | ||
720 | public void TriggerTerrainTick() | 744 | public void TriggerTerrainTick() |
721 | { | 745 | { |