From b2e6ec9e12ad07eb08496ebe8ca0476b793017d5 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 17 Jan 2010 18:04:55 -0800 Subject: Agent gets there through the Gatekeeper, but still a few quirks to fix. --- .../Server/Handlers/Simulation/AgentHandlers.cs | 32 ++++++++++++++++++---- 1 file changed, 26 insertions(+), 6 deletions(-) (limited to 'OpenSim/Server/Handlers/Simulation/AgentHandlers.cs') diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index 0c098d9..ab3250d 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs @@ -52,6 +52,8 @@ namespace OpenSim.Server.Handlers.Simulation private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private ISimulationService m_SimulationService; + public AgentHandler() { } + public AgentHandler(ISimulationService sim) { m_SimulationService = sim; @@ -117,7 +119,7 @@ namespace OpenSim.Server.Handlers.Simulation } - protected virtual void DoAgentPost(Hashtable request, Hashtable responsedata, UUID id) + protected void DoAgentPost(Hashtable request, Hashtable responsedata, UUID id) { OSDMap args = Utils.GetOSDMap((string)request["body"]); if (args == null) @@ -171,7 +173,8 @@ namespace OpenSim.Server.Handlers.Simulation // This is the meaning of POST agent //m_regionClient.AdjustUserInformation(aCircuit); - bool result = m_SimulationService.CreateAgent(destination, aCircuit, teleportFlags, out reason); + //bool result = m_SimulationService.CreateAgent(destination, aCircuit, teleportFlags, out reason); + bool result = CreateAgent(destination, aCircuit, teleportFlags, out reason); resp["reason"] = OSD.FromString(reason); resp["success"] = OSD.FromBoolean(result); @@ -181,7 +184,13 @@ namespace OpenSim.Server.Handlers.Simulation responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp); } - protected virtual void DoAgentPut(Hashtable request, Hashtable responsedata) + // subclasses can override this + protected virtual bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint teleportFlags, out string reason) + { + return m_SimulationService.CreateAgent(destination, aCircuit, teleportFlags, out reason); + } + + protected void DoAgentPut(Hashtable request, Hashtable responsedata) { OSDMap args = Utils.GetOSDMap((string)request["body"]); if (args == null) @@ -237,7 +246,7 @@ namespace OpenSim.Server.Handlers.Simulation //agent.Dump(); // This is one of the meanings of PUT agent - result = m_SimulationService.UpdateAgent(destination, agent); + result = UpdateAgent(destination, agent); } else if ("AgentPosition".Equals(messageType)) @@ -263,6 +272,12 @@ namespace OpenSim.Server.Handlers.Simulation //responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp); ??? instead } + // subclasses cab override this + protected virtual bool UpdateAgent(GridRegion destination, AgentData agent) + { + return m_SimulationService.UpdateAgent(destination, agent); + } + protected virtual void DoAgentGet(Hashtable request, Hashtable responsedata, UUID id, UUID regionID) { GridRegion destination = new GridRegion(); @@ -305,7 +320,7 @@ namespace OpenSim.Server.Handlers.Simulation } } - protected virtual void DoAgentDelete(Hashtable request, Hashtable responsedata, UUID id, string action, UUID regionID) + protected void DoAgentDelete(Hashtable request, Hashtable responsedata, UUID id, string action, UUID regionID) { m_log.Debug(" >>> DoDelete action:" + action + "; RegionID:" + regionID); @@ -313,7 +328,7 @@ namespace OpenSim.Server.Handlers.Simulation destination.RegionID = regionID; if (action.Equals("release")) - m_SimulationService.ReleaseAgent(regionID, id, ""); + ReleaseAgent(regionID, id); else m_SimulationService.CloseAgent(destination, id); @@ -322,6 +337,11 @@ namespace OpenSim.Server.Handlers.Simulation m_log.Debug("[AGENT HANDLER]: Agent Released/Deleted."); } + + protected virtual void ReleaseAgent(UUID regionID, UUID id) + { + m_SimulationService.ReleaseAgent(regionID, id, ""); + } } } -- cgit v1.1