Repository navigation
Keep one-time and cooldown data per character by default - #2
Merged
Merged
Conversation
An event can now set data_scope: character to keep its one_time flag and cooldown per roleplay character instead of per account. Such events run only while a character is in play, tracked from TLibs session events so async events can read it. Each account's existing data for those events moves to its RPCharacters heir when a session starts. Events without the setting behave as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Match Codex: a reviewed heir missing from a known roster falls through to the most-played rule. Drop RPCharacters from softdepend, since RPCharacters loads after SimpleFactions, which loads after ConditionalEvents. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Old per-account data doesn't say which character ran an event, so no character inherits it. Per-character events read only character data; account-level entries for them stay in the file, unused. This removes the heir lookup and the move at session start. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A per-character event fixes its character when it starts and uses it for every check and write. If that character is no longer in play when an action is due (after wait_ticks, or after an async event hands over to the main thread), the rest is dropped and the one-time flag and cooldown it set are undone, so the character can earn it again. - Events without a player never run per-character. - PlayerData is locked for every access; saves write a snapshot, clear the dirty flag only if nothing changed meanwhile, and never write one account's file twice at once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Events with one_time or a cooldown now keep that data per character unless they set data_scope: account. Events without such data, and events without a player, have nothing to keep per character and run as upstream, so join, server-start and plain command events are unaffected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A per-character run's record (character, marks set, abandoned) is shared with every action group it calls through execute_action_group, so nested delayed actions are checked too and the undo happens once. - An abandoned run undoes only what it still owns: the one-time flag unless a staff reset happened since, and the cooldown only if it is still the start it wrote. - An undo touches only loaded data; it never creates an empty account that could overwrite the saved file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resetting one event no longer stops an abandoned run of another event from undoing its marks. A reset of the same event, or of all events, still does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ryanbarlow97
force-pushed
the
character-scope
branch
from
October 14, 2026 22:14
86e37d9 to
9864f4c
Compare
Contributor
Author
|
Reviewed by Astra (GPT-6-Astra) over four read-only rounds (reports kept locally); every finding fixed, the last with tests for its exact scenario. Merging with admin bypass. Not released or deployed. |
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.
Once-only flags and cooldowns now belong to the roleplay character being played, unless an event opts back to the account. Stacked on #1.
Why. Codex discoveries become per character in Codex #2. On Main, 87 Codex unlock events in
codex.ymlandcodex_research.ymlareone_time, and today those flags are per account. Without this change, a second character could never earncodex_die, a duchy title or a research entry the account already has.What the default affects. Only events that keep data, meaning those with
one_timeor acooldown, and only when a player is involved. Such an event runs only while a character is in play, so not at join before a character is chosen. Events without that data, and player-less events such asserver_startorplayer_pre_join, have nothing to keep per character and run exactly as upstream. On Main that leaves 90 events affected:r_lore.yml, where per character is fine;act1_exp_catchupandact1_exp_catchup_retry, which should getdata_scope: accountat deployment so the one-off pre-split catch-up doesn't arm again for every character.How it works.
characters.<character>.events, and loads with the account at login as before. Upstream files load unchanged.wait_ticks) or the hand-over from an async event, the rest is dropped and the run's one-time flag and cooldown are undone./ce reset <player> <event>and/ce reset * <event>clear the account and every character.data_scopevalue logs a warning and counts ascharacter.Tests. JUnit and Mockito cover scope rules, the data model and snapshots, the file format, the tracker and run abandonment. JaCoCo requires 100% line coverage of
net.tfminecraft.conditionalevents.character.mvn clean verifypasses (19 tests).🤖 Generated with Claude Code