Class MudlibBoundary

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

public final class MudlibBoundary extends Object
JVMud-native registry of mudlib-side boundary objects and lifecycle interests.

The paths recorded here point to mudlib objects that perform translation. This class does not implement legacy LP engine behavior and does not define engine concepts using legacy names.

Lifecycle hooks are registered here as mappings from MudlibLifecycleEvent values to mudlib method names. The event is the JVMud-native contract; the method name is mudlib policy. For example, an LP245 compatibility boundary can map MudlibLifecycleEvent.OBJECT_LOADED to reset and MudlibLifecycleEvent.INTERACTION_SCOPE_STARTED to init without making those legacy method names part of the engine ontology.

A mapping is optional. When an event occurs and no method is configured, JVMud skips the mudlib call and continues the engine-owned operation. When a method is configured, the runtime invokes it on the event's target object or on the configured boundary object, depending on the event definition.

  • Field Details

  • Method Details

    • empty

      public static MudlibBoundary empty()
      Returns a boundary with no declared mudlib integration points.
    • builder

      public static MudlibBoundary.Builder builder()
      Starts a builder for immutable mudlib boundary metadata.
    • gameId

      public Optional<String> gameId()
      Returns the optional stable game id declared by the mudlib.
    • gameName

      public Optional<String> gameName()
      Returns the optional display name declared by the mudlib.
    • mudlibRootPath

      public Optional<Path> mudlibRootPath()
      Returns the optional filesystem root used to resolve mudlib-absolute LPC paths.
    • boundaryObjectPath

      public Optional<String> boundaryObjectPath()
      Returns the optional object path for a general mudlib boundary adapter.
    • mudlibGlobalObjectPath

      public Optional<String> mudlibGlobalObjectPath()
      Returns the optional mudlib-owned global function object path.
    • compatibilityGlobalObjectPath

      public Optional<String> compatibilityGlobalObjectPath()
      Returns the optional JVMud compatibility global function object path.
    • compatibilityGlobalObjectSourcePath

      public Optional<Path> compatibilityGlobalObjectSourcePath()
      Returns the optional filesystem source for the JVMud compatibility global object.

      This is usually discovered from a jvmud.c file that sits beside the mudlib manifest. It lets the compiler inspect that profile-side helper object's declarations even when the upstream mudlib source root lives in a different folder.

    • mfunObjectPath

      @Deprecated(forRemoval=false) public Optional<String> mfunObjectPath()
      Returns the optional object path for legacy mudlib function adapters.
    • playerObjectPath

      public Optional<String> playerObjectPath()
      Returns the optional LPC player object path used when binding interactive sessions.
    • playerPrompt

      public Optional<String> playerPrompt()
      Returns the optional prompt text to display when an interactive player can enter commands.
    • maxLineLength

      public int maxLineLength()
      Returns the configured maximum output line length before whitespace wrapping is attempted.
    • showRuler

      public boolean showRuler()
      Returns whether command prompts should be preceded by a visual line-length ruler.
    • initialPlacePath

      public Optional<String> initialPlacePath()
      Returns the optional starting place object path for new local Personas.
    • preloadFilePath

      public Optional<String> preloadFilePath()
      Returns the optional mudlib-relative file that lists startup preload objects.
    • preloadObjectPaths

      public Set<String> preloadObjectPaths()
      Returns additional mudlib object paths to preload at startup.
    • databaseJdbcUrl

      public Optional<String> databaseJdbcUrl()
      Returns the optional JDBC URL used by JVMud-native database efuns.
    • databaseUser

      public Optional<String> databaseUser()
      Returns the optional JDBC user used by JVMud-native database efuns.
    • databasePassword

      public Optional<String> databasePassword()
      Returns the optional JDBC password used by JVMud-native database efuns.
    • temporalTickMethod

      public Optional<String> temporalTickMethod()
      Returns the optional mudlib method to invoke for deterministic temporal ticks.
    • temporalTickInterval

      public Duration temporalTickInterval()
      Returns the configured wall-clock interval for one world tick, or Duration.ZERO when disabled.
    • temporalTickIntervalSeconds

      public int temporalTickIntervalSeconds()
      Returns the configured temporal tick interval in whole seconds, or 0 when disabled.
    • lifecycleEvents

      public Set<MudlibLifecycleEvent> lifecycleEvents()
      Returns lifecycle events the mudlib has declared interest in handling.

      This set includes events declared with MudlibBoundary.Builder.handle(MudlibLifecycleEvent) and events that have explicit method mappings through MudlibBoundary.Builder.lifecycleMethod(MudlibLifecycleEvent, String). A declared event without a method mapping is useful as boundary metadata, but JVMud can only invoke hooks that also have a mapped method.

      Returns:
      immutable lifecycle event declarations
    • lifecycleMethods

      public Map<MudlibLifecycleEvent, String> lifecycleMethods()
      Returns explicit lifecycle event-to-method mappings declared by the mudlib.

      Keys are JVMud-native event names. Values are LPC method names to invoke when those events are delivered.

      Returns:
      immutable map from lifecycle event to mudlib method name
    • engineFunctionAliases

      public Map<String,String> engineFunctionAliases()
      Returns engine function name translations declared by this mudlib boundary.

      Keys are mudlib-visible function spellings used by mudlib source, and values are JVMud-native engine efun names. This keeps legacy vocabulary at the compatibility boundary instead of adding those names to the engine efun catalog.

      Returns:
      immutable map from mudlib-visible function name to JVMud engine function name
    • engineFunction

      public Optional<String> engineFunction(String mudlibName)
      Returns the JVMud-native engine function name for a mudlib-visible spelling, if one is declared.
    • compatibilityPredefines

      public Map<String,String> compatibilityPredefines()
      Returns preprocessor predefines supplied by a mudlib compatibility profile.

      These are compile-time facts exposed to LPC source before parsing. They are intended for driver-compatibility shims, such as LDMud-flavored version macros that imported mudlibs probe with __VERSION_MAJOR__. JVMud keeps them at the mudlib boundary instead of treating another driver's predefined macro vocabulary as JVMud-native LPC.

      Returns:
      immutable map from predefined macro name to replacement text
    • compatibilityFunctionPredefines

      public Map<String, Map<String,String>> compatibilityFunctionPredefines()
      Returns configured function-like preprocessor compatibility probes.

      The outer key is the macro name exposed to mudlib source. The inner key is the first argument spelling, and the inner value is replacement source text. This supports driver compatibility probes without baking another driver's macro names into JVMud's compiler.

      Returns:
      immutable map from macro name to argument-specific replacement text
    • lifecycleMethod

      public Optional<String> lifecycleMethod(MudlibLifecycleEvent event)
      Returns the configured mudlib method for an event, if one was declared.
      Parameters:
      event - lifecycle event to inspect
      Returns:
      configured mudlib method name, or empty when the event has no method mapping
      Throws:
      NullPointerException - if event is null
    • handles

      public boolean handles(MudlibLifecycleEvent event)
      Returns whether the mudlib declares any interest in an event.

      This is broader than lifecycleMethod(MudlibLifecycleEvent): it is true for both a bare event declaration and an explicit event-to-method mapping.

      Parameters:
      event - lifecycle event to inspect
      Returns:
      true when the event was declared or mapped
      Throws:
      NullPointerException - if event is null
    • declared

      public boolean declared()
      Returns whether any boundary value was declared.