From e3a04fcb7b6510b46bc4e24b9a1bc6e321774ac3 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 13 Jan 2010 03:08:34 +0000 Subject: Change the error messages on region region registration. This changes URM and region. The non-error case should be compatible, so no version bump. Untested. --- .../Services/Connectors/Grid/GridServiceConnector.cs | 18 +++++++++++++++--- OpenSim/Services/GridService/GridService.cs | 8 ++++---- OpenSim/Services/Interfaces/IGridService.cs | 2 +- 3 files changed, 20 insertions(+), 8 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs b/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs index 99aa3fb..1ba7344 100644 --- a/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs +++ b/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs @@ -86,7 +86,7 @@ namespace OpenSim.Services.Connectors #region IGridService - public virtual bool RegisterRegion(UUID scopeID, GridRegion regionInfo) + public virtual string RegisterRegion(UUID scopeID, GridRegion regionInfo) { Dictionary rinfo = regionInfo.ToKeyValuePairs(); Dictionary sendData = new Dictionary(); @@ -110,11 +110,23 @@ namespace OpenSim.Services.Connectors Dictionary replyData = ServerUtils.ParseXmlResponse(reply); if (replyData.ContainsKey("Result")&& (replyData["Result"].ToString().ToLower() == "success")) - return true; + { + return String.Empty; + } + else if (replyData.ContainsKey("Result")&& (replyData["Result"].ToString().ToLower() == "failure")) + { + m_log.DebugFormat("[GRID CONNECTOR]: unexpected result {0}", replyData["Result"].ToString()); + return replyData["Message"].ToString(); + } else if (!replyData.ContainsKey("Result")) + { m_log.DebugFormat("[GRID CONNECTOR]: reply data does not contain result field"); + } else + { m_log.DebugFormat("[GRID CONNECTOR]: unexpected result {0}", replyData["Result"].ToString()); + return "Unexpected result "+replyData["Result"].ToString(); + } } else @@ -125,7 +137,7 @@ namespace OpenSim.Services.Connectors m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message); } - return false; + return "Error communicating with grid service"; } public virtual bool DeregisterRegion(UUID regionID) diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index a500593..7749c37 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs @@ -62,7 +62,7 @@ namespace OpenSim.Services.GridService #region IGridService - public bool RegisterRegion(UUID scopeID, GridRegion regionInfos) + public string RegisterRegion(UUID scopeID, GridRegion regionInfos) { // This needs better sanity testing. What if regionInfo is registering in // overlapping coords? @@ -71,7 +71,7 @@ namespace OpenSim.Services.GridService { m_log.WarnFormat("[GRID SERVICE]: Region {0} tried to register in coordinates {1}, {2} which are already in use in scope {3}.", regionInfos.RegionID, regionInfos.RegionLocX, regionInfos.RegionLocY, scopeID); - return false; + return "Region overlaps another region"; } if ((region != null) && (region.RegionID == regionInfos.RegionID) && ((region.posX != regionInfos.RegionLocX) || (region.posY != regionInfos.RegionLocY))) @@ -101,7 +101,7 @@ namespace OpenSim.Services.GridService { m_log.WarnFormat("[GRID SERVICE]: Region {0} tried to register duplicate name with ID {1}.", regionInfos.RegionName, regionInfos.RegionID); - return false; + return "Duplicate region name"; } } } @@ -122,7 +122,7 @@ namespace OpenSim.Services.GridService m_log.DebugFormat("[GRID SERVICE]: Region {0} ({1}) registered successfully at {2}-{3}", regionInfos.RegionName, regionInfos.RegionID, regionInfos.RegionLocX, regionInfos.RegionLocY); - return true; + return String.Empty; } public bool DeregisterRegion(UUID regionID) diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs index e69e4cd..5135f6d 100644 --- a/OpenSim/Services/Interfaces/IGridService.cs +++ b/OpenSim/Services/Interfaces/IGridService.cs @@ -42,7 +42,7 @@ namespace OpenSim.Services.Interfaces /// /// /// Thrown if region registration failed - bool RegisterRegion(UUID scopeID, GridRegion regionInfos); + string RegisterRegion(UUID scopeID, GridRegion regionInfos); /// /// Deregister a region with the grid service. -- cgit v1.1