<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://osimdev.org/wiki/index.php?action=history&amp;feed=atom&amp;title=OpenSimulator_Internals%2FCode_Map%2FROBUST%2FGridService_RegisterRegion</id>
	<title>OpenSimulator Internals/Code Map/ROBUST/GridService RegisterRegion - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://osimdev.org/wiki/index.php?action=history&amp;feed=atom&amp;title=OpenSimulator_Internals%2FCode_Map%2FROBUST%2FGridService_RegisterRegion"/>
	<link rel="alternate" type="text/html" href="http://osimdev.org/wiki/index.php?title=OpenSimulator_Internals/Code_Map/ROBUST/GridService_RegisterRegion&amp;action=history"/>
	<updated>2026-08-04T16:56:06Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>http://osimdev.org/wiki/index.php?title=OpenSimulator_Internals/Code_Map/ROBUST/GridService_RegisterRegion&amp;diff=57&amp;oldid=prev</id>
		<title>Jwbshaw: first</title>
		<link rel="alternate" type="text/html" href="http://osimdev.org/wiki/index.php?title=OpenSimulator_Internals/Code_Map/ROBUST/GridService_RegisterRegion&amp;diff=57&amp;oldid=prev"/>
		<updated>2026-07-07T11:44:27Z</updated>

		<summary type="html">&lt;p&gt;first&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= OpenSimulator Internals/Code Map/ROBUST/GridService RegisterRegion =&lt;br /&gt;
&lt;br /&gt;
== RegisterRegion ==&lt;br /&gt;
&lt;br /&gt;
Source: OpenSim/Services/GridService/GridService.cs&lt;br /&gt;
&lt;br /&gt;
Validation sequence:&lt;br /&gt;
&lt;br /&gt;
# RegionID must not be zero UUID&lt;br /&gt;
# RegionLocY must be above Constants.MaximumRegionSize (coordinates below this are reserved for HG links)&lt;br /&gt;
# Overlap check: queries m_Database.Get() for the bounding box. Fails if more than one overlap, or one overlap with a different RegionID&lt;br /&gt;
# Reservation check: existing record with Reservation flag rejects if PrincipalID is zero UUID, otherwise treated as an authentication request&lt;br /&gt;
# Authenticate flag check: verifies token via m_AuthenticationService.Verify(), 30-second window&lt;br /&gt;
# Duplicate name check (if AllowDuplicateNames = false): rejects if another region has the same name with a different RegionID&lt;br /&gt;
# Move check: if the region was previously registered at different coordinates, checks NoMove and LockedOut flags before deleting the old entry&lt;br /&gt;
# Applies DefaultRegionFlags from config, then per-region overrides by name or UUID (ParseFlags, supports +/- syntax)&lt;br /&gt;
# Sets RegionOnline flag unconditionally&lt;br /&gt;
# Stores via m_Database.Store() with last_seen timestamp&lt;br /&gt;
&lt;br /&gt;
Returns empty string on success, an error message string on failure. Scene.RegisterRegionWithGrid() throws an Exception if the returned string is non-empty -- this is a fatal startup error in OpenSimBase.CreateRegion().&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== DeregisterRegion ==&lt;br /&gt;
&lt;br /&gt;
```&lt;br /&gt;
public bool DeregisterRegion(UUID regionID)&lt;br /&gt;
{&lt;br /&gt;
    RegionData region = m_Database.Get(regionID, UUID.Zero);&lt;br /&gt;
    if (region == null)&lt;br /&gt;
        return false;&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
# Looks up the region by UUID, scope zero. Returns false if not found.&lt;br /&gt;
# Reads current flags.&lt;br /&gt;
# If !m_DeleteOnUnregister OR the region has the Persistent flag set: clears the RegionOnline flag, updates last_seen, calls Store(). Returns true.&lt;br /&gt;
# Otherwise: calls m_Database.Delete(regionID) and returns the result.&lt;br /&gt;
&lt;br /&gt;
Called from Scene.Close() during simulator shutdown, and from the deregister region id console command on ROBUST.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[OpenSimulator Internals/GridService]]&lt;br /&gt;
* [[OpenSimulator Internals/Code Map/ROBUST]]&lt;br /&gt;
* [[OpenSimulator Internals/Databases]]&lt;/div&gt;</summary>
		<author><name>Jwbshaw</name></author>
	</entry>
</feed>