Class MudInstance
java.lang.Object
io.github.protasm.jvmud.execution.instance.MudInstance
- All Implemented Interfaces:
InstanceHost
Runtime and serialized world operations for one independently hosted mudlib.
-
Method Summary
Modifier and TypeMethodDescription<T> Tadminister(Function<LPCRuntime, T> action) Runs trusted administration on this mudlib's execution thread.voidAdvances only this mudlib, on its own execution thread.attachPersona(PrintWriter out, String remoteAddress) Queues attachment to this mudlib before delivering player input.voidbindClientProtocolSink(InstancePersona persona, BiConsumer<String, String> protocolOutputSink) Queues the transport output binding for a selected persona.static MudInstancestatic MudInstanceboot(Path mudlibRoot, String configObjectPath, MudlibBootProgress progress) Boots a persistent mud instance and reports host-visible progress to the supplied callback.static MudInstanceboot(Path mudlibRoot, String configObjectPath, MudlibBootProgress progress, LPCObjectLoadObserver objectLoadObserver) Boots a persistent mud instance with host-visible preload and object-load diagnostics.voiddetachPersona(InstancePersona persona) Queues session detachment after prior world work.voiddispatch(InstancePersona persona, PrintWriter out, String commandLine) Delivers input on the world queue; mudlib command results stay inside the instance.gameId()Returns the unique identity used in the engine menu and administration.gameName()Returns the display name shown in the engine mudlib menu.booleanisAttached(InstancePersona persona) Reads attachment state in order with world work.booleanisCapturingInput(InstancePersona persona) Reads input capture state in order with world work.booleanisCapturingNoEchoInput(InstancePersona persona) Reads hidden-input state in order with world work.voidprintPromptIfReady(InstancePersona persona, PrintWriter out) Queues prompt delivery after preceding world work.voidreceiveClientProtocolMessage(InstancePersona persona, String protocol, String message) Queues a decoded client protocol message.reloadMudlibObject(String objectPath) Recompiles and replaces one shared mudlib object while this instance remains online.voidsetClientProtocolEnabled(InstancePersona persona, String protocol, boolean enabled) Queues a client protocol state change.voidStops the clock, completes queued work and the shutdown lifecycle, then closes this world queue.voidStarts this instance's independent command queue and configured clock exactly once.Prefix that escapes a line into transport control rather than mudlib command dispatch.
-
Method Details
-
boot
-
boot
public static MudInstance boot(Path mudlibRoot, String configObjectPath, MudlibBootProgress progress) Boots a persistent mud instance and reports host-visible progress to the supplied callback.- Parameters:
mudlibRoot- filesystem root of the selected mudlibconfigObjectPath- mudlib-relative JVMud configuration pathprogress- callback for local startup progress events- Returns:
- booted mud instance ready for session attachment
-
boot
public static MudInstance boot(Path mudlibRoot, String configObjectPath, MudlibBootProgress progress, LPCObjectLoadObserver objectLoadObserver) Boots a persistent mud instance with host-visible preload and object-load diagnostics.- Parameters:
mudlibRoot- filesystem root of the selected mudlibconfigObjectPath- mudlib-relative JVMud configuration pathprogress- callback for local startup progress eventsobjectLoadObserver- observer for each shared LPC object load attempt- Returns:
- booted mud instance ready for session attachment
-
startExecution
public void startExecution()Starts this instance's independent command queue and configured clock exactly once. -
shutdown
Stops the clock, completes queued work and the shutdown lifecycle, then closes this world queue.- Specified by:
shutdownin interfaceInstanceHost
-
administer
Runs trusted administration on this mudlib's execution thread.- Specified by:
administerin interfaceInstanceHost
-
advanceWorldTick
public void advanceWorldTick()Advances only this mudlib, on its own execution thread.- Specified by:
advanceWorldTickin interfaceInstanceHost
-
reloadMudlibObject
Recompiles and replaces one shared mudlib object while this instance remains online.The path is an LPC object id relative to the selected mudlib's active source root, such as
system/quests. Existing callers resolve the replacement through the same stable object id. Host administration code should use this operation only for shared service or content objects whose own reload policy is safe; it is intentionally not exposed as an unauthenticated player transport command.- Parameters:
objectPath- mudlib-relative LPC object id, with or without a.csuffix- Returns:
- handle for the newly compiled shared object
- Throws:
IllegalArgumentException- if the path is blank or escapes the active mudlib root
-
attachPersona
Queues attachment to this mudlib before delivering player input.- Specified by:
attachPersonain interfaceInstanceHost
-
bindClientProtocolSink
public void bindClientProtocolSink(InstancePersona persona, BiConsumer<String, String> protocolOutputSink) Queues the transport output binding for a selected persona.- Specified by:
bindClientProtocolSinkin interfaceInstanceHost
-
setClientProtocolEnabled
Queues a client protocol state change.- Specified by:
setClientProtocolEnabledin interfaceInstanceHost
-
receiveClientProtocolMessage
Queues a decoded client protocol message.- Specified by:
receiveClientProtocolMessagein interfaceInstanceHost
-
detachPersona
Queues session detachment after prior world work.- Specified by:
detachPersonain interfaceInstanceHost
-
dispatch
Delivers input on the world queue; mudlib command results stay inside the instance.- Specified by:
dispatchin interfaceInstanceHost
-
printPromptIfReady
Queues prompt delivery after preceding world work.- Specified by:
printPromptIfReadyin interfaceInstanceHost
-
isCapturingInput
Reads input capture state in order with world work.- Specified by:
isCapturingInputin interfaceInstanceHost
-
isCapturingNoEchoInput
Reads hidden-input state in order with world work.- Specified by:
isCapturingNoEchoInputin interfaceInstanceHost
-
isAttached
Reads attachment state in order with world work.- Specified by:
isAttachedin interfaceInstanceHost
-
gameId
Returns the unique identity used in the engine menu and administration. -
gameName
Returns the display name shown in the engine mudlib menu. -
mudlibRoot
- Specified by:
mudlibRootin interfaceInstanceHost
-
bootResult
- Specified by:
bootResultin interfaceInstanceHost
-
worldTickInterval
- Specified by:
worldTickIntervalin interfaceInstanceHost
-
transportControlPrefix
Description copied from interface:InstanceHostPrefix that escapes a line into transport control rather than mudlib command dispatch.- Specified by:
transportControlPrefixin interfaceInstanceHost
-