diff options
Diffstat (limited to 'OpenSim/Server/Handlers/Simulation')
-rw-r--r-- | OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index 9739e5a..05b00e5 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | |||
@@ -183,6 +183,8 @@ namespace OpenSim.Server.Handlers.Simulation | |||
183 | 183 | ||
184 | resp["reason"] = OSD.FromString(reason); | 184 | resp["reason"] = OSD.FromString(reason); |
185 | resp["success"] = OSD.FromBoolean(result); | 185 | resp["success"] = OSD.FromBoolean(result); |
186 | // Let's also send out the IP address of the caller back to the caller (HG 1.5) | ||
187 | resp["your_ip"] = OSD.FromString(GetCallerIP(request)); | ||
186 | 188 | ||
187 | // TODO: add reason if not String.Empty? | 189 | // TODO: add reason if not String.Empty? |
188 | responsedata["int_response_code"] = HttpStatusCode.OK; | 190 | responsedata["int_response_code"] = HttpStatusCode.OK; |
@@ -375,6 +377,24 @@ namespace OpenSim.Server.Handlers.Simulation | |||
375 | { | 377 | { |
376 | m_SimulationService.ReleaseAgent(regionID, id, ""); | 378 | m_SimulationService.ReleaseAgent(regionID, id, ""); |
377 | } | 379 | } |
380 | |||
381 | private string GetCallerIP(Hashtable req) | ||
382 | { | ||
383 | if (req.ContainsKey("headers")) | ||
384 | { | ||
385 | try | ||
386 | { | ||
387 | Hashtable headers = (Hashtable)req["headers"]; | ||
388 | if (headers.ContainsKey("remote_addr") && headers["remote_addr"] != null) | ||
389 | return headers["remote_addr"].ToString(); | ||
390 | } | ||
391 | catch (Exception e) | ||
392 | { | ||
393 | m_log.WarnFormat("[AGENT HANDLER]: exception in GetCallerIP: {0}", e.Message); | ||
394 | } | ||
395 | } | ||
396 | return string.Empty; | ||
397 | } | ||
378 | } | 398 | } |
379 | 399 | ||
380 | } | 400 | } |