Skip to content
Version 2.11.0
↓ Get the launcher

IDungeonState interface

Read-only view of the current dungeon run, decoded from the game’s WorldNtf.SyncDungeonData notification. Surfaces the per-run unique id (CurrentRunId) that an upload/logging plugin needs to key a run (the StellarLogs level_uuid), plus the clear-time / score once the run settles (LastSettlement).

Populated on the network receive thread and read on the main thread; implementations publish via volatile reads so consumers are lock-free. CurrentRunId resets to 0 on leave-scene / logout.

NOTE: This interface sits exactly at the STELLAR0005 8-member cap — do not add members; split the interface (see docs/coding-standards.md § SOLID) if more surface is needed.

public interface IDungeonState
name description
CurrentDifficulty { get; } Raw value of DungeonSceneInfo.difficulty (DungeonSyncData.dungeon_scene_info, field 21) for the current run, or 0 when not yet seen / not applicable.
CurrentFlowState { get; } Current dungeon flow state (DungeonFlowInfo.state) for the live run — None when not in an instanced run or not yet observed. Sourced from BOTH dungeon delivery paths: the method-23 full sync (entry/rejoin) and the method-24 dirty delta (mid-run transitions). Cleared when a new run begins and on logout reset; like the settlement, it survives the run-id drop-to-0 on leaving to town (consumers gate on CurrentRunId for “in a run”).
CurrentRunId { get; } The unique id of the dungeon run currently in progress — the server-assigned per-instance scene uuid, stable across the whole run and shared by every client in it. 0 when not in a dungeon / between runs. Use this as the run key (e.g. level_uuid for log uploads).
FlowStateVersion { get; } Monotonic transition counter for CurrentFlowState — increments once per observed state CHANGE, never for a same-value re-delivery. This is the change-notification mechanism: state is written on the network receive thread, so consumers POLL this counter (e.g. on their frame tick) instead of subscribing to a cross-thread event. Resets to 0 when a new run begins and on logout reset — treat a DECREASE as “new run, adopt silently”.
LastDefeatedCount { get; } Enemies defeated this run (World attr AttrDeathCount=348); 0 if unknown.
LastOutcome { get; } Outcome of the current/just-finished run (from flow_info.result). None until resolved.
LastSettlement { get; } The most recent settlement (clear/result) summary, or null if the current run has not reached its result screen yet. Carries the clear time and master-mode score.
RunTimerStartMs { get; } Server epoch ms when the dungeon run-timer started (DungeonSyncData.flow_info, field 2 → DungeonFlowInfo.play_time, field 4 — the epoch when play officially begins after the Ready countdown), or 0 when not yet seen for the current run. Only non-zero wire values are latched; the value clears when a new run begins and survives the dungeon→town transition so it is readable at archive time.