diff options
Diffstat (limited to 'OpenSim/ApplicationPlugins')
3 files changed, 53 insertions, 15 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index f4e1db4..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 | { |
@@ -360,7 +408,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
360 | && ((string) requestData["shutdown"] == "delayed") | 408 | && ((string) requestData["shutdown"] == "delayed") |
361 | && requestData.ContainsKey("milliseconds")) | 409 | && requestData.ContainsKey("milliseconds")) |
362 | { | 410 | { |
363 | timeout = (Int32) requestData["milliseconds"]; | 411 | timeout = Int32.Parse(requestData["milliseconds"].ToString()); |
364 | 412 | ||
365 | message | 413 | message |
366 | = "Region is going down in " + ((int) (timeout/1000)).ToString() | 414 | = "Region is going down in " + ((int) (timeout/1000)).ToString() |
@@ -1562,11 +1610,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
1562 | assets = doc.GetElementsByTagName("RequiredAsset"); | 1610 | assets = doc.GetElementsByTagName("RequiredAsset"); |
1563 | foreach (XmlNode asset in assets) | 1611 | foreach (XmlNode asset in assets) |
1564 | { | 1612 | { |
1565 | AssetBase rass = new AssetBase(); | 1613 | AssetBase rass = new AssetBase(UUID.Random(), GetStringAttribute(asset,"name",""), SByte.Parse(GetStringAttribute(asset,"type",""))); |
1566 | rass.FullID = UUID.Random(); | ||
1567 | rass.Name = GetStringAttribute(asset,"name",""); | ||
1568 | rass.Description = GetStringAttribute(asset,"desc",""); | 1614 | rass.Description = GetStringAttribute(asset,"desc",""); |
1569 | rass.Type = SByte.Parse(GetStringAttribute(asset,"type","")); | ||
1570 | rass.Local = Boolean.Parse(GetStringAttribute(asset,"local","")); | 1615 | rass.Local = Boolean.Parse(GetStringAttribute(asset,"local","")); |
1571 | rass.Temporary = Boolean.Parse(GetStringAttribute(asset,"temporary","")); | 1616 | rass.Temporary = Boolean.Parse(GetStringAttribute(asset,"temporary","")); |
1572 | rass.Data = Convert.FromBase64String(asset.InnerText); | 1617 | rass.Data = Convert.FromBase64String(asset.InnerText); |
diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs index f862af1..66572d5 100644 --- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs +++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs | |||
@@ -261,11 +261,8 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
261 | modified = (asset != null); | 261 | modified = (asset != null); |
262 | created = !modified; | 262 | created = !modified; |
263 | 263 | ||
264 | asset = new AssetBase(); | 264 | asset = new AssetBase(uuid, xml.GetAttribute("name"), SByte.Parse(xml.GetAttribute("type"))); |
265 | asset.FullID = uuid; | ||
266 | asset.Name = xml.GetAttribute("name"); | ||
267 | asset.Description = xml.GetAttribute("desc"); | 265 | asset.Description = xml.GetAttribute("desc"); |
268 | asset.Type = SByte.Parse(xml.GetAttribute("type")); | ||
269 | asset.Local = Int32.Parse(xml.GetAttribute("local")) != 0; | 266 | asset.Local = Int32.Parse(xml.GetAttribute("local")) != 0; |
270 | asset.Temporary = Int32.Parse(xml.GetAttribute("temporary")) != 0; | 267 | asset.Temporary = Int32.Parse(xml.GetAttribute("temporary")) != 0; |
271 | asset.Data = Convert.FromBase64String(xml.ReadElementContentAsString("Asset", "")); | 268 | asset.Data = Convert.FromBase64String(xml.ReadElementContentAsString("Asset", "")); |
@@ -341,11 +338,8 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
341 | modified = (asset != null); | 338 | modified = (asset != null); |
342 | created = !modified; | 339 | created = !modified; |
343 | 340 | ||
344 | asset = new AssetBase(); | 341 | asset = new AssetBase(uuid, xml.GetAttribute("name"), SByte.Parse(xml.GetAttribute("type"))); |
345 | asset.FullID = uuid; | ||
346 | asset.Name = xml.GetAttribute("name"); | ||
347 | asset.Description = xml.GetAttribute("desc"); | 342 | asset.Description = xml.GetAttribute("desc"); |
348 | asset.Type = SByte.Parse(xml.GetAttribute("type")); | ||
349 | asset.Local = Int32.Parse(xml.GetAttribute("local")) != 0; | 343 | asset.Local = Int32.Parse(xml.GetAttribute("local")) != 0; |
350 | asset.Temporary = Int32.Parse(xml.GetAttribute("temporary")) != 0; | 344 | asset.Temporary = Int32.Parse(xml.GetAttribute("temporary")) != 0; |
351 | asset.Data = Convert.FromBase64String(xml.ReadElementContentAsString("Asset", "")); | 345 | asset.Data = Convert.FromBase64String(xml.ReadElementContentAsString("Asset", "")); |
diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs index 4e03e67..01bfe00 100644 --- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs +++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs | |||
@@ -1869,10 +1869,9 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1869 | 1869 | ||
1870 | // Create AssetBase entity to hold the inlined asset | 1870 | // Create AssetBase entity to hold the inlined asset |
1871 | 1871 | ||
1872 | asset = new AssetBase(uuid, name); | 1872 | asset = new AssetBase(uuid, name, type); |
1873 | 1873 | ||
1874 | asset.Description = desc; | 1874 | asset.Description = desc; |
1875 | asset.Type = type; // type == 0 == texture | ||
1876 | asset.Local = local; | 1875 | asset.Local = local; |
1877 | asset.Temporary = temp; | 1876 | asset.Temporary = temp; |
1878 | 1877 | ||