diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLRegionData.cs | 15 | ||||
-rw-r--r-- | OpenSim/Services/GridService/GridService.cs | 5 | ||||
-rw-r--r-- | OpenSim/Services/Interfaces/IGridService.cs | 61 |
3 files changed, 24 insertions, 57 deletions
diff --git a/OpenSim/Data/MySQL/MySQLRegionData.cs b/OpenSim/Data/MySQL/MySQLRegionData.cs index ced26a4..e13e12c 100644 --- a/OpenSim/Data/MySQL/MySQLRegionData.cs +++ b/OpenSim/Data/MySQL/MySQLRegionData.cs | |||
@@ -77,7 +77,7 @@ namespace OpenSim.Data.MySQL | |||
77 | cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString()); | 77 | cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString()); |
78 | 78 | ||
79 | List<RegionData> ret = RunCommand(cmd); | 79 | List<RegionData> ret = RunCommand(cmd); |
80 | if (ret == null) | 80 | if (ret.Count == 0) |
81 | return null; | 81 | return null; |
82 | 82 | ||
83 | return ret[0]; | 83 | return ret[0]; |
@@ -95,7 +95,7 @@ namespace OpenSim.Data.MySQL | |||
95 | cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString()); | 95 | cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString()); |
96 | 96 | ||
97 | List<RegionData> ret = RunCommand(cmd); | 97 | List<RegionData> ret = RunCommand(cmd); |
98 | if (ret == null) | 98 | if (ret.Count == 0) |
99 | return null; | 99 | return null; |
100 | 100 | ||
101 | return ret[0]; | 101 | return ret[0]; |
@@ -170,10 +170,7 @@ namespace OpenSim.Data.MySQL | |||
170 | result.Close(); | 170 | result.Close(); |
171 | CloseReaderCommand(cmd); | 171 | CloseReaderCommand(cmd); |
172 | 172 | ||
173 | if (retList.Count > 0) | 173 | return retList; |
174 | return retList; | ||
175 | |||
176 | return null; | ||
177 | } | 174 | } |
178 | 175 | ||
179 | public bool Store(RegionData data) | 176 | public bool Store(RegionData data) |
@@ -182,12 +179,6 @@ namespace OpenSim.Data.MySQL | |||
182 | data.Data.Remove("uuid"); | 179 | data.Data.Remove("uuid"); |
183 | if (data.Data.ContainsKey("ScopeID")) | 180 | if (data.Data.ContainsKey("ScopeID")) |
184 | data.Data.Remove("ScopeID"); | 181 | data.Data.Remove("ScopeID"); |
185 | if (data.Data.ContainsKey("regionName")) | ||
186 | data.Data.Remove("regionName"); | ||
187 | if (data.Data.ContainsKey("posX")) | ||
188 | data.Data.Remove("posX"); | ||
189 | if (data.Data.ContainsKey("posY")) | ||
190 | data.Data.Remove("posY"); | ||
191 | 182 | ||
192 | string[] fields = new List<string>(data.Data.Keys).ToArray(); | 183 | string[] fields = new List<string>(data.Data.Keys).ToArray(); |
193 | 184 | ||
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index 01ffa1d..41344ad 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs | |||
@@ -183,9 +183,9 @@ namespace OpenSim.Services.GridService | |||
183 | rdata.posX = (int)rinfo.RegionLocX; | 183 | rdata.posX = (int)rinfo.RegionLocX; |
184 | rdata.posY = (int)rinfo.RegionLocY; | 184 | rdata.posY = (int)rinfo.RegionLocY; |
185 | rdata.RegionID = rinfo.RegionID; | 185 | rdata.RegionID = rinfo.RegionID; |
186 | rdata.Data = rinfo.ToKeyValuePairs(); | ||
187 | rdata.RegionName = rinfo.RegionName; | 186 | rdata.RegionName = rinfo.RegionName; |
188 | 187 | rdata.Data = rinfo.ToKeyValuePairs(); | |
188 | rdata.Data["regionHandle"] = Utils.UIntsToLong((uint)rdata.posX, (uint)rdata.posY); | ||
189 | return rdata; | 189 | return rdata; |
190 | } | 190 | } |
191 | 191 | ||
@@ -196,6 +196,7 @@ namespace OpenSim.Services.GridService | |||
196 | rinfo.RegionLocY = rdata.posY; | 196 | rinfo.RegionLocY = rdata.posY; |
197 | rinfo.RegionID = rdata.RegionID; | 197 | rinfo.RegionID = rdata.RegionID; |
198 | rinfo.RegionName = rdata.RegionName; | 198 | rinfo.RegionName = rdata.RegionName; |
199 | rinfo.ScopeID = rdata.ScopeID; | ||
199 | 200 | ||
200 | return rinfo; | 201 | return rinfo; |
201 | } | 202 | } |
diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs index 4bdcde2..513b1b0 100644 --- a/OpenSim/Services/Interfaces/IGridService.cs +++ b/OpenSim/Services/Interfaces/IGridService.cs | |||
@@ -263,72 +263,47 @@ namespace OpenSim.Services.Interfaces | |||
263 | kvp["uuid"] = RegionID.ToString(); | 263 | kvp["uuid"] = RegionID.ToString(); |
264 | kvp["locX"] = RegionLocX.ToString(); | 264 | kvp["locX"] = RegionLocX.ToString(); |
265 | kvp["locY"] = RegionLocY.ToString(); | 265 | kvp["locY"] = RegionLocY.ToString(); |
266 | kvp["name"] = RegionName; | 266 | kvp["regionName"] = RegionName; |
267 | kvp["external_ip_address"] = ExternalEndPoint.Address.ToString(); | 267 | kvp["serverIP"] = ExternalHostName; //ExternalEndPoint.Address.ToString(); |
268 | kvp["external_port"] = ExternalEndPoint.Port.ToString(); | 268 | kvp["serverHttpPort"] = HttpPort.ToString(); |
269 | kvp["external_host_name"] = ExternalHostName; | 269 | kvp["serverURI"] = ServerURI; |
270 | kvp["http_port"] = HttpPort.ToString(); | ||
271 | kvp["internal_ip_address"] = InternalEndPoint.Address.ToString(); | ||
272 | kvp["internal_port"] = InternalEndPoint.Port.ToString(); | ||
273 | kvp["alternate_ports"] = m_allow_alternate_ports.ToString(); | ||
274 | kvp["server_uri"] = ServerURI; | ||
275 | 270 | ||
276 | return kvp; | 271 | return kvp; |
277 | } | 272 | } |
278 | 273 | ||
279 | public GridRegion(Dictionary<string, object> kvp) | 274 | public GridRegion(Dictionary<string, object> kvp) |
280 | { | 275 | { |
281 | if (kvp["uuid"] != null) | 276 | if (kvp.ContainsKey("uuid")) |
282 | RegionID = new UUID((string)kvp["uuid"]); | 277 | RegionID = new UUID((string)kvp["uuid"]); |
283 | 278 | ||
284 | if (kvp["locX"] != null) | 279 | if (kvp.ContainsKey("locX")) |
285 | RegionLocX = Convert.ToInt32((string)kvp["locX"]); | 280 | RegionLocX = Convert.ToInt32((string)kvp["locX"]); |
286 | 281 | ||
287 | if (kvp["locY"] != null) | 282 | if (kvp.ContainsKey("locY")) |
288 | RegionLocY = Convert.ToInt32((string)kvp["locY"]); | 283 | RegionLocY = Convert.ToInt32((string)kvp["locY"]); |
289 | 284 | ||
290 | if (kvp["name"] != null) | 285 | if (kvp.ContainsKey("regionName")) |
291 | RegionName = (string)kvp["name"]; | 286 | RegionName = (string)kvp["regionName"]; |
292 | 287 | ||
293 | if ((kvp["external_ip_address"] != null) && (kvp["external_port"] != null)) | 288 | if (kvp.ContainsKey("serverIP")) |
294 | { | 289 | { |
295 | int port = 0; | 290 | int port = 0; |
296 | Int32.TryParse((string)kvp["external_port"], out port); | 291 | //Int32.TryParse((string)kvp["serverPort"], out port); |
297 | IPEndPoint ep = new IPEndPoint(IPAddress.Parse((string)kvp["external_ip_address"]), port); | 292 | //IPEndPoint ep = new IPEndPoint(IPAddress.Parse((string)kvp["serverIP"]), port); |
298 | ExternalEndPoint = ep; | 293 | ExternalHostName = (string)kvp["serverIP"]; |
299 | } | 294 | } |
300 | else | 295 | else |
301 | ExternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), 0); | 296 | ExternalHostName = "127.0.0.1"; |
302 | 297 | ||
303 | if (kvp["external_host_name"] != null) | 298 | if (kvp.ContainsKey("serverHttpPort")) |
304 | ExternalHostName = (string)kvp["external_host_name"]; | ||
305 | |||
306 | if (kvp["http_port"] != null) | ||
307 | { | 299 | { |
308 | UInt32 port = 0; | 300 | UInt32 port = 0; |
309 | UInt32.TryParse((string)kvp["http_port"], out port); | 301 | UInt32.TryParse((string)kvp["serverHttpPort"], out port); |
310 | HttpPort = port; | 302 | HttpPort = port; |
311 | } | 303 | } |
312 | 304 | ||
313 | if ((kvp["internal_ip_address"] != null) && (kvp["internal_port"] != null)) | 305 | if (kvp.ContainsKey("serverURI")) |
314 | { | 306 | ServerURI = (string)kvp["serverURI"]; |
315 | int port = 0; | ||
316 | Int32.TryParse((string)kvp["internal_port"], out port); | ||
317 | IPEndPoint ep = new IPEndPoint(IPAddress.Parse((string)kvp["internal_ip_address"]), port); | ||
318 | InternalEndPoint = ep; | ||
319 | } | ||
320 | else | ||
321 | InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), 0); | ||
322 | |||
323 | if (kvp["alternate_ports"] != null) | ||
324 | { | ||
325 | bool alts = false; | ||
326 | Boolean.TryParse((string)kvp["alternate_ports"], out alts); | ||
327 | m_allow_alternate_ports = alts; | ||
328 | } | ||
329 | |||
330 | if (kvp["server_uri"] != null) | ||
331 | ServerURI = (string)kvp["server_uri"]; | ||
332 | } | 307 | } |
333 | } | 308 | } |
334 | 309 | ||