feat: Discord join messages show the mod version + dev milestone ping - #388
Open
bh679 wants to merge 5 commits into
Open
feat: Discord join messages show the mod version + dev milestone ping#388bh679 wants to merge 5 commits into
bh679 wants to merge 5 commits into
Conversation
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]>
…-291c2b # Conflicts: # gradle.properties
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 + anallowed_mentions.usersallow-list so the one trusted suffix mention actually notifies (player names / chat never can).discordpresence_versionbumped to0.13.0.DungeonTrain side
DungeonTrain.commonSetupprovider override returns"DungeonTrain " + version(fromModList) + the dev mention when the player qualifies.discord/GlobalDeathPingStore— cross-world per-player sidecar (firstDeathAtMillis,devPingSent) atconfig/dungeontrain-devping/<uuid>.json, mirroringGlobalAchievementStore.discord/DevPingService— qualifies whenfirstDeathAt > 0 && worldCreatedAt > firstDeathAt && !devPingSent; puredecideMarker(...)unit-tested.world/DungeonTrainWorldData.worldCreatedAtMillis(stamped at creation; 0 for legacy worlds → never qualify).RunStatsEvents.onPlayerDeathstamps 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
JoinBodyFormatTest(incl. "player-name lookalike not pingable"); DT:DevPingServiceTest(state machine). Both suites green.Mod impact
Dependency bump only (discordpresence 0.13.0, jarJar). New per-player sidecar JSON + an additive
worldCreatedAtMillisSavedData field (no save break). No MC/NeoForge/Sable bump; no new mixins/blocks/items/entities/world-gen/packets.🤖 Generated with Claude Code