diff options
author | Diva Canto | 2013-07-13 17:56:42 -0700 |
---|---|---|
committer | Diva Canto | 2013-07-13 17:56:42 -0700 |
commit | 931eb892d92bcd61194655ec02def6264d8b182e (patch) | |
tree | da7914320be0d075b0fb1df7db256feb186bcff3 | |
parent | Gatekeeper: stop bogus agents earlier, here at the Gatekeeper. No need to bot... (diff) | |
download | opensim-SC_OLD-931eb892d92bcd61194655ec02def6264d8b182e.zip opensim-SC_OLD-931eb892d92bcd61194655ec02def6264d8b182e.tar.gz opensim-SC_OLD-931eb892d92bcd61194655ec02def6264d8b182e.tar.bz2 opensim-SC_OLD-931eb892d92bcd61194655ec02def6264d8b182e.tar.xz |
Deleted GET agent all around. Not used.
5 files changed, 2 insertions, 134 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs index 9427961..2dc3d2a 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs | |||
@@ -250,26 +250,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
250 | return true; | 250 | return true; |
251 | } | 251 | } |
252 | 252 | ||
253 | public bool RetrieveAgent(GridRegion destination, UUID id, out IAgentData agent) | ||
254 | { | ||
255 | agent = null; | ||
256 | |||
257 | if (destination == null) | ||
258 | return false; | ||
259 | |||
260 | if (m_scenes.ContainsKey(destination.RegionID)) | ||
261 | { | ||
262 | // m_log.DebugFormat( | ||
263 | // "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate", | ||
264 | // s.RegionInfo.RegionName, destination.RegionHandle); | ||
265 | |||
266 | return m_scenes[destination.RegionID].IncomingRetrieveRootAgent(id, out agent); | ||
267 | } | ||
268 | |||
269 | //m_log.Debug("[LOCAL COMMS]: region not found for ChildAgentUpdate"); | ||
270 | return false; | ||
271 | } | ||
272 | |||
273 | public bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string version, out string reason) | 253 | public bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string version, out string reason) |
274 | { | 254 | { |
275 | reason = "Communications failure"; | 255 | reason = "Communications failure"; |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs index d120e11..4aa2d2a 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs | |||
@@ -212,24 +212,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
212 | return m_remoteConnector.UpdateAgent(destination, cAgentData); | 212 | return m_remoteConnector.UpdateAgent(destination, cAgentData); |
213 | } | 213 | } |
214 | 214 | ||
215 | public bool RetrieveAgent(GridRegion destination, UUID id, out IAgentData agent) | ||
216 | { | ||
217 | agent = null; | ||
218 | |||
219 | if (destination == null) | ||
220 | return false; | ||
221 | |||
222 | // Try local first | ||
223 | if (m_localBackend.RetrieveAgent(destination, id, out agent)) | ||
224 | return true; | ||
225 | |||
226 | // else do the remote thing | ||
227 | if (!m_localBackend.IsLocalRegion(destination.RegionID)) | ||
228 | return m_remoteConnector.RetrieveAgent(destination, id, out agent); | ||
229 | |||
230 | return false; | ||
231 | } | ||
232 | |||
233 | public bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string version, out string reason) | 215 | public bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string version, out string reason) |
234 | { | 216 | { |
235 | reason = "Communications failure"; | 217 | reason = "Communications failure"; |
diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index 40a34c6..17a8ef4 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | |||
@@ -90,12 +90,7 @@ namespace OpenSim.Server.Handlers.Simulation | |||
90 | 90 | ||
91 | // Next, let's parse the verb | 91 | // Next, let's parse the verb |
92 | string method = (string)request["http-method"]; | 92 | string method = (string)request["http-method"]; |
93 | if (method.Equals("GET")) | 93 | if (method.Equals("DELETE")) |
94 | { | ||
95 | DoAgentGet(request, responsedata, agentID, regionID); | ||
96 | return responsedata; | ||
97 | } | ||
98 | else if (method.Equals("DELETE")) | ||
99 | { | 94 | { |
100 | DoAgentDelete(request, responsedata, agentID, action, regionID); | 95 | DoAgentDelete(request, responsedata, agentID, action, regionID); |
101 | return responsedata; | 96 | return responsedata; |
@@ -107,7 +102,7 @@ namespace OpenSim.Server.Handlers.Simulation | |||
107 | } | 102 | } |
108 | else | 103 | else |
109 | { | 104 | { |
110 | m_log.InfoFormat("[AGENT HANDLER]: method {0} not supported in agent message (caller is {1})", method, Util.GetCallerIP(request)); | 105 | m_log.ErrorFormat("[AGENT HANDLER]: method {0} not supported in agent message {1} (caller is {2})", method, (string)request["uri"], Util.GetCallerIP(request)); |
111 | responsedata["int_response_code"] = HttpStatusCode.MethodNotAllowed; | 106 | responsedata["int_response_code"] = HttpStatusCode.MethodNotAllowed; |
112 | responsedata["str_response_string"] = "Method not allowed"; | 107 | responsedata["str_response_string"] = "Method not allowed"; |
113 | 108 | ||
@@ -156,58 +151,6 @@ namespace OpenSim.Server.Handlers.Simulation | |||
156 | // Console.WriteLine("str_response_string [{0}]", responsedata["str_response_string"]); | 151 | // Console.WriteLine("str_response_string [{0}]", responsedata["str_response_string"]); |
157 | } | 152 | } |
158 | 153 | ||
159 | protected virtual void DoAgentGet(Hashtable request, Hashtable responsedata, UUID id, UUID regionID) | ||
160 | { | ||
161 | if (m_SimulationService == null) | ||
162 | { | ||
163 | m_log.Debug("[AGENT HANDLER]: Agent GET called. Harmless but useless."); | ||
164 | responsedata["content_type"] = "application/json"; | ||
165 | responsedata["int_response_code"] = HttpStatusCode.NotImplemented; | ||
166 | responsedata["str_response_string"] = string.Empty; | ||
167 | |||
168 | return; | ||
169 | } | ||
170 | |||
171 | GridRegion destination = new GridRegion(); | ||
172 | destination.RegionID = regionID; | ||
173 | |||
174 | IAgentData agent = null; | ||
175 | bool result = m_SimulationService.RetrieveAgent(destination, id, out agent); | ||
176 | OSDMap map = null; | ||
177 | if (result) | ||
178 | { | ||
179 | if (agent != null) // just to make sure | ||
180 | { | ||
181 | map = agent.Pack(); | ||
182 | string strBuffer = ""; | ||
183 | try | ||
184 | { | ||
185 | strBuffer = OSDParser.SerializeJsonString(map); | ||
186 | } | ||
187 | catch (Exception e) | ||
188 | { | ||
189 | m_log.WarnFormat("[AGENT HANDLER]: Exception thrown on serialization of DoAgentGet: {0}", e.Message); | ||
190 | responsedata["int_response_code"] = HttpStatusCode.InternalServerError; | ||
191 | // ignore. buffer will be empty, caller should check. | ||
192 | } | ||
193 | |||
194 | responsedata["content_type"] = "application/json"; | ||
195 | responsedata["int_response_code"] = HttpStatusCode.OK; | ||
196 | responsedata["str_response_string"] = strBuffer; | ||
197 | } | ||
198 | else | ||
199 | { | ||
200 | responsedata["int_response_code"] = HttpStatusCode.InternalServerError; | ||
201 | responsedata["str_response_string"] = "Internal error"; | ||
202 | } | ||
203 | } | ||
204 | else | ||
205 | { | ||
206 | responsedata["int_response_code"] = HttpStatusCode.NotFound; | ||
207 | responsedata["str_response_string"] = "Not Found"; | ||
208 | } | ||
209 | } | ||
210 | |||
211 | protected void DoAgentDelete(Hashtable request, Hashtable responsedata, UUID id, string action, UUID regionID) | 154 | protected void DoAgentDelete(Hashtable request, Hashtable responsedata, UUID id, string action, UUID regionID) |
212 | { | 155 | { |
213 | m_log.Debug(" >>> DoDelete action:" + action + "; RegionID:" + regionID); | 156 | m_log.Debug(" >>> DoDelete action:" + action + "; RegionID:" + regionID); |
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index f51c809..7eb8c24 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs | |||
@@ -271,41 +271,6 @@ namespace OpenSim.Services.Connectors.Simulation | |||
271 | return false; | 271 | return false; |
272 | } | 272 | } |
273 | 273 | ||
274 | /// <summary> | ||
275 | /// Not sure what sequence causes this function to be invoked. The only calling | ||
276 | /// path is through the GET method | ||
277 | /// </summary> | ||
278 | public bool RetrieveAgent(GridRegion destination, UUID id, out IAgentData agent) | ||
279 | { | ||
280 | // m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: RetrieveAgent start"); | ||
281 | |||
282 | agent = null; | ||
283 | |||
284 | // Eventually, we want to use a caps url instead of the agentID | ||
285 | string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/"; | ||
286 | |||
287 | try | ||
288 | { | ||
289 | OSDMap result = WebUtil.GetFromService(uri, 10000); | ||
290 | if (result["Success"].AsBoolean()) | ||
291 | { | ||
292 | // OSDMap args = Util.GetOSDMap(result["_RawResult"].AsString()); | ||
293 | OSDMap args = (OSDMap)result["_Result"]; | ||
294 | if (args != null) | ||
295 | { | ||
296 | agent = new CompleteAgentData(); | ||
297 | agent.Unpack(args, null); | ||
298 | return true; | ||
299 | } | ||
300 | } | ||
301 | } | ||
302 | catch (Exception e) | ||
303 | { | ||
304 | m_log.Warn("[REMOTE SIMULATION CONNECTOR]: UpdateAgent failed with exception: " + e.ToString()); | ||
305 | } | ||
306 | |||
307 | return false; | ||
308 | } | ||
309 | 274 | ||
310 | /// <summary> | 275 | /// <summary> |
311 | /// </summary> | 276 | /// </summary> |
diff --git a/OpenSim/Services/Interfaces/ISimulationService.cs b/OpenSim/Services/Interfaces/ISimulationService.cs index b10a85c..c9cbd1a 100644 --- a/OpenSim/Services/Interfaces/ISimulationService.cs +++ b/OpenSim/Services/Interfaces/ISimulationService.cs | |||
@@ -75,8 +75,6 @@ namespace OpenSim.Services.Interfaces | |||
75 | /// <returns></returns> | 75 | /// <returns></returns> |
76 | bool UpdateAgent(GridRegion destination, AgentPosition data); | 76 | bool UpdateAgent(GridRegion destination, AgentPosition data); |
77 | 77 | ||
78 | bool RetrieveAgent(GridRegion destination, UUID id, out IAgentData agent); | ||
79 | |||
80 | bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string version, out string reason); | 78 | bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string version, out string reason); |
81 | 79 | ||
82 | /// <summary> | 80 | /// <summary> |