Class MudlibBoundaryConfigReader

java.lang.Object
io.github.protasm.jvmud.engine.mudlib.MudlibBoundaryConfigReader

public final class MudlibBoundaryConfigReader extends Object
Reads JVMud-native mudlib boundary declarations from a simple manifest file.

The manifest is intentionally small: each non-comment line is a key = value or key: value declaration, with comma-separated values accepted where a key supports multiple entries. Lifecycle hooks are declared either as bare handled events:

handled_lifecycle_events = scheduled_tick

or as event-to-method mappings:

lifecycle.object_loaded = reset
lifecycle.interaction_scope_started = init
lifecycle.player_session_connected = logon

The lifecycle. key suffix is parsed with lifecycleEvent(String), so manifest authors may use lower-case names, hyphens, or spaces. The resulting event stays JVMud-native; the value remains the mudlib's method name.

  • Method Details

    • read

      public static MudlibBoundary read(Path mudlibRoot, String configPath) throws IOException
      Reads and normalizes a mudlib boundary manifest.

      mudlibRoot is the fallback filesystem root for mudlib-absolute LPC paths. If the manifest declares mudlib_root, relative values are resolved against the manifest file's directory.

      Parameters:
      mudlibRoot - fallback mudlib root directory
      configPath - manifest path relative to mudlibRoot
      Returns:
      immutable boundary metadata
      Throws:
      IOException - if the manifest cannot be read
      IllegalArgumentException - if a line, enum name, boolean, duration, or bounded integer value is invalid
      NullPointerException - if either argument is null
    • lifecycleEvent

      public static MudlibLifecycleEvent lifecycleEvent(String name)
      Parses a lifecycle event name from mudlib configuration.

      Names are trimmed, hyphens and spaces become underscores, and matching is case-insensitive. A few older boundary names are accepted as aliases so existing manifests keep working while the public contract uses the current MudlibLifecycleEvent names.

      Parameters:
      name - manifest event name, such as object_loaded or interaction scope started
      Returns:
      matching lifecycle event
      Throws:
      IllegalArgumentException - if the normalized name is not a known event or alias
      NullPointerException - if name is null