diff options
Diffstat (limited to 'OpenSim/Services/GridService')
-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); |