aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services')
-rw-r--r--OpenSim/Services/Connectors/Grid/GridServiceConnector.cs18
-rw-r--r--OpenSim/Services/GridService/GridService.cs8
-rw-r--r--OpenSim/Services/Interfaces/IGridService.cs2
3 files changed, 20 insertions, 8 deletions
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
86 86
87 #region IGridService 87 #region IGridService
88 88
89 public virtual bool RegisterRegion(UUID scopeID, GridRegion regionInfo) 89 public virtual string RegisterRegion(UUID scopeID, GridRegion regionInfo)
90 { 90 {
91 Dictionary<string, object> rinfo = regionInfo.ToKeyValuePairs(); 91 Dictionary<string, object> rinfo = regionInfo.ToKeyValuePairs();
92 Dictionary<string, object> sendData = new Dictionary<string,object>(); 92 Dictionary<string, object> sendData = new Dictionary<string,object>();
@@ -110,11 +110,23 @@ namespace OpenSim.Services.Connectors
110 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); 110 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
111 111
112 if (replyData.ContainsKey("Result")&& (replyData["Result"].ToString().ToLower() == "success")) 112 if (replyData.ContainsKey("Result")&& (replyData["Result"].ToString().ToLower() == "success"))
113 return true; 113 {
114 return String.Empty;
115 }
116 else if (replyData.ContainsKey("Result")&& (replyData["Result"].ToString().ToLower() == "failure"))
117 {
118 m_log.DebugFormat("[GRID CONNECTOR]: unexpected result {0}", replyData["Result"].ToString());
119 return replyData["Message"].ToString();
120 }
114 else if (!replyData.ContainsKey("Result")) 121 else if (!replyData.ContainsKey("Result"))
122 {
115 m_log.DebugFormat("[GRID CONNECTOR]: reply data does not contain result field"); 123 m_log.DebugFormat("[GRID CONNECTOR]: reply data does not contain result field");
124 }
116 else 125 else
126 {
117 m_log.DebugFormat("[GRID CONNECTOR]: unexpected result {0}", replyData["Result"].ToString()); 127 m_log.DebugFormat("[GRID CONNECTOR]: unexpected result {0}", replyData["Result"].ToString());
128 return "Unexpected result "+replyData["Result"].ToString();
129 }
118 130
119 } 131 }
120 else 132 else
@@ -125,7 +137,7 @@ namespace OpenSim.Services.Connectors
125 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message); 137 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message);
126 } 138 }
127 139
128 return false; 140 return "Error communicating with grid service";
129 } 141 }
130 142
131 public virtual bool DeregisterRegion(UUID regionID) 143 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
62 62
63 #region IGridService 63 #region IGridService
64 64
65 public bool RegisterRegion(UUID scopeID, GridRegion regionInfos) 65 public string RegisterRegion(UUID scopeID, GridRegion regionInfos)
66 { 66 {
67 // This needs better sanity testing. What if regionInfo is registering in 67 // This needs better sanity testing. What if regionInfo is registering in
68 // overlapping coords? 68 // overlapping coords?
@@ -71,7 +71,7 @@ namespace OpenSim.Services.GridService
71 { 71 {
72 m_log.WarnFormat("[GRID SERVICE]: Region {0} tried to register in coordinates {1}, {2} which are already in use in scope {3}.", 72 m_log.WarnFormat("[GRID SERVICE]: Region {0} tried to register in coordinates {1}, {2} which are already in use in scope {3}.",
73 regionInfos.RegionID, regionInfos.RegionLocX, regionInfos.RegionLocY, scopeID); 73 regionInfos.RegionID, regionInfos.RegionLocX, regionInfos.RegionLocY, scopeID);
74 return false; 74 return "Region overlaps another region";
75 } 75 }
76 if ((region != null) && (region.RegionID == regionInfos.RegionID) && 76 if ((region != null) && (region.RegionID == regionInfos.RegionID) &&
77 ((region.posX != regionInfos.RegionLocX) || (region.posY != regionInfos.RegionLocY))) 77 ((region.posX != regionInfos.RegionLocX) || (region.posY != regionInfos.RegionLocY)))
@@ -101,7 +101,7 @@ namespace OpenSim.Services.GridService
101 { 101 {
102 m_log.WarnFormat("[GRID SERVICE]: Region {0} tried to register duplicate name with ID {1}.", 102 m_log.WarnFormat("[GRID SERVICE]: Region {0} tried to register duplicate name with ID {1}.",
103 regionInfos.RegionName, regionInfos.RegionID); 103 regionInfos.RegionName, regionInfos.RegionID);
104 return false; 104 return "Duplicate region name";
105 } 105 }
106 } 106 }
107 } 107 }
@@ -122,7 +122,7 @@ namespace OpenSim.Services.GridService
122 m_log.DebugFormat("[GRID SERVICE]: Region {0} ({1}) registered successfully at {2}-{3}", 122 m_log.DebugFormat("[GRID SERVICE]: Region {0} ({1}) registered successfully at {2}-{3}",
123 regionInfos.RegionName, regionInfos.RegionID, regionInfos.RegionLocX, regionInfos.RegionLocY); 123 regionInfos.RegionName, regionInfos.RegionID, regionInfos.RegionLocX, regionInfos.RegionLocY);
124 124
125 return true; 125 return String.Empty;
126 } 126 }
127 127
128 public bool DeregisterRegion(UUID regionID) 128 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
42 /// <param name="regionInfos"> </param> 42 /// <param name="regionInfos"> </param>
43 /// <returns></returns> 43 /// <returns></returns>
44 /// <exception cref="System.Exception">Thrown if region registration failed</exception> 44 /// <exception cref="System.Exception">Thrown if region registration failed</exception>
45 bool RegisterRegion(UUID scopeID, GridRegion regionInfos); 45 string RegisterRegion(UUID scopeID, GridRegion regionInfos);
46 46
47 /// <summary> 47 /// <summary>
48 /// Deregister a region with the grid service. 48 /// Deregister a region with the grid service.