aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/ApplicationPlugins
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-04-29 14:50:27 +0000
committerJustin Clarke Casey2008-04-29 14:50:27 +0000
commit763ae779ffb43ea9d33a9bf2a1c6c4ca78ef243d (patch)
treeade4e916a83e25d286c9e2cf95721bf5b366910e /OpenSim/ApplicationPlugins
parentCommitting Dee100's balance update patch with a few bug fixes and a twist. Th... (diff)
downloadopensim-SC-763ae779ffb43ea9d33a9bf2a1c6c4ca78ef243d.zip
opensim-SC-763ae779ffb43ea9d33a9bf2a1c6c4ca78ef243d.tar.gz
opensim-SC-763ae779ffb43ea9d33a9bf2a1c6c4ca78ef243d.tar.bz2
opensim-SC-763ae779ffb43ea9d33a9bf2a1c6c4ca78ef243d.tar.xz
From: Dr Scofield <hud@zurich.ibm.com>
* Fixes the admin_shutdown xmlrpc method * Adds a share/python/console/shutdown.py script for shutting down a background OpenSim * For more details see http://xyzzyxyzzy.net/2008/04/29/console-less-opensim/ * There should also be instructions in the opensimulator wiki soon as well
Diffstat (limited to 'OpenSim/ApplicationPlugins')
-rw-r--r--OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs31
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 {