Jump to content

OpenSimulator Internals/Simulator Services

From Open Simulator Technical Help
Revision as of 05:45, 9 July 2026 by Jwbshaw (talk | contribs) (first)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Simulator Services

[edit]

Simulator services run inside OpenSim.exe and are scoped to the simulator process, not the grid. They are distinct from ROBUST services, which run in ROBUST.exe and serve the entire grid.

Each simulator service follows the same local/remote connector pattern used by grid services: a local connector handles in-process calls; a remote connector makes HTTP calls to another simulator. See Connector Architecture for the general pattern.

Config key for all three services is in the [Modules] section of OpenSim.ini.


Land Service

[edit]

Interface: ILandService (OpenSim.Services.Interfaces)
Config key: LandServices

Purpose

[edit]

Retrieves parcel land data by region handle and coordinates. Used when a simulator needs land data for a region it does not itself host -- for example, to resolve access rules at a region border before a crossing completes.

Interface

[edit]

ILandService exposes a single method:

LandData GetLandData(UUID scopeID, ulong regionHandle, uint x, uint y, out byte regionAccess)

Connectors

[edit]
Connector Class Used when
Local LocalLandServicesConnector Destination region is hosted by this simulator. Walks the local scene list, matches by world coordinates, returns LandData plus access level and dwell count.
Remote RemoteLandServicesConnector Destination region is on another simulator. Tries local first; falls back to HTTP call via LandServicesConnector base class.

Notes

[edit]
  • The local connector iterates m_Scenes and matches by world coordinate
 bounds, not by region UUID. This matters for varregions where a single scene
 covers a range of coordinates.
  • Dwell count is retrieved via IDwellModule if present; not part of
 the core land data.
  • Returns null if no local scene matches and no remote call is
 configured.

Library Service

[edit]

Interface: ILibraryService (OpenSim.Services.Interfaces)
Implementation: OpenSim.Services.InventoryService.LibraryService
Config section: [LibraryService]

Purpose

[edit]

Provides the shared library inventory -- the read-only content visible to all users under the Library folder. Backed by XML files on the local filesystem, not the database.

Config

[edit]
[LibraryService]
DefaultLibrary = inventory/Libraries.xml
LibraryName = OpenSim Library

Both keys are optional; the values above are the defaults.

Interface

[edit]
InventoryFolderImpl LibraryRootFolder { get; }
Dictionary<UUID, InventoryFolderImpl> GetAllFolders()
InventoryItemBase GetItem(UUID itemID)
InventoryItemBase[] GetMultipleItems(UUID[] itemIDs)

Notes

[edit]
  • Not a region module. Instantiated as a ServiceBase directly by
 the service infrastructure. No [Modules] config key.
  • Singleton per process: static instance, initialized once regardless of how
 many regions the simulator hosts.
  • Loaded from XML files under the inventory/ directory at startup.
 Root folder UUID is a fixed constant (00000112-000f-0000-0000-000100bba000);
 all library UUIDs are fixed and do not vary between installations.
  • No remote connector. No ROBUST equivalent. Library content is local to each
 simulator.
  • The source explicitly notes this is a stopgap: "basically a hack to give us
 an Inventory library while we don't have an inventory server." Architecturally
 it should be a grid service with shared content across simulators; it has
 never been converted.

Simulation Service

[edit]

Interface: ISimulationService (OpenSim.Services.Interfaces)
Config key: SimulationServices

Purpose

[edit]

Handles simulator-to-simulator communication: creating and updating agents on remote simulators, moving objects across region boundaries, and closing agents when they leave. Used for teleports, region crossings, child agent maintenance, and object crossings.

This is not a ROBUST service. It runs entirely between simulators.

Interface

[edit]

Agent operations:

Method Purpose
CreateAgent(source, destination, aCircuit, flags, ctx, out reason) Creates a new agent circuit on the destination simulator. Entry point for teleport and login-to-region.
UpdateAgent(destination, AgentData, ctx) Full child agent update: position, appearance, animation state.
UpdateAgent(destination, AgentPosition) Lightweight position-only update for child agents.
QueryAccess(destination, agentID, homeURI, viaTeleport, position, features, ctx, out reason) Checks whether the destination will accept this agent. Called before CreateAgent.
ReleaseAgent(originRegion, agentID, uri) Destination notifies origin that the client has connected. Origin clears its teleport-pending state.
CloseAgent(destination, agentID, auth_token) Closes an agent circuit on the destination simulator.

Object operations:

Method Purpose
CreateObject(destination, newPosition, sog, isLocalCall) Sends a scene object to the destination simulator. Used for prim crossings and object teleport. If isLocalCall is true, the object is cloned before transfer; if false, it is used as received from the wire.

Connectors

[edit]
Connector Class Used when
Local LocalSimulationConnectorModule Destination region is hosted by this simulator. Dispatches directly to the target Scene by UUID lookup.
Remote RemoteSimulationConnectorModule Destination region is on another simulator. Tries local first; falls back to HTTP via SimulationServiceConnector.

Notes

[edit]
  • The local connector maintains a Dictionary<UUID, Scene> keyed
 by region UUID. GetScene() has a fallback that returns the first
 available scene if the requested UUID is not found -- this masks bugs and is
 noted as a known issue in the source.
  • QueryAccess enforces a version check: if the requesting simulator
 is running protocol version below 0.3 and the destination is a varregion
 (non-256x256), the request is denied. Older viewers crash on varregions.
  • RemoteSimulationConnectorModule wraps a
 LocalSimulationConnectorModule instance as its local backend.
 All calls try local first, then fall through to HTTP only if the destination
 is confirmed not-local via IsLocalRegion().
  • source in CreateAgent may be null if the user logged
 in directly or arrived from an older simulator that does not send it.

See Also

[edit]