OpenSimulator Internals/Code Map/ROBUST/GridService RegisterRegion
Appearance
OpenSimulator Internals/Code Map/ROBUST/GridService RegisterRegion
[edit]RegisterRegion
[edit]Source: OpenSim/Services/GridService/GridService.cs
Validation sequence:
- RegionID must not be zero UUID
- RegionLocY must be above Constants.MaximumRegionSize (coordinates below this are reserved for HG links)
- Overlap check: queries m_Database.Get() for the bounding box. Fails if more than one overlap, or one overlap with a different RegionID
- Reservation check: existing record with Reservation flag rejects if PrincipalID is zero UUID, otherwise treated as an authentication request
- Authenticate flag check: verifies token via m_AuthenticationService.Verify(), 30-second window
- Duplicate name check (if AllowDuplicateNames = false): rejects if another region has the same name with a different RegionID
- Move check: if the region was previously registered at different coordinates, checks NoMove and LockedOut flags before deleting the old entry
- Applies DefaultRegionFlags from config, then per-region overrides by name or UUID (ParseFlags, supports +/- syntax)
- Sets RegionOnline flag unconditionally
- Stores via m_Database.Store() with last_seen timestamp
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().
DeregisterRegion
[edit]``` public bool DeregisterRegion(UUID regionID) {
RegionData region = m_Database.Get(regionID, UUID.Zero);
if (region == null)
return false;
```
- Looks up the region by UUID, scope zero. Returns false if not found.
- Reads current flags.
- If !m_DeleteOnUnregister OR the region has the Persistent flag set: clears the RegionOnline flag, updates last_seen, calls Store(). Returns true.
- Otherwise: calls m_Database.Delete(regionID) and returns the result.
Called from Scene.Close() during simulator shutdown, and from the deregister region id console command on ROBUST.