Make GameLog transient — clients build from forwarded events#9802
Merged
tool4ever merged 4 commits intoCard-Forge:masterfrom Feb 19, 2026
Merged
Make GameLog transient — clients build from forwarded events#9802tool4ever merged 4 commits intoCard-Forge:masterfrom
tool4ever merged 4 commits intoCard-Forge:masterfrom
Conversation
GameLog was a TrackableProperty on GameView that was never actually delta-synced (flagAsChanged was dead code). Now that game events are forwarded to remote clients, each client can run its own GameLogFormatter on the forwarded events to build the game log locally. - Move GameLog from TrackableProperty to transient field on GameView - Remove TrackableProperty.GameLog enum entry - Remove dead code: Game.updateGameLogForView(), GameView.updateGameLog() - Wire AbstractGuiGame.handleGameEvent() to feed events to local GameLog - Narrow GameLog.getEventVisitor() return type to GameLogFormatter Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
|
works almost as expected :) I'd suggest we just wrap them in a new lightweight |
…ents GameLog was made transient so clients build logs from forwarded events, but 25 call sites used GameLog.add() directly, bypassing the event system. Introduces GameEventAddLog to wrap these calls so they propagate to remote clients. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Author
|
See latest commit.
|
tool4ever
approved these changes
Feb 19, 2026
clairchiara
pushed a commit
to clairchiara/forge
that referenced
this pull request
Feb 28, 2026
…rge#9802) GameLog was made transient so clients build logs from forwarded events, but 25 call sites used GameLog.add() directly, bypassing the event system. Introduces GameEventAddLog to wrap these calls so they propagate to remote clients. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: tool4EvEr <tool4EvEr@>
22 tasks
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.
Summary
Follow-up to #9760, as requested by @tool4ever in his approval review:
Now that game events are forwarded to remote clients (#9760), each client can build its own GameLog locally by feeding forwarded events to
GameLogFormatter. This removes GameLog from network serialization entirely.Changes
GameView:gameLogis now atransientfield (no longer sent over network). RemovedupdateGameLog()which was only reachable from dead codeTrackableProperty: RemovedGameLogentry (was typed asStringTypebut stored aGameLogobject — a type mismatch)Game: Removed dead methodupdateGameLogForView()(no callers)GameLog: NarrowedgetEventVisitor()return type toGameLogFormatter(wasIGameEventVisitor<?>) and removed the now-unused importAbstractGuiGame: InhandleGameEvent(), feeds forwarded events to the localGameLogFormatterso remote clients populate their own game log. The host is unaffected — it populates via its EventBus subscriptionTesting
Manually tested with a two-player network game (host + remote client). Added temporary
System.out.printlnlogging inhandleGameEvent()to verify client-side GameLog population. Confirmed:openView(when the client creates its local Game/GameView with a real GameLog). Events beforeopenVieware setup events (zone changes, stats) that don't produce log entries on the host eitherhandleGameEvent()is only called on the remote client via the network protocol; the host uses its EventBus subscription