diff options
author | morphw | 2007-05-20 02:31:20 +0000 |
---|---|---|
committer | morphw | 2007-05-20 02:31:20 +0000 |
commit | 723008d8c9835bca365a8e4ea86c9c2c0cfda569 (patch) | |
tree | 6fff99591c8fc788badd6e95273b034b755b9f88 /OpenGridServices.GridServer | |
parent | Done more work on the world map downloading functionality (diff) | |
download | opensim-SC_OLD-723008d8c9835bca365a8e4ea86c9c2c0cfda569.zip opensim-SC_OLD-723008d8c9835bca365a8e4ea86c9c2c0cfda569.tar.gz opensim-SC_OLD-723008d8c9835bca365a8e4ea86c9c2c0cfda569.tar.bz2 opensim-SC_OLD-723008d8c9835bca365a8e4ea86c9c2c0cfda569.tar.xz |
Add XmlRpcMapBlockMethod handlers to service map-block XmlRpc requests from region servers (on behalf of users)
Diffstat (limited to 'OpenGridServices.GridServer')
-rw-r--r-- | OpenGridServices.GridServer/GridManager.cs | 57 | ||||
-rw-r--r-- | OpenGridServices.GridServer/Main.cs | 1 |
2 files changed, 58 insertions, 0 deletions
diff --git a/OpenGridServices.GridServer/GridManager.cs b/OpenGridServices.GridServer/GridManager.cs index 539fbb1..54e4bb7 100644 --- a/OpenGridServices.GridServer/GridManager.cs +++ b/OpenGridServices.GridServer/GridManager.cs | |||
@@ -241,6 +241,63 @@ namespace OpenGridServices.GridServer | |||
241 | return response; | 241 | return response; |
242 | } | 242 | } |
243 | 243 | ||
244 | public XmlRpcResponse XmlRpcMapBlockMethod(XmlRpcRequest request) | ||
245 | { | ||
246 | int xmin=980, ymin=980, xmax=1020, ymax=1020; | ||
247 | |||
248 | Hashtable requestData = (Hashtable)request.Params[0]; | ||
249 | if (requestData.ContainsKey("xmin")) | ||
250 | { | ||
251 | xmin = (Int32)requestData["xmin"]; | ||
252 | } | ||
253 | if (requestData.ContainsKey("ymin")) | ||
254 | { | ||
255 | ymin = (Int32)requestData["ymin"]; | ||
256 | } | ||
257 | if (requestData.ContainsKey("xmax")) | ||
258 | { | ||
259 | xmax = (Int32)requestData["xmax"]; | ||
260 | } | ||
261 | if (requestData.ContainsKey("ymax")) | ||
262 | { | ||
263 | ymax = (Int32)requestData["ymax"]; | ||
264 | } | ||
265 | |||
266 | XmlRpcResponse response = new XmlRpcResponse(); | ||
267 | Hashtable responseData = new Hashtable(); | ||
268 | response.Value = responseData; | ||
269 | IList simProfileList = new ArrayList(); | ||
270 | |||
271 | SimProfileData simProfile; | ||
272 | for (int x = xmin; x < xmax; x++) | ||
273 | { | ||
274 | for (int y = ymin; y < ymax; y++) | ||
275 | { | ||
276 | simProfile = getRegion(Helpers.UIntsToLong((uint)(x * 256), (uint)(y * 256))); | ||
277 | if (simProfile != null) | ||
278 | { | ||
279 | Hashtable simProfileBlock = new Hashtable(); | ||
280 | simProfileBlock["x"] = x; | ||
281 | simProfileBlock["y"] = y; | ||
282 | simProfileBlock["name"] = simProfile.regionName; | ||
283 | simProfileBlock["access"] = 0; | ||
284 | simProfileBlock["region-flags"] = 0; | ||
285 | simProfileBlock["water-height"] = 20; | ||
286 | simProfileBlock["agents"] = 1; | ||
287 | simProfileBlock["map-image-id"] = simProfile.regionMapTextureID.ToString(); | ||
288 | |||
289 | simProfileList.Add(simProfileBlock); | ||
290 | } | ||
291 | } | ||
292 | } | ||
293 | |||
294 | responseData["sim-profiles"] = simProfileList; | ||
295 | |||
296 | return response; | ||
297 | } | ||
298 | |||
299 | |||
300 | |||
244 | /// <summary> | 301 | /// <summary> |
245 | /// Performs a REST Get Operation | 302 | /// Performs a REST Get Operation |
246 | /// </summary> | 303 | /// </summary> |
diff --git a/OpenGridServices.GridServer/Main.cs b/OpenGridServices.GridServer/Main.cs index 8fdce08..97f15c9 100644 --- a/OpenGridServices.GridServer/Main.cs +++ b/OpenGridServices.GridServer/Main.cs | |||
@@ -121,6 +121,7 @@ namespace OpenGridServices.GridServer | |||
121 | GridManagementAgent GridManagerAgent = new GridManagementAgent(httpServer,"gridserver",Cfg.SimSendKey,Cfg.SimRecvKey,managercallback); | 121 | GridManagementAgent GridManagerAgent = new GridManagementAgent(httpServer,"gridserver",Cfg.SimSendKey,Cfg.SimRecvKey,managercallback); |
122 | 122 | ||
123 | httpServer.AddXmlRPCHandler("simulator_login", m_gridManager.XmlRpcLoginToSimulatorMethod); | 123 | httpServer.AddXmlRPCHandler("simulator_login", m_gridManager.XmlRpcLoginToSimulatorMethod); |
124 | httpServer.AddXmlRPCHandler("map_block", m_gridManager.XmlRpcMapBlockMethod); | ||
124 | 125 | ||
125 | httpServer.AddRestHandler("GET", "/sims/", m_gridManager.RestGetSimMethod); | 126 | httpServer.AddRestHandler("GET", "/sims/", m_gridManager.RestGetSimMethod); |
126 | httpServer.AddRestHandler("POST", "/sims/", m_gridManager.RestSetSimMethod); | 127 | httpServer.AddRestHandler("POST", "/sims/", m_gridManager.RestSetSimMethod); |