Add "Persistent" flag to regions table flags values

slimupdates
Melanie 2010-01-10 02:44:57 +00:00
parent e189b3056f
commit 9727e3d66b
2 changed files with 9 additions and 7 deletions

View File

@ -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
}
}

View File

@ -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();