Jump to content

OpenSimulator Internals/Code Map/ROBUST/GridService RegisterRegion

From Open Simulator Technical Help

OpenSimulator Internals/Code Map/ROBUST/GridService RegisterRegion

[edit]

RegisterRegion

[edit]

Source: OpenSim/Services/GridService/GridService.cs

Validation sequence:

  1. RegionID must not be zero UUID
  2. RegionLocY must be above Constants.MaximumRegionSize (coordinates below this are reserved for HG links)
  3. Overlap check: queries m_Database.Get() for the bounding box. Fails if more than one overlap, or one overlap with a different RegionID
  4. Reservation check: existing record with Reservation flag rejects if PrincipalID is zero UUID, otherwise treated as an authentication request
  5. Authenticate flag check: verifies token via m_AuthenticationService.Verify(), 30-second window
  6. Duplicate name check (if AllowDuplicateNames = false): rejects if another region has the same name with a different RegionID
  7. Move check: if the region was previously registered at different coordinates, checks NoMove and LockedOut flags before deleting the old entry
  8. Applies DefaultRegionFlags from config, then per-region overrides by name or UUID (ParseFlags, supports +/- syntax)
  9. Sets RegionOnline flag unconditionally
  10. 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;

```

  1. Looks up the region by UUID, scope zero. Returns false if not found.
  2. Reads current flags.
  3. If !m_DeleteOnUnregister OR the region has the Persistent flag set: clears the RegionOnline flag, updates last_seen, calls Store(). Returns true.
  4. 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.


See Also

[edit]