aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server/Handlers/Simulation
diff options
context:
space:
mode:
authorDiva Canto2010-01-17 18:04:55 -0800
committerDiva Canto2010-01-17 18:04:55 -0800
commitb2e6ec9e12ad07eb08496ebe8ca0476b793017d5 (patch)
treeac72f03b9cfca6f344d697f6d7581e5147ccf450 /OpenSim/Server/Handlers/Simulation
parentOops, forgot this one. (diff)
downloadopensim-SC_OLD-b2e6ec9e12ad07eb08496ebe8ca0476b793017d5.zip
opensim-SC_OLD-b2e6ec9e12ad07eb08496ebe8ca0476b793017d5.tar.gz
opensim-SC_OLD-b2e6ec9e12ad07eb08496ebe8ca0476b793017d5.tar.bz2
opensim-SC_OLD-b2e6ec9e12ad07eb08496ebe8ca0476b793017d5.tar.xz
Agent gets there through the Gatekeeper, but still a few quirks to fix.
Diffstat (limited to 'OpenSim/Server/Handlers/Simulation')
-rw-r--r--OpenSim/Server/Handlers/Simulation/AgentHandlers.cs32
-rw-r--r--OpenSim/Server/Handlers/Simulation/ObjectHandlers.cs12
2 files changed, 36 insertions, 8 deletions
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
52 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 52 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
53 private ISimulationService m_SimulationService; 53 private ISimulationService m_SimulationService;
54 54
55 public AgentHandler() { }
56
55 public AgentHandler(ISimulationService sim) 57 public AgentHandler(ISimulationService sim)
56 { 58 {
57 m_SimulationService = sim; 59 m_SimulationService = sim;
@@ -117,7 +119,7 @@ namespace OpenSim.Server.Handlers.Simulation
117 119
118 } 120 }
119 121
120 protected virtual void DoAgentPost(Hashtable request, Hashtable responsedata, UUID id) 122 protected void DoAgentPost(Hashtable request, Hashtable responsedata, UUID id)
121 { 123 {
122 OSDMap args = Utils.GetOSDMap((string)request["body"]); 124 OSDMap args = Utils.GetOSDMap((string)request["body"]);
123 if (args == null) 125 if (args == null)
@@ -171,7 +173,8 @@ namespace OpenSim.Server.Handlers.Simulation
171 173
172 // This is the meaning of POST agent 174 // This is the meaning of POST agent
173 //m_regionClient.AdjustUserInformation(aCircuit); 175 //m_regionClient.AdjustUserInformation(aCircuit);
174 bool result = m_SimulationService.CreateAgent(destination, aCircuit, teleportFlags, out reason); 176 //bool result = m_SimulationService.CreateAgent(destination, aCircuit, teleportFlags, out reason);
177 bool result = CreateAgent(destination, aCircuit, teleportFlags, out reason);
175 178
176 resp["reason"] = OSD.FromString(reason); 179 resp["reason"] = OSD.FromString(reason);
177 resp["success"] = OSD.FromBoolean(result); 180 resp["success"] = OSD.FromBoolean(result);
@@ -181,7 +184,13 @@ namespace OpenSim.Server.Handlers.Simulation
181 responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp); 184 responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp);
182 } 185 }
183 186
184 protected virtual void DoAgentPut(Hashtable request, Hashtable responsedata) 187 // subclasses can override this
188 protected virtual bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint teleportFlags, out string reason)
189 {
190 return m_SimulationService.CreateAgent(destination, aCircuit, teleportFlags, out reason);
191 }
192
193 protected void DoAgentPut(Hashtable request, Hashtable responsedata)
185 { 194 {
186 OSDMap args = Utils.GetOSDMap((string)request["body"]); 195 OSDMap args = Utils.GetOSDMap((string)request["body"]);
187 if (args == null) 196 if (args == null)
@@ -237,7 +246,7 @@ namespace OpenSim.Server.Handlers.Simulation
237 246
238 //agent.Dump(); 247 //agent.Dump();
239 // This is one of the meanings of PUT agent 248 // This is one of the meanings of PUT agent
240 result = m_SimulationService.UpdateAgent(destination, agent); 249 result = UpdateAgent(destination, agent);
241 250
242 } 251 }
243 else if ("AgentPosition".Equals(messageType)) 252 else if ("AgentPosition".Equals(messageType))
@@ -263,6 +272,12 @@ namespace OpenSim.Server.Handlers.Simulation
263 //responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp); ??? instead 272 //responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp); ??? instead
264 } 273 }
265 274
275 // subclasses cab override this
276 protected virtual bool UpdateAgent(GridRegion destination, AgentData agent)
277 {
278 return m_SimulationService.UpdateAgent(destination, agent);
279 }
280
266 protected virtual void DoAgentGet(Hashtable request, Hashtable responsedata, UUID id, UUID regionID) 281 protected virtual void DoAgentGet(Hashtable request, Hashtable responsedata, UUID id, UUID regionID)
267 { 282 {
268 GridRegion destination = new GridRegion(); 283 GridRegion destination = new GridRegion();
@@ -305,7 +320,7 @@ namespace OpenSim.Server.Handlers.Simulation
305 } 320 }
306 } 321 }
307 322
308 protected virtual void DoAgentDelete(Hashtable request, Hashtable responsedata, UUID id, string action, UUID regionID) 323 protected void DoAgentDelete(Hashtable request, Hashtable responsedata, UUID id, string action, UUID regionID)
309 { 324 {
310 m_log.Debug(" >>> DoDelete action:" + action + "; RegionID:" + regionID); 325 m_log.Debug(" >>> DoDelete action:" + action + "; RegionID:" + regionID);
311 326
@@ -313,7 +328,7 @@ namespace OpenSim.Server.Handlers.Simulation
313 destination.RegionID = regionID; 328 destination.RegionID = regionID;
314 329
315 if (action.Equals("release")) 330 if (action.Equals("release"))
316 m_SimulationService.ReleaseAgent(regionID, id, ""); 331 ReleaseAgent(regionID, id);
317 else 332 else
318 m_SimulationService.CloseAgent(destination, id); 333 m_SimulationService.CloseAgent(destination, id);
319 334
@@ -322,6 +337,11 @@ namespace OpenSim.Server.Handlers.Simulation
322 337
323 m_log.Debug("[AGENT HANDLER]: Agent Released/Deleted."); 338 m_log.Debug("[AGENT HANDLER]: Agent Released/Deleted.");
324 } 339 }
340
341 protected virtual void ReleaseAgent(UUID regionID, UUID id)
342 {
343 m_SimulationService.ReleaseAgent(regionID, id, "");
344 }
325 } 345 }
326 346
327} 347}
diff --git a/OpenSim/Server/Handlers/Simulation/ObjectHandlers.cs b/OpenSim/Server/Handlers/Simulation/ObjectHandlers.cs
index b6eabe3..33e5aa6 100644
--- a/OpenSim/Server/Handlers/Simulation/ObjectHandlers.cs
+++ b/OpenSim/Server/Handlers/Simulation/ObjectHandlers.cs
@@ -52,6 +52,8 @@ namespace OpenSim.Server.Handlers.Simulation
52 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 52 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
53 private ISimulationService m_SimulationService; 53 private ISimulationService m_SimulationService;
54 54
55 public ObjectHandler() { }
56
55 public ObjectHandler(ISimulationService sim) 57 public ObjectHandler(ISimulationService sim)
56 { 58 {
57 m_SimulationService = sim; 59 m_SimulationService = sim;
@@ -110,7 +112,7 @@ namespace OpenSim.Server.Handlers.Simulation
110 112
111 } 113 }
112 114
113 protected virtual void DoObjectPost(Hashtable request, Hashtable responsedata, UUID regionID) 115 protected void DoObjectPost(Hashtable request, Hashtable responsedata, UUID regionID)
114 { 116 {
115 OSDMap args = Utils.GetOSDMap((string)request["body"]); 117 OSDMap args = Utils.GetOSDMap((string)request["body"]);
116 if (args == null) 118 if (args == null)
@@ -181,7 +183,7 @@ namespace OpenSim.Server.Handlers.Simulation
181 try 183 try
182 { 184 {
183 // This is the meaning of POST object 185 // This is the meaning of POST object
184 result = m_SimulationService.CreateObject(destination, sog, false); 186 result = CreateObject(destination, sog);
185 } 187 }
186 catch (Exception e) 188 catch (Exception e)
187 { 189 {
@@ -192,6 +194,12 @@ namespace OpenSim.Server.Handlers.Simulation
192 responsedata["str_response_string"] = result.ToString(); 194 responsedata["str_response_string"] = result.ToString();
193 } 195 }
194 196
197 // subclasses can override this
198 protected virtual bool CreateObject(GridRegion destination, ISceneObject sog)
199 {
200 return m_SimulationService.CreateObject(destination, sog, false);
201 }
202
195 protected virtual void DoObjectPut(Hashtable request, Hashtable responsedata, UUID regionID) 203 protected virtual void DoObjectPut(Hashtable request, Hashtable responsedata, UUID regionID)
196 { 204 {
197 OSDMap args = Utils.GetOSDMap((string)request["body"]); 205 OSDMap args = Utils.GetOSDMap((string)request["body"]);