diff options
Diffstat (limited to 'OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs')
-rw-r--r-- | OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index 2cb5375..fed7d9b 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | |||
@@ -218,9 +218,6 @@ namespace OpenSim.ApplicationPlugins.LoadRegions | |||
218 | Hashtable responseData = new Hashtable(); | 218 | Hashtable responseData = new Hashtable(); |
219 | 219 | ||
220 | try { | 220 | try { |
221 | checkStringParameters(request, new string[] { "password", "shutdown" }); | ||
222 | checkIntegerParams(request, new string[] { "milliseconds"}); | ||
223 | |||
224 | if (requiredPassword != String.Empty && | 221 | if (requiredPassword != String.Empty && |
225 | (!requestData.Contains("password") || (string) requestData["password"] != requiredPassword)) | 222 | (!requestData.Contains("password") || (string) requestData["password"] != requiredPassword)) |
226 | throw new Exception("wrong password"); | 223 | throw new Exception("wrong password"); |
@@ -228,28 +225,28 @@ namespace OpenSim.ApplicationPlugins.LoadRegions | |||
228 | responseData["accepted"] = "true"; | 225 | responseData["accepted"] = "true"; |
229 | response.Value = responseData; | 226 | response.Value = responseData; |
230 | 227 | ||
231 | if ((string) requestData["shutdown"] == "delayed") | 228 | int timeout = 2000; |
229 | |||
230 | if (requestData.ContainsKey("shutdown") && | ||
231 | ((string) requestData["shutdown"] == "delayed") && | ||
232 | requestData.ContainsKey("milliseconds")) | ||
232 | { | 233 | { |
233 | int timeout = (Int32) requestData["milliseconds"]; | 234 | timeout = (Int32) requestData["milliseconds"]; |
234 | m_app.SceneManager.SendGeneralMessage("Region is going down in " + ((int) (timeout/1000)).ToString() + | 235 | m_app.SceneManager.SendGeneralMessage("Region is going down in " + ((int) (timeout/1000)).ToString() + |
235 | " second(s). Please save what you are doing and log out."); | 236 | " second(s). Please save what you are doing and log out."); |
236 | |||
237 | // Perform shutdown | ||
238 | Timer shutdownTimer = new Timer(timeout); // Wait before firing | ||
239 | shutdownTimer.AutoReset = false; | ||
240 | shutdownTimer.Elapsed += new ElapsedEventHandler(shutdownTimer_Elapsed); | ||
241 | shutdownTimer.Start(); | ||
242 | } | 237 | } |
243 | else | 238 | else |
244 | { | 239 | { |
245 | m_app.SceneManager.SendGeneralMessage("Region is going down now."); | 240 | m_app.SceneManager.SendGeneralMessage("Region is going down now."); |
246 | |||
247 | // Perform shutdown | ||
248 | Timer shutdownTimer = new Timer(2000); // Wait 2 seconds before firing | ||
249 | shutdownTimer.AutoReset = false; | ||
250 | shutdownTimer.Elapsed += new ElapsedEventHandler(shutdownTimer_Elapsed); | ||
251 | shutdownTimer.Start(); | ||
252 | } | 241 | } |
242 | |||
243 | // Perform shutdown | ||
244 | Timer shutdownTimer = new Timer(timeout); // Wait before firing | ||
245 | shutdownTimer.AutoReset = false; | ||
246 | shutdownTimer.Elapsed += new ElapsedEventHandler(shutdownTimer_Elapsed); | ||
247 | shutdownTimer.Start(); | ||
248 | |||
249 | responseData["success"] = "true"; | ||
253 | } | 250 | } |
254 | catch (Exception e) | 251 | catch (Exception e) |
255 | { | 252 | { |