Skip to the content.

Architecture Overview

This page maps the OpenSim source tree to concepts. Paths are under OpenSim/.

Two executables, two entry points

Program Main() location Output Role
OpenSim (simulator) Region/Application/Application.cs → Application.Main() bin/OpenSim (OpenSim.dll) Hosts regions/scenes, talks to viewers
Robust (grid services) Server/ServerMain.cs → OpenSimServer.Main() bin/Robust (Robust.dll) Hosts grid services over HTTP

Simulator startup

Application.Main() parses command-line switches into a Nini config source, then constructs OpenSim / OpenSimBackground and calls .Startup(). The real bootstrap lives in:

Robust startup

ServerMain.Main() creates HttpServerBase, reads the [Startup] ServiceConnectors list from Robust.ini, and for each connector string calls ServerUtils.LoadPlugin<IServiceConnector>(...). Each connector registers HTTP handlers. Robust is a thin host; the logic is in the service connectors under Server/Handlers/.

The central Scene

A region is represented by the Scene class:

The module system (region behaviour)

Almost all region behaviour is implemented as region modules. The interfaces live in Region/Framework/Interfaces/:

The methods on those interfaces (Initialise, AddRegion, RegionLoaded, …) are the module lifecycle. After AddRegion, a module typically subscribes to scene.EventManager (and later to IClientAPI events on each new client). Full catalogue: Region module events.

Loading & registration

ApplicationPlugins/RegionModulesController/RegionModulesControllerPlugin.cs (RegionModulesControllerPlugin) is itself an application plugin (see below). Its AddRegionToModules(Scene) is the heart of the loader: it adds shared module instances, creates a fresh non-shared instance per scene, handles ReplaceableInterface de-duplication, and finally calls RegionLoaded on all modules (so modules can safely fetch each other’s interfaces).

Modules publish capabilities with scene.RegisterModuleInterface<T>(this) and consume them with scene.RequestModuleInterface<T>(). Process-wide services go on OpenSimBase.ApplicationRegistry (an IRegistryCore).

Where features live

Region/CoreModules/ holds most region behaviour, grouped by area:

Services vs Connectors

Folder Services/ separates interfaces, local implementations, and remote connectors:

How standalone vs grid swaps local for remote

This is driven by INI config, not code changes: on the simulator, the ServiceConnectorsOut modules choose in-process vs remote. For simulation:

On Robust, the matching HTTP endpoint is exposed by an in-connector, e.g. Server/Handlers/Simulation/SimulationServiceInConnector.cs and Server/Handlers/Login/LLLoginServiceInConnector.cs.

The HTTP methods, paths, and example request/response bodies (local grid and Hypergrid) are documented in Protocols.

Application plugins (bootstrap)

Implement IApplicationPlugin (Region/Application/IApplicationPlugin.cs), discovered via Mono.Addins at extension path /OpenSim/Startup, and loaded by OpenSimBase.LoadPlugins(). Key plugins in ApplicationPlugins/:

Bootstrap order (simulator)

Application.Main → OpenSim.Startup() → RegionApplicationBase.StartupSpecific() (starts HTTP servers, SceneManager) → OpenSimBase.StartupSpecific() (loads data services, then all IApplicationPlugins: Initialise then PostInitialise) → LoadRegionsPlugin.PostInitialise() creates each region → OpenSimBase.CreateRegion() → Scene → RegionModulesController.AddRegionToModules(scene).

Framework essentials (Framework/)

Other notable folders