aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/InterGrid/OGSRadmin.cs
diff options
context:
space:
mode:
authorMelanie2012-11-11 16:31:01 +0000
committerMelanie2012-11-11 16:31:01 +0000
commit389077345f9fc78fddcaa39e29daa532a32815d6 (patch)
treea455d88d93ac5fe984ebf5342276ca1ddc831442 /OpenSim/Region/CoreModules/InterGrid/OGSRadmin.cs
parentMerge branch 'master' into careminster (diff)
parentDeleted 2 obsolete modules: OGSRadmin and OpenGridProtocol. They were still I... (diff)
downloadopensim-SC-389077345f9fc78fddcaa39e29daa532a32815d6.zip
opensim-SC-389077345f9fc78fddcaa39e29daa532a32815d6.tar.gz
opensim-SC-389077345f9fc78fddcaa39e29daa532a32815d6.tar.bz2
opensim-SC-389077345f9fc78fddcaa39e29daa532a32815d6.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
Diffstat (limited to 'OpenSim/Region/CoreModules/InterGrid/OGSRadmin.cs')
-rw-r--r--OpenSim/Region/CoreModules/InterGrid/OGSRadmin.cs150
1 files changed, 0 insertions, 150 deletions
diff --git a/OpenSim/Region/CoreModules/InterGrid/OGSRadmin.cs b/OpenSim/Region/CoreModules/InterGrid/OGSRadmin.cs
deleted file mode 100644
index 2cc0a07..0000000
--- a/OpenSim/Region/CoreModules/InterGrid/OGSRadmin.cs
+++ /dev/null
@@ -1,150 +0,0 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections;
30using System.Collections.Generic;
31using System.Net;
32using System.Reflection;
33using System.Text;
34using log4net;
35using Nini.Config;
36using Nwc.XmlRpc;
37using OpenMetaverse;
38using OpenSim.Framework;
39using OpenSim.Framework.Communications;
40using OpenSim.Framework.Servers;
41using OpenSim.Region.Framework.Interfaces;
42using OpenSim.Region.Framework.Scenes;
43
44namespace OpenSim.Region.CoreModules.InterGrid
45{
46 public class OGSRadmin : IRegionModule
47 {
48 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
49 private readonly List<Scene> m_scenes = new List<Scene>();
50 private IConfigSource m_settings;
51
52 #region Implementation of IRegionModuleBase
53
54 public string Name
55 {
56 get { return "OGS Supporting RAdmin"; }
57 }
58
59
60 public void Initialise(IConfigSource source)
61 {
62 m_settings = source;
63 }
64
65 public void Close()
66 {
67
68 }
69
70 public void AddRegion(Scene scene)
71 {
72 lock (m_scenes)
73 m_scenes.Add(scene);
74 }
75
76 public void RemoveRegion(Scene scene)
77 {
78 lock (m_scenes)
79 m_scenes.Remove(scene);
80 }
81
82 public void RegionLoaded(Scene scene)
83 {
84
85 }
86
87 public void PostInitialise()
88 {
89 if (m_settings.Configs["Startup"].GetBoolean("gridmode", false))
90 {
91 MainServer.Instance.AddXmlRPCHandler("grid_message", GridWideMessage);
92 }
93 }
94
95 #endregion
96
97 #region IRegionModule
98
99 public void Initialise(Scene scene, IConfigSource source)
100 {
101 m_settings = source;
102
103 lock (m_scenes)
104 m_scenes.Add(scene);
105 }
106
107 public bool IsSharedModule
108 {
109 get { return true; }
110 }
111
112 #endregion
113
114 public XmlRpcResponse GridWideMessage(XmlRpcRequest req, IPEndPoint remoteClient)
115 {
116 XmlRpcResponse response = new XmlRpcResponse();
117 Hashtable responseData = new Hashtable();
118
119 Hashtable requestData = (Hashtable)req.Params[0];
120
121 // REFACTORING PROBLEM. This authorization needs to be replaced with some other
122 //if ((!requestData.Contains("password") || (string)requestData["password"] != m_com.NetworkServersInfo.GridRecvKey))
123 //{
124 // responseData["accepted"] = false;
125 // responseData["success"] = false;
126 // responseData["error"] = "Invalid Key";
127 // response.Value = responseData;
128 // return response;
129 //}
130
131 string message = (string)requestData["message"];
132 string user = (string)requestData["user"];
133 m_log.InfoFormat("[RADMIN]: Broadcasting: {0}", message);
134
135 lock (m_scenes)
136 foreach (Scene scene in m_scenes)
137 {
138 IDialogModule dialogModule = scene.RequestModuleInterface<IDialogModule>();
139 if (dialogModule != null)
140 dialogModule.SendNotificationToUsersInRegion(UUID.Random(), user, message);
141 }
142
143 responseData["accepted"] = true;
144 responseData["success"] = true;
145 response.Value = responseData;
146
147 return response;
148 }
149 }
150}