mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 03:06:05 +08:00
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.
This commit is contained in:
@@ -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<string, object> rinfo = regionInfo.ToKeyValuePairs();
|
||||
Dictionary<string, object> sendData = new Dictionary<string,object>();
|
||||
@@ -110,11 +110,23 @@ namespace OpenSim.Services.Connectors
|
||||
Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
|
||||
|
||||
if (replyData.ContainsKey("Result")&& (replyData["Result"].ToString().ToLower() == "success"))
|
||||
return true;
|
||||
else if (!replyData.ContainsKey("Result"))
|
||||
m_log.DebugFormat("[GRID CONNECTOR]: reply data does not contain result field");
|
||||
else
|
||||
{
|
||||
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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace OpenSim.Services.Interfaces
|
||||
/// <param name="regionInfos"> </param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="System.Exception">Thrown if region registration failed</exception>
|
||||
bool RegisterRegion(UUID scopeID, GridRegion regionInfos);
|
||||
string RegisterRegion(UUID scopeID, GridRegion regionInfos);
|
||||
|
||||
/// <summary>
|
||||
/// Deregister a region with the grid service.
|
||||
|
||||
Reference in New Issue
Block a user