diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs | 77 | ||||
-rw-r--r-- | OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs | 5 |
2 files changed, 2 insertions, 80 deletions
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs index 6043b70..bd35c6f 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs | |||
@@ -423,83 +423,6 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
423 | 423 | ||
424 | #endregion IGridService | 424 | #endregion IGridService |
425 | 425 | ||
426 | private void UploadMapTile(IScene scene) | ||
427 | { | ||
428 | string errorMessage = null; | ||
429 | |||
430 | // Create a PNG map tile and upload it to the AddMapTile API | ||
431 | byte[] pngData = Utils.EmptyBytes; | ||
432 | IMapImageGenerator tileGenerator = scene.RequestModuleInterface<IMapImageGenerator>(); | ||
433 | if (tileGenerator == null) | ||
434 | { | ||
435 | m_log.Warn("[SIMIAN GRID CONNECTOR]: Cannot upload PNG map tile without an IMapImageGenerator"); | ||
436 | return; | ||
437 | } | ||
438 | |||
439 | using (Image mapTile = tileGenerator.CreateMapTile()) | ||
440 | { | ||
441 | using (MemoryStream stream = new MemoryStream()) | ||
442 | { | ||
443 | mapTile.Save(stream, ImageFormat.Png); | ||
444 | pngData = stream.ToArray(); | ||
445 | } | ||
446 | } | ||
447 | |||
448 | List<MultipartForm.Element> postParameters = new List<MultipartForm.Element>() | ||
449 | { | ||
450 | new MultipartForm.Parameter("X", scene.RegionInfo.RegionLocX.ToString()), | ||
451 | new MultipartForm.Parameter("Y", scene.RegionInfo.RegionLocY.ToString()), | ||
452 | new MultipartForm.File("Tile", "tile.png", "image/png", pngData) | ||
453 | }; | ||
454 | |||
455 | // Make the remote storage request | ||
456 | try | ||
457 | { | ||
458 | HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(m_ServerURI); | ||
459 | |||
460 | HttpWebResponse response = MultipartForm.Post(request, postParameters); | ||
461 | using (Stream responseStream = response.GetResponseStream()) | ||
462 | { | ||
463 | string responseStr = null; | ||
464 | |||
465 | try | ||
466 | { | ||
467 | responseStr = responseStream.GetStreamString(); | ||
468 | OSD responseOSD = OSDParser.Deserialize(responseStr); | ||
469 | if (responseOSD.Type == OSDType.Map) | ||
470 | { | ||
471 | OSDMap responseMap = (OSDMap)responseOSD; | ||
472 | if (responseMap["Success"].AsBoolean()) | ||
473 | m_log.Info("[SIMIAN GRID CONNECTOR]: Uploaded " + pngData.Length + " byte PNG map tile to AddMapTile"); | ||
474 | else | ||
475 | errorMessage = "Upload failed: " + responseMap["Message"].AsString(); | ||
476 | } | ||
477 | else | ||
478 | { | ||
479 | errorMessage = "Response format was invalid:\n" + responseStr; | ||
480 | } | ||
481 | } | ||
482 | catch (Exception ex) | ||
483 | { | ||
484 | if (!String.IsNullOrEmpty(responseStr)) | ||
485 | errorMessage = "Failed to parse the response:\n" + responseStr; | ||
486 | else | ||
487 | errorMessage = "Failed to retrieve the response: " + ex.Message; | ||
488 | } | ||
489 | } | ||
490 | } | ||
491 | catch (WebException ex) | ||
492 | { | ||
493 | errorMessage = ex.Message; | ||
494 | } | ||
495 | |||
496 | if (!String.IsNullOrEmpty(errorMessage)) | ||
497 | { | ||
498 | m_log.WarnFormat("[SIMIAN GRID CONNECTOR]: Failed to store {0} byte PNG map tile for {1}: {2}", | ||
499 | pngData.Length, scene.RegionInfo.RegionName, errorMessage.Replace('\n', ' ')); | ||
500 | } | ||
501 | } | ||
502 | |||
503 | private GridRegion GetNearestRegion(Vector3d position, bool onlyEnabled) | 426 | private GridRegion GetNearestRegion(Vector3d position, bool onlyEnabled) |
504 | { | 427 | { |
505 | NameValueCollection requestArgs = new NameValueCollection | 428 | NameValueCollection requestArgs = new NameValueCollection |
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs index 08c5c50..563a1e7 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs | |||
@@ -191,15 +191,14 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
191 | return accounts; | 191 | return accounts; |
192 | } | 192 | } |
193 | 193 | ||
194 | <<<<<<< HEAD | ||
195 | public void InvalidateCache(UUID userID) | 194 | public void InvalidateCache(UUID userID) |
196 | { | 195 | { |
197 | m_accountCache.Remove(userID); | 196 | m_accountCache.Remove(userID); |
198 | ======= | 197 | } |
198 | |||
199 | public List<UserAccount> GetUserAccountsWhere(UUID scopeID, string query) | 199 | public List<UserAccount> GetUserAccountsWhere(UUID scopeID, string query) |
200 | { | 200 | { |
201 | return null; | 201 | return null; |
202 | >>>>>>> avn/ubitvar | ||
203 | } | 202 | } |
204 | 203 | ||
205 | public bool StoreUserAccount(UserAccount data) | 204 | public bool StoreUserAccount(UserAccount data) |