Skip to content

feat: Discord join messages show the mod version + dev milestone ping - #388

Open
bh679 wants to merge 5 commits into
mainfrom
claude/keen-blackwell-291c2b
Open

feat: Discord join messages show the mod version + dev milestone ping#388
bh679 wants to merge 5 commits into
mainfrom
claude/keen-blackwell-291c2b

Conversation

@bh679

@bh679 bh679 commented Jun 14, 2026

Copy link
Copy Markdown
Owner

Enriches the bundled Discord Presence join message: every join / "started the game" post now shows DungeonTrain <version>, and the developer is pinged the first time a player starts a NEW world after their first-ever death (once per player, ever).

Cross-repo

Built on Discord Presence 0.13.0 (released): new player-aware joinMessageSuffix(uuid, name) provider seam + an allowed_mentions.users allow-list so the one trusted suffix mention actually notifies (player names / chat never can). discordpresence_version bumped to 0.13.0.

DungeonTrain side

  • DungeonTrain.commonSetup provider override returns "DungeonTrain " + version (from ModList) + the dev mention when the player qualifies.
  • discord/GlobalDeathPingStore — cross-world per-player sidecar (firstDeathAtMillis, devPingSent) at config/dungeontrain-devping/<uuid>.json, mirroring GlobalAchievementStore.
  • discord/DevPingService — qualifies when firstDeathAt > 0 && worldCreatedAt > firstDeathAt && !devPingSent; pure decideMarker(...) unit-tested.
  • world/DungeonTrainWorldData.worldCreatedAtMillis (stamped at creation; 0 for legacy worlds → never qualify).
  • RunStatsEvents.onPlayerDeath stamps first death; TrainBootstrapEvents (both-dist) caches the world creation time.
  • DungeonTrainConfig.developerPingRelayToken (SERVER) — defaults to the dev's mention; blank disables the dev-ping.

Testing

  • DP: JoinBodyFormatTest (incl. "player-name lookalike not pingable"); DT: DevPingServiceTest (state machine). Both suites green.
  • Gate 2: live in-game — version line on every join + real dev-ping notification verified through the relay; once-per-player / new-world-after-death confirmed via state file + log.

Mod impact

Dependency bump only (discordpresence 0.13.0, jarJar). New per-player sidecar JSON + an additive worldCreatedAtMillis SavedData field (no save break). No MC/NeoForge/Sable bump; no new mixins/blocks/items/entities/world-gen/packets.

🤖 Generated with Claude Code

bh679 and others added 5 commits June 14, 2026 23:03
Override the bundled Discord Presence provider's joinMessageSuffix to append
"DungeonTrain <version>" (read from ModList) to every session-start message,
and emit a relay ping-marker on the first NEW world a player starts after
their first-ever death — once per player, ever:

- GlobalDeathPingStore: cross-world per-player sidecar (firstDeathAtMillis,
  devPingSent) at config/dungeontrain-devping/<uuid>.json, mirroring
  GlobalAchievementStore (synchronized, atomic write).
- DevPingService: qualifies when firstDeathAt>0 && worldCreatedAt>firstDeathAt
  && not yet pinged; consumes the once-only flag atomically. Marker token comes
  from config (blank = dormant; the brennan.games relay swaps a non-blank token
  for the dev <@mention>, so the id never ships in the jar).
- DungeonTrainWorldData: new worldCreatedAtMillis (stamped at creation; 0 for
  legacy worlds, which never qualify).
- RunStatsEvents.onPlayerDeath stamps first-death; TrainBootstrapEvents
  (both-dist server-started) caches the world's creation time.
- DungeonTrainConfig: developerPingRelayToken (SERVER, default blank).

Pins discordpresence 0.12.0 (joinMessageSuffix seam). PATCH bump to 0.298.1.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Extract DevPingService.decideMarker(token, firstDeathAt, worldCreatedAt,
alreadyPinged) as a pure, side-effect-free decision so the once-per-player /
new-world-after-death state machine is verified deterministically without a
Minecraft runtime or a live Discord post. relayMarkerIfQualifies wires the
statics around it and still consumes the once-only flag atomically.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
developerPingRelayToken now defaults to the developer's Discord mention
(<@…>) instead of blank, so the first-new-world-after-death ping notifies
across installs out of the box. Discord Presence 0.12.0 lets that one
trusted suffix mention notify via allowed_mentions.users; blanking the
config disables the dev-ping (the version line is unaffected). Docs updated
to drop the relay-injection framing. PATCH bump to 0.298.2.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant