diff --git a/OpenSim/Data/IRegionData.cs b/OpenSim/Data/IRegionData.cs index b8de1d89e0..41c74f251a 100644 --- a/OpenSim/Data/IRegionData.cs +++ b/OpenSim/Data/IRegionData.cs @@ -70,6 +70,7 @@ namespace OpenSim.Data DefaultRegion = 1, // Used for new Rez. Random if multiple defined FallbackRegion = 2, // Regions we redirect to when the destination is down RegionOnline = 4, // Set when a region comes online, unset when it unregisters and DeleteOnUnregister is false - NoDirectLogin = 8 // Region unavailable for direct logins (by name) + NoDirectLogin = 8, // Region unavailable for direct logins (by name) + Persistent = 16 // Don't remove on unregister } } diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index 9bf986ecfa..66bbff037d 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs @@ -156,13 +156,14 @@ namespace OpenSim.Services.GridService public bool DeregisterRegion(UUID regionID) { m_log.DebugFormat("[GRID SERVICE]: Region {0} deregistered", regionID); - if (!m_DeleteOnUnregister) - { - RegionData region = m_Database.Get(regionID, UUID.Zero); - if (region == null) - return false; + RegionData region = m_Database.Get(regionID, UUID.Zero); + if (region == null) + return false; - int flags = Convert.ToInt32(region.Data["flags"]); + int flags = Convert.ToInt32(region.Data["flags"]); + + if (!m_DeleteOnUnregister || (flags & (int)OpenSim.Data.RegionFlags.Persistent) != 0) + { flags &= ~(int)OpenSim.Data.RegionFlags.RegionOnline; region.Data["flags"] = flags.ToString(); region.Data["last_seen"] = Util.UnixTimeSinceEpoch();