From 9727e3d66b7324a2fa63e1cd95a77e2a82882723 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 10 Jan 2010 02:44:57 +0000 Subject: Add "Persistent" flag to regions table flags values --- OpenSim/Data/IRegionData.cs | 3 ++- OpenSim/Services/GridService/GridService.cs | 13 +++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Data/IRegionData.cs b/OpenSim/Data/IRegionData.cs index b8de1d8..41c74f2 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 9bf986e..66bbff0 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(); -- cgit v1.1