aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/Wind/WindModule.cs
diff options
context:
space:
mode:
authorMelanie2010-01-29 07:20:13 +0000
committerMelanie2010-01-29 07:21:06 +0000
commita87a247f0548d39a8c39b1d28123d7da8db44598 (patch)
tree7f9f77c38a224bc6d4bea7ccced1d4710c8a91b1 /OpenSim/Region/CoreModules/World/Wind/WindModule.cs
parentMerge branch 'master' of melanie@opensimulator.org:/var/git/opensim (diff)
downloadopensim-SC_OLD-a87a247f0548d39a8c39b1d28123d7da8db44598.zip
opensim-SC_OLD-a87a247f0548d39a8c39b1d28123d7da8db44598.tar.gz
opensim-SC_OLD-a87a247f0548d39a8c39b1d28123d7da8db44598.tar.bz2
opensim-SC_OLD-a87a247f0548d39a8c39b1d28123d7da8db44598.tar.xz
Revert "Updates all IRegionModules to the new style region modules."
This reverts commit ec3c31e61e5e540f822891110df9bc978655bbaf.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/World/Wind/WindModule.cs45
1 files changed, 17 insertions, 28 deletions
diff --git a/OpenSim/Region/CoreModules/World/Wind/WindModule.cs b/OpenSim/Region/CoreModules/World/Wind/WindModule.cs
index cd3706d..3283c1f 100644
--- a/OpenSim/Region/CoreModules/World/Wind/WindModule.cs
+++ b/OpenSim/Region/CoreModules/World/Wind/WindModule.cs
@@ -55,19 +55,17 @@ namespace OpenSim.Region.CoreModules
55 55
56 private IWindModelPlugin m_activeWindPlugin = null; 56 private IWindModelPlugin m_activeWindPlugin = null;
57 private const string m_dWindPluginName = "SimpleRandomWind"; 57 private const string m_dWindPluginName = "SimpleRandomWind";
58 private string m_desiredWindPlugin = "SimpleRandomWind";
59 private Dictionary<string, IWindModelPlugin> m_availableWindPlugins = new Dictionary<string, IWindModelPlugin>(); 58 private Dictionary<string, IWindModelPlugin> m_availableWindPlugins = new Dictionary<string, IWindModelPlugin>();
60 59
61 // Simplified windSpeeds based on the fact that the client protocal tracks at a resolution of 16m 60 // Simplified windSpeeds based on the fact that the client protocal tracks at a resolution of 16m
62 private Vector2[] windSpeeds = new Vector2[16 * 16]; 61 private Vector2[] windSpeeds = new Vector2[16 * 16];
63 private IConfig windConfig;
64 62
65 #region IRegion Methods 63 #region IRegion Methods
66 64
67 public void Initialise(IConfigSource config) 65 public void Initialise(Scene scene, IConfigSource config)
68 { 66 {
69 windConfig = config.Configs["Wind"]; 67 IConfig windConfig = config.Configs["Wind"];
70 m_desiredWindPlugin = m_dWindPluginName; 68 string desiredWindPlugin = m_dWindPluginName;
71 69
72 if (windConfig != null) 70 if (windConfig != null)
73 { 71 {
@@ -78,18 +76,10 @@ namespace OpenSim.Region.CoreModules
78 // Determine which wind model plugin is desired 76 // Determine which wind model plugin is desired
79 if (windConfig.Contains("wind_plugin")) 77 if (windConfig.Contains("wind_plugin"))
80 { 78 {
81 m_desiredWindPlugin = windConfig.GetString("wind_plugin"); 79 desiredWindPlugin = windConfig.GetString("wind_plugin");
82 } 80 }
83 } 81 }
84 }
85
86 public Type ReplaceableInterface
87 {
88 get { return null; }
89 }
90 82
91 public void AddRegion(Scene scene)
92 {
93 if (m_enabled) 83 if (m_enabled)
94 { 84 {
95 m_log.InfoFormat("[WIND] Enabled with an update rate of {0} frames.", m_frameUpdateRate); 85 m_log.InfoFormat("[WIND] Enabled with an update rate of {0} frames.", m_frameUpdateRate);
@@ -105,30 +95,30 @@ namespace OpenSim.Region.CoreModules
105 } 95 }
106 96
107 // Check for desired plugin 97 // Check for desired plugin
108 if (m_availableWindPlugins.ContainsKey(m_desiredWindPlugin)) 98 if (m_availableWindPlugins.ContainsKey(desiredWindPlugin))
109 { 99 {
110 m_activeWindPlugin = m_availableWindPlugins[m_desiredWindPlugin]; 100 m_activeWindPlugin = m_availableWindPlugins[desiredWindPlugin];
111 101
112 m_log.InfoFormat("[WIND] {0} plugin found, initializing.", m_desiredWindPlugin); 102 m_log.InfoFormat("[WIND] {0} plugin found, initializing.", desiredWindPlugin);
113 103
114 if (windConfig != null) 104 if (windConfig != null)
115 { 105 {
116 m_activeWindPlugin.Initialise(); 106 m_activeWindPlugin.Initialise();
117 m_activeWindPlugin.WindConfig(m_scene, windConfig); 107 m_activeWindPlugin.WindConfig(m_scene, windConfig);
118 } 108 }
119 } 109 }
120 110
121 111
122 // if the plug-in wasn't found, default to no wind. 112 // if the plug-in wasn't found, default to no wind.
123 if (m_activeWindPlugin == null) 113 if (m_activeWindPlugin == null)
124 { 114 {
125 m_log.ErrorFormat("[WIND] Could not find specified wind plug-in: {0}", m_desiredWindPlugin); 115 m_log.ErrorFormat("[WIND] Could not find specified wind plug-in: {0}", desiredWindPlugin);
126 m_log.ErrorFormat("[WIND] Defaulting to no wind."); 116 m_log.ErrorFormat("[WIND] Defaulting to no wind.");
127 } 117 }
128 118
129 // This one puts an entry in the main help screen 119 // This one puts an entry in the main help screen
130 m_scene.AddCommand(this, String.Empty, "wind", "Usage: wind <plugin> <param> [value] - Get or Update Wind paramaters", null); 120 m_scene.AddCommand(this, String.Empty, "wind", "Usage: wind <plugin> <param> [value] - Get or Update Wind paramaters", null);
131 121
132 // This one enables the ability to type just the base command without any parameters 122 // This one enables the ability to type just the base command without any parameters
133 m_scene.AddCommand(this, "wind", "", "", HandleConsoleCommand); 123 m_scene.AddCommand(this, "wind", "", "", HandleConsoleCommand);
134 124
@@ -137,7 +127,7 @@ namespace OpenSim.Region.CoreModules
137 { 127 {
138 m_scene.AddCommand(this, String.Format("wind base wind_plugin {0}", windPlugin.Name), String.Format("{0} - {1}", windPlugin.Name, windPlugin.Description), "", HandleConsoleBaseCommand); 128 m_scene.AddCommand(this, String.Format("wind base wind_plugin {0}", windPlugin.Name), String.Format("{0} - {1}", windPlugin.Name, windPlugin.Description), "", HandleConsoleBaseCommand);
139 m_scene.AddCommand(this, String.Format("wind base wind_update_rate"), "Change the wind update rate.", "", HandleConsoleBaseCommand); 129 m_scene.AddCommand(this, String.Format("wind base wind_update_rate"), "Change the wind update rate.", "", HandleConsoleBaseCommand);
140 130
141 foreach (KeyValuePair<string, string> kvp in windPlugin.WindParams()) 131 foreach (KeyValuePair<string, string> kvp in windPlugin.WindParams())
142 { 132 {
143 m_scene.AddCommand(this, String.Format("wind {0} {1}", windPlugin.Name, kvp.Key), String.Format("{0} : {1} - {2}", windPlugin.Name, kvp.Key, kvp.Value), "", HandleConsoleParamCommand); 133 m_scene.AddCommand(this, String.Format("wind {0} {1}", windPlugin.Name, kvp.Key), String.Format("{0} : {1} - {2}", windPlugin.Name, kvp.Key, kvp.Value), "", HandleConsoleParamCommand);
@@ -159,17 +149,11 @@ namespace OpenSim.Region.CoreModules
159 m_ready = true; 149 m_ready = true;
160 150
161 } 151 }
162 }
163 152
164 public void RegionLoaded(Scene scene)
165 {
166 } 153 }
167 154
168 public void RemoveRegion(Scene scene) 155 public void PostInitialise()
169 { 156 {
170 scene.EventManager.OnFrame -= WindUpdate;
171 scene.EventManager.OnMakeRootAgent -= OnAgentEnteredRegion;
172 scene.UnregisterModuleInterface<IWindModule>(this);
173 } 157 }
174 158
175 public void Close() 159 public void Close()
@@ -198,6 +182,11 @@ namespace OpenSim.Region.CoreModules
198 get { return "WindModule"; } 182 get { return "WindModule"; }
199 } 183 }
200 184
185 public bool IsSharedModule
186 {
187 get { return false; }
188 }
189
201 190
202 #endregion 191 #endregion
203 192