diff options
Diffstat (limited to 'OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs')
-rw-r--r-- | OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs index 20eaa3a..3cf3416 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs | |||
@@ -140,7 +140,7 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
140 | { "ExtraData", OSDParser.SerializeJsonString(extraData) } | 140 | { "ExtraData", OSDParser.SerializeJsonString(extraData) } |
141 | }; | 141 | }; |
142 | 142 | ||
143 | OSDMap response = WebUtil.PostToService(m_ServerURI, requestArgs); | 143 | OSDMap response = SimianGrid.PostToService(m_ServerURI, requestArgs); |
144 | if (response["Success"].AsBoolean()) | 144 | if (response["Success"].AsBoolean()) |
145 | return String.Empty; | 145 | return String.Empty; |
146 | else | 146 | else |
@@ -156,7 +156,7 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
156 | { "Enabled", "0" } | 156 | { "Enabled", "0" } |
157 | }; | 157 | }; |
158 | 158 | ||
159 | OSDMap response = WebUtil.PostToService(m_ServerURI, requestArgs); | 159 | OSDMap response = SimianGrid.PostToService(m_ServerURI, requestArgs); |
160 | bool success = response["Success"].AsBoolean(); | 160 | bool success = response["Success"].AsBoolean(); |
161 | 161 | ||
162 | if (!success) | 162 | if (!success) |
@@ -203,7 +203,7 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
203 | 203 | ||
204 | // m_log.DebugFormat("[SIMIAN GRID CONNECTOR] request region with uuid {0}",regionID.ToString()); | 204 | // m_log.DebugFormat("[SIMIAN GRID CONNECTOR] request region with uuid {0}",regionID.ToString()); |
205 | 205 | ||
206 | OSDMap response = WebUtil.PostToService(m_ServerURI, requestArgs); | 206 | OSDMap response = SimianGrid.PostToService(m_ServerURI, requestArgs); |
207 | if (response["Success"].AsBoolean()) | 207 | if (response["Success"].AsBoolean()) |
208 | { | 208 | { |
209 | // m_log.DebugFormat("[SIMIAN GRID CONNECTOR] uuid request successful {0}",response["Name"].AsString()); | 209 | // m_log.DebugFormat("[SIMIAN GRID CONNECTOR] uuid request successful {0}",response["Name"].AsString()); |
@@ -231,7 +231,7 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
231 | 231 | ||
232 | // m_log.DebugFormat("[SIMIAN GRID CONNECTOR] request grid at {0}",position.ToString()); | 232 | // m_log.DebugFormat("[SIMIAN GRID CONNECTOR] request grid at {0}",position.ToString()); |
233 | 233 | ||
234 | OSDMap response = WebUtil.PostToService(m_ServerURI, requestArgs); | 234 | OSDMap response = SimianGrid.PostToService(m_ServerURI, requestArgs); |
235 | if (response["Success"].AsBoolean()) | 235 | if (response["Success"].AsBoolean()) |
236 | { | 236 | { |
237 | // m_log.DebugFormat("[SIMIAN GRID CONNECTOR] position request successful {0}",response["Name"].AsString()); | 237 | // m_log.DebugFormat("[SIMIAN GRID CONNECTOR] position request successful {0}",response["Name"].AsString()); |
@@ -272,7 +272,7 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
272 | 272 | ||
273 | // m_log.DebugFormat("[SIMIAN GRID CONNECTOR] request regions with name {0}",name); | 273 | // m_log.DebugFormat("[SIMIAN GRID CONNECTOR] request regions with name {0}",name); |
274 | 274 | ||
275 | OSDMap response = WebUtil.PostToService(m_ServerURI, requestArgs); | 275 | OSDMap response = SimianGrid.PostToService(m_ServerURI, requestArgs); |
276 | if (response["Success"].AsBoolean()) | 276 | if (response["Success"].AsBoolean()) |
277 | { | 277 | { |
278 | // m_log.DebugFormat("[SIMIAN GRID CONNECTOR] found regions with name {0}",name); | 278 | // m_log.DebugFormat("[SIMIAN GRID CONNECTOR] found regions with name {0}",name); |
@@ -310,7 +310,7 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
310 | //m_log.DebugFormat("[SIMIAN GRID CONNECTOR] request regions by range {0} to {1}",minPosition.ToString(),maxPosition.ToString()); | 310 | //m_log.DebugFormat("[SIMIAN GRID CONNECTOR] request regions by range {0} to {1}",minPosition.ToString(),maxPosition.ToString()); |
311 | 311 | ||
312 | 312 | ||
313 | OSDMap response = WebUtil.PostToService(m_ServerURI, requestArgs); | 313 | OSDMap response = SimianGrid.PostToService(m_ServerURI, requestArgs); |
314 | if (response["Success"].AsBoolean()) | 314 | if (response["Success"].AsBoolean()) |
315 | { | 315 | { |
316 | OSDArray array = response["Scenes"] as OSDArray; | 316 | OSDArray array = response["Scenes"] as OSDArray; |
@@ -341,6 +341,12 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
341 | return new List<GridRegion>(0); | 341 | return new List<GridRegion>(0); |
342 | } | 342 | } |
343 | 343 | ||
344 | public List<GridRegion> GetDefaultHypergridRegions(UUID scopeID) | ||
345 | { | ||
346 | // TODO: Allow specifying the default grid location | ||
347 | return GetDefaultRegions(scopeID); | ||
348 | } | ||
349 | |||
344 | public List<GridRegion> GetFallbackRegions(UUID scopeID, int x, int y) | 350 | public List<GridRegion> GetFallbackRegions(UUID scopeID, int x, int y) |
345 | { | 351 | { |
346 | GridRegion defRegion = GetNearestRegion(new Vector3d(x, y, 0.0), true); | 352 | GridRegion defRegion = GetNearestRegion(new Vector3d(x, y, 0.0), true); |
@@ -361,7 +367,7 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
361 | { "Enabled", "1" } | 367 | { "Enabled", "1" } |
362 | }; | 368 | }; |
363 | 369 | ||
364 | OSDMap response = WebUtil.PostToService(m_ServerURI, requestArgs); | 370 | OSDMap response = SimianGrid.PostToService(m_ServerURI, requestArgs); |
365 | if (response["Success"].AsBoolean()) | 371 | if (response["Success"].AsBoolean()) |
366 | { | 372 | { |
367 | // m_log.DebugFormat("[SIMIAN GRID CONNECTOR] found regions with name {0}",name); | 373 | // m_log.DebugFormat("[SIMIAN GRID CONNECTOR] found regions with name {0}",name); |
@@ -391,7 +397,7 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
391 | 397 | ||
392 | m_log.DebugFormat("[SIMIAN GRID CONNECTOR] request region flags for {0}",regionID.ToString()); | 398 | m_log.DebugFormat("[SIMIAN GRID CONNECTOR] request region flags for {0}",regionID.ToString()); |
393 | 399 | ||
394 | OSDMap response = WebUtil.PostToService(m_ServerURI, requestArgs); | 400 | OSDMap response = SimianGrid.PostToService(m_ServerURI, requestArgs); |
395 | if (response["Success"].AsBoolean()) | 401 | if (response["Success"].AsBoolean()) |
396 | { | 402 | { |
397 | OSDMap extraData = response["ExtraData"] as OSDMap; | 403 | OSDMap extraData = response["ExtraData"] as OSDMap; |
@@ -498,7 +504,7 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
498 | if (onlyEnabled) | 504 | if (onlyEnabled) |
499 | requestArgs["Enabled"] = "1"; | 505 | requestArgs["Enabled"] = "1"; |
500 | 506 | ||
501 | OSDMap response = WebUtil.PostToService(m_ServerURI, requestArgs); | 507 | OSDMap response = SimianGrid.PostToService(m_ServerURI, requestArgs); |
502 | if (response["Success"].AsBoolean()) | 508 | if (response["Success"].AsBoolean()) |
503 | { | 509 | { |
504 | return ResponseToGridRegion(response); | 510 | return ResponseToGridRegion(response); |
@@ -525,9 +531,13 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
525 | region.RegionName = response["Name"].AsString(); | 531 | region.RegionName = response["Name"].AsString(); |
526 | 532 | ||
527 | Vector3d minPosition = response["MinPosition"].AsVector3d(); | 533 | Vector3d minPosition = response["MinPosition"].AsVector3d(); |
534 | Vector3d maxPosition = response["MaxPosition"].AsVector3d(); | ||
528 | region.RegionLocX = (int)minPosition.X; | 535 | region.RegionLocX = (int)minPosition.X; |
529 | region.RegionLocY = (int)minPosition.Y; | 536 | region.RegionLocY = (int)minPosition.Y; |
530 | 537 | ||
538 | region.RegionSizeX = (int)maxPosition.X - (int)minPosition.X; | ||
539 | region.RegionSizeY = (int)maxPosition.Y - (int)minPosition.Y; | ||
540 | |||
531 | if ( ! extraData["HyperGrid"] ) { | 541 | if ( ! extraData["HyperGrid"] ) { |
532 | Uri httpAddress = response["Address"].AsUri(); | 542 | Uri httpAddress = response["Address"].AsUri(); |
533 | region.ExternalHostName = httpAddress.Host; | 543 | region.ExternalHostName = httpAddress.Host; |