aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie2009-11-15 20:22:15 +0000
committerMelanie2009-11-15 20:22:15 +0000
commita49c524c9e93db1409f1f05d7b881922e178927c (patch)
tree1941d8ae4e78a874e4571bf708c033dbffbc292e
parentPrevent a nullref if a recipient of a group message gas left the scene (diff)
downloadopensim-SC-a49c524c9e93db1409f1f05d7b881922e178927c.zip
opensim-SC-a49c524c9e93db1409f1f05d7b881922e178927c.tar.gz
opensim-SC-a49c524c9e93db1409f1f05d7b881922e178927c.tar.bz2
opensim-SC-a49c524c9e93db1409f1f05d7b881922e178927c.tar.xz
Add the ability to send messages to users ir regions via remote admin
-rw-r--r--OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs48
1 files changed, 48 insertions, 0 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
index 3149eaa..3bc557d 100644
--- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
+++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
@@ -123,6 +123,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
123 availableMethods["admin_region_query"] = XmlRpcRegionQueryMethod; 123 availableMethods["admin_region_query"] = XmlRpcRegionQueryMethod;
124 availableMethods["admin_shutdown"] = XmlRpcShutdownMethod; 124 availableMethods["admin_shutdown"] = XmlRpcShutdownMethod;
125 availableMethods["admin_broadcast"] = XmlRpcAlertMethod; 125 availableMethods["admin_broadcast"] = XmlRpcAlertMethod;
126 availableMethods["admin_dialog"] = XmlRpcDialogMethod;
126 availableMethods["admin_restart"] = XmlRpcRestartMethod; 127 availableMethods["admin_restart"] = XmlRpcRestartMethod;
127 availableMethods["admin_load_heightmap"] = XmlRpcLoadHeightmapMethod; 128 availableMethods["admin_load_heightmap"] = XmlRpcLoadHeightmapMethod;
128 // User management 129 // User management
@@ -277,6 +278,53 @@ namespace OpenSim.ApplicationPlugins.RemoteController
277 m_log.Info("[RADMIN]: Alert request complete"); 278 m_log.Info("[RADMIN]: Alert request complete");
278 return response; 279 return response;
279 } 280 }
281 public XmlRpcResponse XmlRpcDialogMethod(XmlRpcRequest request, IPEndPoint remoteClient)
282 {
283 XmlRpcResponse response = new XmlRpcResponse();
284 Hashtable responseData = new Hashtable();
285
286 m_log.Info("[RADMIN]: Dialog request started");
287
288 try
289 {
290 Hashtable requestData = (Hashtable)request.Params[0];
291
292 checkStringParameters(request, new string[] { "password", "from", "message" });
293
294 if (m_requiredPassword != String.Empty &&
295 (!requestData.Contains("password") || (string)requestData["password"] != m_requiredPassword))
296 throw new Exception("wrong password");
297
298 string message = (string)requestData["message"];
299 string fromuuid = (string)requestData["from"];
300 m_log.InfoFormat("[RADMIN]: Broadcasting: {0}", message);
301
302 responseData["accepted"] = true;
303 responseData["success"] = true;
304 response.Value = responseData;
305
306 m_app.SceneManager.ForEachScene(
307 delegate(Scene scene)
308 {
309 IDialogModule dialogModule = scene.RequestModuleInterface<IDialogModule>();
310 if (dialogModule != null)
311 dialogModule.SendNotificationToUsersInRegion(UUID.Zero, fromuuid, message);
312 });
313 }
314 catch (Exception e)
315 {
316 m_log.ErrorFormat("[RADMIN]: Broadcasting: failed: {0}", e.Message);
317 m_log.DebugFormat("[RADMIN]: Broadcasting: failed: {0}", e.ToString());
318
319 responseData["accepted"] = false;
320 responseData["success"] = false;
321 responseData["error"] = e.Message;
322 response.Value = responseData;
323 }
324
325 m_log.Info("[RADMIN]: Alert request complete");
326 return response;
327 }
280 328
281 public XmlRpcResponse XmlRpcLoadHeightmapMethod(XmlRpcRequest request, IPEndPoint remoteClient) 329 public XmlRpcResponse XmlRpcLoadHeightmapMethod(XmlRpcRequest request, IPEndPoint remoteClient)
282 { 330 {