aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie2010-01-13 03:08:34 +0000
committerMelanie2010-01-13 03:08:34 +0000
commite3a04fcb7b6510b46bc4e24b9a1bc6e321774ac3 (patch)
tree08b7a8beb35f70cfd8f75400a339da37deed61f4
parentMerge branch 'master' of ssh://justincc@opensimulator.org/var/git/opensim (diff)
downloadopensim-SC-e3a04fcb7b6510b46bc4e24b9a1bc6e321774ac3.zip
opensim-SC-e3a04fcb7b6510b46bc4e24b9a1bc6e321774ac3.tar.gz
opensim-SC-e3a04fcb7b6510b46bc4e24b9a1bc6e321774ac3.tar.bz2
opensim-SC-e3a04fcb7b6510b46bc4e24b9a1bc6e321774ac3.tar.xz
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.
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs8
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs2
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs8
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs6
-rw-r--r--OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs16
-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
-rw-r--r--OpenSim/Tests/Clients/Grid/GridClient.cs17
9 files changed, 55 insertions, 30 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs
index f9cd90f..131febd 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs
@@ -200,7 +200,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
200 200
201 #region IGridService 201 #region IGridService
202 202
203 public bool RegisterRegion(UUID scopeID, GridRegion regionInfo) 203 public string RegisterRegion(UUID scopeID, GridRegion regionInfo)
204 { 204 {
205 // Region doesn't exist here. Trying to link remote region 205 // Region doesn't exist here. Trying to link remote region
206 if (regionInfo.RegionID.Equals(UUID.Zero)) 206 if (regionInfo.RegionID.Equals(UUID.Zero))
@@ -215,12 +215,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
215 215
216 // Try get the map image 216 // Try get the map image
217 m_HypergridServiceConnector.GetMapImage(regionInfo); 217 m_HypergridServiceConnector.GetMapImage(regionInfo);
218 return true; 218 return String.Empty;
219 } 219 }
220 else 220 else
221 { 221 {
222 m_log.Info("[HGrid]: No such region " + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort + "(" + regionInfo.InternalEndPoint.Port + ")"); 222 m_log.Info("[HGrid]: No such region " + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort + "(" + regionInfo.InternalEndPoint.Port + ")");
223 return false; 223 return "No such region";
224 } 224 }
225 // Note that these remote regions aren't registered in localBackend, so return null, no local listeners 225 // Note that these remote regions aren't registered in localBackend, so return null, no local listeners
226 } 226 }
@@ -469,7 +469,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
469 } 469 }
470 470
471 // Finally, link it 471 // Finally, link it
472 if (!RegisterRegion(UUID.Zero, regInfo)) 472 if (RegisterRegion(UUID.Zero, regInfo) != String.Empty)
473 { 473 {
474 m_log.Warn("[HGrid]: Unable to link region"); 474 m_log.Warn("[HGrid]: Unable to link region");
475 return false; 475 return false;
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs
index 1c72488..144b5a4 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs
@@ -169,7 +169,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
169 169
170 #region IGridService 170 #region IGridService
171 171
172 public bool RegisterRegion(UUID scopeID, GridRegion regionInfo) 172 public string RegisterRegion(UUID scopeID, GridRegion regionInfo)
173 { 173 {
174 return m_GridService.RegisterRegion(scopeID, regionInfo); 174 return m_GridService.RegisterRegion(scopeID, regionInfo);
175 } 175 }
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs
index 72c00fc..391e7c8 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs
@@ -135,12 +135,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
135 135
136 #region IGridService 136 #region IGridService
137 137
138 public override bool RegisterRegion(UUID scopeID, GridRegion regionInfo) 138 public override string RegisterRegion(UUID scopeID, GridRegion regionInfo)
139 { 139 {
140 if (m_LocalGridService.RegisterRegion(scopeID, regionInfo)) 140 string msg = m_LocalGridService.RegisterRegion(scopeID, regionInfo);
141
142 if (msg == String.Empty)
141 return base.RegisterRegion(scopeID, regionInfo); 143 return base.RegisterRegion(scopeID, regionInfo);
142 144
143 return false; 145 return msg;
144 } 146 }
145 147
146 public override bool DeregisterRegion(UUID regionID) 148 public override bool DeregisterRegion(UUID regionID)
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index bc9301b..234554e 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1562,9 +1562,9 @@ namespace OpenSim.Region.Framework.Scenes
1562 //m_sceneGridService.RegisterRegion(m_interregionCommsOut, RegionInfo); 1562 //m_sceneGridService.RegisterRegion(m_interregionCommsOut, RegionInfo);
1563 1563
1564 GridRegion region = new GridRegion(RegionInfo); 1564 GridRegion region = new GridRegion(RegionInfo);
1565 bool success = GridService.RegisterRegion(RegionInfo.ScopeID, region); 1565 string error = GridService.RegisterRegion(RegionInfo.ScopeID, region);
1566 if (!success) 1566 if (error != String.Empty)
1567 throw new Exception("Can't register with grid"); 1567 throw new Exception(error);
1568 1568
1569 m_sceneGridService.SetScene(this); 1569 m_sceneGridService.SetScene(this);
1570 m_sceneGridService.InformNeighborsThatRegionisUp(RequestModuleInterface<INeighbourService>(), RegionInfo); 1570 m_sceneGridService.InformNeighborsThatRegionisUp(RequestModuleInterface<INeighbourService>(), RegionInfo);
diff --git a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs
index d99b791..85a8738 100644
--- a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs
@@ -156,14 +156,14 @@ namespace OpenSim.Server.Handlers.Grid
156 m_log.DebugFormat("[GRID HANDLER]: exception unpacking region data: {0}", e); 156 m_log.DebugFormat("[GRID HANDLER]: exception unpacking region data: {0}", e);
157 } 157 }
158 158
159 bool result = false; 159 string result = "Error communicating with grid service";
160 if (rinfo != null) 160 if (rinfo != null)
161 result = m_GridService.RegisterRegion(scopeID, rinfo); 161 result = m_GridService.RegisterRegion(scopeID, rinfo);
162 162
163 if (result) 163 if (result == String.Empty)
164 return SuccessResult(); 164 return SuccessResult();
165 else 165 else
166 return FailureResult(); 166 return FailureResult(result);
167 } 167 }
168 168
169 byte[] Deregister(Dictionary<string, object> request) 169 byte[] Deregister(Dictionary<string, object> request)
@@ -432,6 +432,11 @@ namespace OpenSim.Server.Handlers.Grid
432 432
433 private byte[] FailureResult() 433 private byte[] FailureResult()
434 { 434 {
435 return FailureResult(String.Empty);
436 }
437
438 private byte[] FailureResult(string msg)
439 {
435 XmlDocument doc = new XmlDocument(); 440 XmlDocument doc = new XmlDocument();
436 441
437 XmlNode xmlnode = doc.CreateNode(XmlNodeType.XmlDeclaration, 442 XmlNode xmlnode = doc.CreateNode(XmlNodeType.XmlDeclaration,
@@ -449,6 +454,11 @@ namespace OpenSim.Server.Handlers.Grid
449 454
450 rootElement.AppendChild(result); 455 rootElement.AppendChild(result);
451 456
457 XmlElement message = doc.CreateElement("", "Message", "");
458 message.AppendChild(doc.CreateTextNode(msg));
459
460 rootElement.AppendChild(message);
461
452 return DocToBytes(doc); 462 return DocToBytes(doc);
453 } 463 }
454 464
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.
diff --git a/OpenSim/Tests/Clients/Grid/GridClient.cs b/OpenSim/Tests/Clients/Grid/GridClient.cs
index 972c0aa..8e33373 100644
--- a/OpenSim/Tests/Clients/Grid/GridClient.cs
+++ b/OpenSim/Tests/Clients/Grid/GridClient.cs
@@ -63,27 +63,28 @@ namespace OpenSim.Tests.Clients.GridClient
63 GridRegion r3 = CreateRegion("Test Region 3", 1005, 1000); 63 GridRegion r3 = CreateRegion("Test Region 3", 1005, 1000);
64 64
65 Console.WriteLine("[GRID CLIENT]: *** Registering region 1"); 65 Console.WriteLine("[GRID CLIENT]: *** Registering region 1");
66 bool success = m_Connector.RegisterRegion(UUID.Zero, r1); 66 string msg = m_Connector.RegisterRegion(UUID.Zero, r1);
67 if (success) 67 if (msg == String.Empty)
68 Console.WriteLine("[GRID CLIENT]: Successfully registered region 1"); 68 Console.WriteLine("[GRID CLIENT]: Successfully registered region 1");
69 else 69 else
70 Console.WriteLine("[GRID CLIENT]: region 1 failed to register"); 70 Console.WriteLine("[GRID CLIENT]: region 1 failed to register");
71 71
72 Console.WriteLine("[GRID CLIENT]: *** Registering region 2"); 72 Console.WriteLine("[GRID CLIENT]: *** Registering region 2");
73 success = m_Connector.RegisterRegion(UUID.Zero, r2); 73 msg = m_Connector.RegisterRegion(UUID.Zero, r2);
74 if (success) 74 if (msg == String.Empty)
75 Console.WriteLine("[GRID CLIENT]: Successfully registered region 2"); 75 Console.WriteLine("[GRID CLIENT]: Successfully registered region 2");
76 else 76 else
77 Console.WriteLine("[GRID CLIENT]: region 2 failed to register"); 77 Console.WriteLine("[GRID CLIENT]: region 2 failed to register");
78 78
79 Console.WriteLine("[GRID CLIENT]: *** Registering region 3"); 79 Console.WriteLine("[GRID CLIENT]: *** Registering region 3");
80 success = m_Connector.RegisterRegion(UUID.Zero, r3); 80 msg = m_Connector.RegisterRegion(UUID.Zero, r3);
81 if (success) 81 if (msg == String.Empty)
82 Console.WriteLine("[GRID CLIENT]: Successfully registered region 3"); 82 Console.WriteLine("[GRID CLIENT]: Successfully registered region 3");
83 else 83 else
84 Console.WriteLine("[GRID CLIENT]: region 3 failed to register"); 84 Console.WriteLine("[GRID CLIENT]: region 3 failed to register");
85 85
86 86
87 bool success;
87 Console.WriteLine("[GRID CLIENT]: *** Deregistering region 3"); 88 Console.WriteLine("[GRID CLIENT]: *** Deregistering region 3");
88 success = m_Connector.DeregisterRegion(r3.RegionID); 89 success = m_Connector.DeregisterRegion(r3.RegionID);
89 if (success) 90 if (success)
@@ -91,8 +92,8 @@ namespace OpenSim.Tests.Clients.GridClient
91 else 92 else
92 Console.WriteLine("[GRID CLIENT]: region 3 failed to deregister"); 93 Console.WriteLine("[GRID CLIENT]: region 3 failed to deregister");
93 Console.WriteLine("[GRID CLIENT]: *** Registering region 3 again"); 94 Console.WriteLine("[GRID CLIENT]: *** Registering region 3 again");
94 success = m_Connector.RegisterRegion(UUID.Zero, r3); 95 msg = m_Connector.RegisterRegion(UUID.Zero, r3);
95 if (success) 96 if (msg == String.Empty)
96 Console.WriteLine("[GRID CLIENT]: Successfully registered region 3"); 97 Console.WriteLine("[GRID CLIENT]: Successfully registered region 3");
97 else 98 else
98 Console.WriteLine("[GRID CLIENT]: region 3 failed to register"); 99 Console.WriteLine("[GRID CLIENT]: region 3 failed to register");