diff options
author | Diva Canto | 2009-09-25 06:02:41 -0700 |
---|---|---|
committer | Diva Canto | 2009-09-25 06:02:41 -0700 |
commit | 52e477b41f137ff2a0775722dcbaaa64fa5f3bc3 (patch) | |
tree | 8178d6b5562ce6d657aefe35eaa61b513923da56 /OpenSim/Services/GridService/GridService.cs | |
parent | Make the grid client deregister the test regions at the end, so that they don... (diff) | |
download | opensim-SC-52e477b41f137ff2a0775722dcbaaa64fa5f3bc3.zip opensim-SC-52e477b41f137ff2a0775722dcbaaa64fa5f3bc3.tar.gz opensim-SC-52e477b41f137ff2a0775722dcbaaa64fa5f3bc3.tar.bz2 opensim-SC-52e477b41f137ff2a0775722dcbaaa64fa5f3bc3.tar.xz |
Better guards on RegisterRegion in GridService.
Added serverPort to the fields that get stored (I think this is the UDP port).
Diffstat (limited to 'OpenSim/Services/GridService/GridService.cs')
-rw-r--r-- | OpenSim/Services/GridService/GridService.cs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index 68b7cdf..991acf2 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs | |||
@@ -56,19 +56,21 @@ namespace OpenSim.Services.GridService | |||
56 | 56 | ||
57 | public bool RegisterRegion(UUID scopeID, GridRegion regionInfos) | 57 | public bool RegisterRegion(UUID scopeID, GridRegion regionInfos) |
58 | { | 58 | { |
59 | if (m_Database.Get(regionInfos.RegionID, scopeID) != null) | ||
60 | { | ||
61 | m_log.WarnFormat("[GRID SERVICE]: Region {0} already registered in scope {1}.", regionInfos.RegionID, scopeID); | ||
62 | return false; | ||
63 | } | ||
64 | // This needs better sanity testing. What if regionInfo is registering in | 59 | // This needs better sanity testing. What if regionInfo is registering in |
65 | // overlapping coords? | 60 | // overlapping coords? |
66 | if (m_Database.Get(regionInfos.RegionLocX, regionInfos.RegionLocY, scopeID) != null) | 61 | RegionData region = m_Database.Get(regionInfos.RegionLocX, regionInfos.RegionLocY, scopeID); |
62 | if ((region != null) && (region.RegionID != regionInfos.RegionID)) | ||
67 | { | 63 | { |
68 | m_log.WarnFormat("[GRID SERVICE]: Region {0} tried to register in coordinates {1}, {2} which are already in use in scope {3}.", | 64 | m_log.WarnFormat("[GRID SERVICE]: Region {0} tried to register in coordinates {1}, {2} which are already in use in scope {3}.", |
69 | regionInfos.RegionID, regionInfos.RegionLocX, regionInfos.RegionLocY, scopeID); | 65 | regionInfos.RegionID, regionInfos.RegionLocX, regionInfos.RegionLocY, scopeID); |
70 | return false; | 66 | return false; |
71 | } | 67 | } |
68 | if ((region != null) && (region.RegionID == regionInfos.RegionID) && | ||
69 | ((region.posX != regionInfos.RegionLocX) || (region.posY != regionInfos.RegionLocY))) | ||
70 | { | ||
71 | // Region reregistering in other coordinates. Delete the old entry | ||
72 | m_Database.Delete(regionInfos.RegionID); | ||
73 | } | ||
72 | 74 | ||
73 | // Everything is ok, let's register | 75 | // Everything is ok, let's register |
74 | RegionData rdata = RegionInfo2RegionData(regionInfos); | 76 | RegionData rdata = RegionInfo2RegionData(regionInfos); |