aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
diff options
context:
space:
mode:
authorJustin Clarke Casey2009-02-13 19:03:18 +0000
committerJustin Clarke Casey2009-02-13 19:03:18 +0000
commitd307109e1af20c5b1b27743853236d7842d871f0 (patch)
tree200d85452cadddc5b05ab90e311c2b373ec9d1b7 /OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
parent* Quieten down log messages from the Friends module (diff)
downloadopensim-SC_OLD-d307109e1af20c5b1b27743853236d7842d871f0.zip
opensim-SC_OLD-d307109e1af20c5b1b27743853236d7842d871f0.tar.gz
opensim-SC_OLD-d307109e1af20c5b1b27743853236d7842d871f0.tar.bz2
opensim-SC_OLD-d307109e1af20c5b1b27743853236d7842d871f0.tar.xz
* refactor: move alert commands from Scene to DialogModule
Diffstat (limited to 'OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs')
-rw-r--r--OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs36
1 files changed, 27 insertions, 9 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
index d457d2b..a0f1eea 100644
--- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
+++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
@@ -182,7 +182,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController
182 XmlRpcResponse response = new XmlRpcResponse(); 182 XmlRpcResponse response = new XmlRpcResponse();
183 Hashtable responseData = new Hashtable(); 183 Hashtable responseData = new Hashtable();
184 184
185 try { 185 try
186 {
186 Hashtable requestData = (Hashtable) request.Params[0]; 187 Hashtable requestData = (Hashtable) request.Params[0];
187 188
188 checkStringParameters(request, new string[] { "password", "message" }); 189 checkStringParameters(request, new string[] { "password", "message" });
@@ -197,8 +198,14 @@ namespace OpenSim.ApplicationPlugins.RemoteController
197 responseData["accepted"] = "true"; 198 responseData["accepted"] = "true";
198 responseData["success"] = "true"; 199 responseData["success"] = "true";
199 response.Value = responseData; 200 response.Value = responseData;
200 201
201 m_app.SceneManager.SendGeneralMessage(message); 202 m_app.SceneManager.ForEachScene(
203 delegate(Scene scene)
204 {
205 IDialogModule dialogModule = scene.RequestModuleInterface<IDialogModule>();
206 if (dialogModule != null)
207 dialogModule.SendGeneralAlert(message);
208 });
202 } 209 }
203 catch(Exception e) 210 catch(Exception e)
204 { 211 {
@@ -283,19 +290,30 @@ namespace OpenSim.ApplicationPlugins.RemoteController
283 response.Value = responseData; 290 response.Value = responseData;
284 291
285 int timeout = 2000; 292 int timeout = 2000;
293 string message;
286 294
287 if (requestData.ContainsKey("shutdown") && 295 if (requestData.ContainsKey("shutdown")
288 ((string) requestData["shutdown"] == "delayed") && 296 && ((string) requestData["shutdown"] == "delayed")
289 requestData.ContainsKey("milliseconds")) 297 && requestData.ContainsKey("milliseconds"))
290 { 298 {
291 timeout = (Int32) requestData["milliseconds"]; 299 timeout = (Int32) requestData["milliseconds"];
292 m_app.SceneManager.SendGeneralMessage("Region is going down in " + ((int) (timeout/1000)).ToString() + 300
293 " second(s). Please save what you are doing and log out."); 301 message
302 = "Region is going down in " + ((int) (timeout/1000)).ToString()
303 + " second(s). Please save what you are doing and log out.";
294 } 304 }
295 else 305 else
296 { 306 {
297 m_app.SceneManager.SendGeneralMessage("Region is going down now."); 307 message = "Region is going down now.";
298 } 308 }
309
310 m_app.SceneManager.ForEachScene(
311 delegate(Scene scene)
312 {
313 IDialogModule dialogModule = scene.RequestModuleInterface<IDialogModule>();
314 if (dialogModule != null)
315 dialogModule.SendGeneralAlert(message);
316 });
299 317
300 // Perform shutdown 318 // Perform shutdown
301 Timer shutdownTimer = new Timer(timeout); // Wait before firing 319 Timer shutdownTimer = new Timer(timeout); // Wait before firing