Table of Contents

Namespace Shard.Server.Modules

Classes

EventBus

Thread-safe IEventBus. Handlers are held per event type in an immutable array ordered by EventPriority so Publish<TEvent>(TEvent) is lock-free; subscribe/unsubscribe take a short write lock. A cancelled ICancellableEvent is skipped for handlers that did not opt into receiveCancelled. Synchronous handlers run inline; asynchronous handlers are awaited by PublishAsync<TEvent>(TEvent) (and run to completion under the synchronous Publish<TEvent>(TEvent)).

ModuleHost

Orchestrates the module lifecycle: resolves the dependency-ordered load order, runs setup across all modules, waits for their dependency-aware preloads, starts them, and shuts them down in reverse order. Failures are isolated to the affected modules and their dependents. Each module receives its own event-scoped Shard.Server.Modules.ModuleContext.

ModuleLoadException

Raised when the module set cannot be ordered. Mirrors the Java ModLoadOrderException.

ModuleLoadOrder

Resolves module manifests into one deterministic immutable load plan. Every dependency reference is canonicalized once, before lifecycle callbacks run; ambiguous bare names are rejected.

ModuleLoadPlan

Immutable dependency resolution result that owns discovered module lifetimes until exactly one host claims it. Callers must dispose a plan that is abandoned or rejected by a host.

ModuleLoader

Discovers modules from all configured providers, disposes modules disabled by configuration, resolves one immutable load plan, and transfers that plan to the host.

PermissionResolver

"Deny wins" evaluation of a single permission-node set, ported faithfully from the upstream PermissionsModule.hasPermission. Returns a tri-state: true (granted), false (denied), or null (unset — the caller falls through to the next set or a default). Precedence:

  1. -* root deny
  2. exact deny -node
  3. exact grant node
  4. deny wildcards, most specific to least
  5. * root grant
  6. grant wildcards, least specific to most
  7. unset (null)
ServerConfig

Server-wide settings loaded from config.json. Mirrors the core of the upstream HytaleServerConfig (server identity + player limits); bind address stays a CLI option, and transient/auth details live elsewhere. Provided to the service registry so modules can read it.

ServerConfigFile

Loads and saves ServerConfig as human-editable JSON. Missing files are created with defaults; an existing file is parsed then rewritten so newly added fields appear and formatting stays canonical. A malformed file is NOT overwritten, the error propagates so the operator can fix it.

Structs

ServerReadyEvent

Published once after dependency-eligible module starts finish and failed or blocked modules are cleaned up. Networking enables its listener in response to this completed startup state.

ServerTickEvent

Published on the event bus once per server tick. Modules subscribe via their IModuleContext.Events to run per-tick logic on the tick thread.

Enums

ModuleLoadException.Kind