Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
329 commits
Select commit Hold shift + click to select a range
a19ad0e
Fix duplicate game event logging in test infrastructure
MostCromulent Jan 23, 2026
1f8acfb
Phase 9: Enable full game completion with remote client
MostCromulent Jan 23, 2026
72f4e33
Fix HeadlessNetworkClient game controller capture and add logging
MostCromulent Jan 23, 2026
0afb1ad
Phase 9 complete: Fix headless testing for full game completion
MostCromulent Jan 23, 2026
5c25fd1
Phase 10: Parallel/sequential network game execution
MostCromulent Jan 23, 2026
a2d9db7
Simplify Phase 10: Remove parallel execution, keep sequential only
MostCromulent Jan 23, 2026
47bb0fb
Phase 10: Add multi-process parallel game execution
MostCromulent Jan 23, 2026
585479f
Phase 10: Comprehensive 3-4 player network test infrastructure
MostCromulent Jan 24, 2026
6af176e
Sanitize user paths in network debug logs for privacy
MostCromulent Jan 24, 2026
9870ac3
Update TESTING_DOCUMENTATION.md with multiplayer network test results
MostCromulent Jan 24, 2026
2b93e29
Comprehensive 100-game delta sync validation complete
MostCromulent Jan 24, 2026
65c7167
Network play UI improvements
MostCromulent Jan 24, 2026
ea714fd
Final comprehensive test: 100% success rate, 99.5% bandwidth savings
MostCromulent Jan 24, 2026
8173076
Use human-readable units in Bandwidth by Player Count table
MostCromulent Jan 24, 2026
964a504
Merge NetworkGUIFix: UI improvements for network play
MostCromulent Jan 24, 2026
0ea1a7c
Document Feature 4: Network Play UI Improvements
MostCromulent Jan 24, 2026
293bf39
Merge remote-tracking branch 'upstream/master' into NetworkPlay
MostCromulent Jan 24, 2026
74ef915
Fix duplicate logging and improve test output formatting
MostCromulent Jan 24, 2026
769f182
Fix duplicate chat messages in multiplayer lobby
MostCromulent Jan 24, 2026
30e4f24
Disable audio in headless testing mode
MostCromulent Jan 24, 2026
9e49bb7
Fix parallel game execution in comprehensive testing
MostCromulent Jan 24, 2026
c3cd37d
Show player name in multiplayer waiting prompts
MostCromulent Jan 24, 2026
03f0a83
Add elapsed time display to network waiting prompts and document mult…
MostCromulent Jan 24, 2026
715cc4d
Fix multiplayer delta sync regression and add per-client property tra…
MostCromulent Jan 24, 2026
b3f505a
Update BUGS.md with comprehensive test status summary
MostCromulent Jan 24, 2026
c294de6
Add authorship section to BRANCH_DOCUMENTATION.md
MostCromulent Jan 24, 2026
acef30a
Update BRANCH_DOCUMENTATION.md: consolidate testing section, fix TOC
MostCromulent Jan 24, 2026
2aad2f9
Fix HeadlessNetworkClient auto-response race condition causing test t…
MostCromulent Jan 24, 2026
78d5ffa
Update documentation with comprehensive test results (96% success rate)
MostCromulent Jan 25, 2026
1997430
Improve batch test log naming and analysis reporting
MostCromulent Jan 25, 2026
2fe5ef4
Update documentation with comprehensive test results (98% success rate)
MostCromulent Jan 25, 2026
4b0ea81
Add [Server]/[Client] log prefixes to distinguish network log sources
MostCromulent Jan 25, 2026
ebc9a88
Fix port bind failures and document desync root cause
MostCromulent Jan 25, 2026
a6e6bb2
Improve batch test log naming with unique batch identifiers
MostCromulent Jan 27, 2026
f6e5604
Add .gitattributes to prevent merging branch-specific files
MostCromulent Jan 27, 2026
fceebb3
Reorganize documentation and fix test infrastructure issues
MostCromulent Jan 27, 2026
43d2bb7
Update .gitattributes for .documentation folder
MostCromulent Jan 27, 2026
fb47e13
Consolidate test infrastructure: merge batch tests, remove unused files
MostCromulent Jan 27, 2026
7f4dfe5
Add feature breakdown section to NetworkPlay.md, rename StagedPR.md
MostCromulent Jan 27, 2026
ab10f73
Streamline documentation: remove redundant PR planning sections
MostCromulent Jan 27, 2026
d53f96a
Enhance batch test analyzer with failure analysis and pattern detection
MostCromulent Jan 27, 2026
1245c2d
Add .gitattributes to merge=ours list
MostCromulent Jan 27, 2026
5090ef8
Fix multiplayer desync bugs #12 and #13
MostCromulent Jan 27, 2026
8d8066d
Fix missing Sideboard/Command zone sync, enhance analyzer output
MostCromulent Jan 27, 2026
3d9f635
Add error context extraction for test failure debugging
MostCromulent Jan 27, 2026
1f231a8
Add server-side AI for remote players in network tests
MostCromulent Jan 28, 2026
1e6ff11
Organize network debug logs and enhance cleanup logic
claude Jan 30, 2026
ad48a59
Migrate network debug config to PreferencesStore pattern
claude Jan 30, 2026
2cc3bec
Remove unnecessary migration files
claude Jan 30, 2026
e322b90
Move network logs to user directory and remove test logs
MostCromulent Jan 30, 2026
d308c36
Restore pre-merge test logs
MostCromulent Jan 30, 2026
9808a34
Replace test logs with 20260129 comprehensive test run
MostCromulent Jan 30, 2026
8b068ef
Merge NetworkPlay/dev into main (code changes only)
MostCromulent Jan 30, 2026
a32524a
Add YieldRework PR documentation to .documentation folder
MostCromulent Feb 1, 2026
2d9c32e
Add PR-Review.md with PR #9642 feedback
MostCromulent Feb 1, 2026
a894318
Address PR 9642 review feedback - Phase 1 fixes
MostCromulent Feb 1, 2026
c3f97f1
Address PR 9642 review feedback - Phase 1 fixes
MostCromulent Feb 1, 2026
9a4643c
Fix GuiBase initialization order in BatchGameTest
MostCromulent Feb 1, 2026
406ade7
Merge NetworkPlay/dev: Fix GuiBase initialization order in BatchGameTest
MostCromulent Feb 1, 2026
576fce4
Skip stress tests by default in CI using TestNG SkipException
MostCromulent Feb 1, 2026
a339fdc
Merge branch 'NetworkPlay/dev' into NetworkPlay/main
MostCromulent Feb 1, 2026
58078cb
Delete .documentation directory
MostCromulent Feb 2, 2026
d0bfee7
Delete .claude directory
MostCromulent Feb 2, 2026
edc02ee
Address Copilot review feedback
MostCromulent Feb 2, 2026
4d0e4fd
Fix null safety for FSkin.getColor() calls
MostCromulent Feb 2, 2026
683857d
Skip AutomatedNetworkTest in CI unless stress tests enabled
MostCromulent Feb 2, 2026
9013887
Remove chat styling changes (now in NetworkPlay/chat branch)
MostCromulent Feb 2, 2026
55e1738
Consolidate network test infrastructure: 17 files removed, ~3100 line…
MostCromulent Feb 4, 2026
2bd6cbf
Add single-game analysis reports and unify output locations
MostCromulent Feb 4, 2026
530c235
Fix bandwidth comparison methodology and parallel test execution
MostCromulent Feb 4, 2026
d1834f2
Unify test results file naming with log file conventions
MostCromulent Feb 3, 2026
a3a72db
Run unit tests and testTrueNetworkTraffic in default CI
MostCromulent Feb 3, 2026
df848f0
Fast CI test with minimal decks, rename DeltaSyncUnitTest
MostCromulent Feb 4, 2026
542de52
Remove duplicate result logging from integration tests
MostCromulent Feb 3, 2026
2b7b141
Fix Bug 14 (NPE disconnect) and Bug 15 (TreeSet cast), sanitize paths
MostCromulent Feb 4, 2026
f37080d
Fix Bug 16 (checksum race condition) and Bug 17 (slot assignment)
MostCromulent Feb 4, 2026
6016296
Remove UI enhancements from delta sync branch
MostCromulent Feb 4, 2026
d6da942
Remove ~1700 lines of dead reconnection code (RECONNECT-REFACTOR)
MostCromulent Feb 5, 2026
af240a5
Cleanup pass: fix bugs, enforce logging standards, remove ~700 lines …
MostCromulent Feb 7, 2026
d229b71
Remove chat enhancements from FServerManager (extracted to NetworkPla…
MostCromulent Feb 7, 2026
c18fc32
Fix CI build: revert orphaned chat enhancements from OnlineChatScreen…
MostCromulent Feb 7, 2026
e06a4fd
Extend delta sync to mobile, fix GuiMobile.isGuiThread() threading bug
MostCromulent Feb 8, 2026
b04fef8
Merge remote-tracking branch 'origin/master' into NetworkPlay/main
MostCromulent Feb 8, 2026
ab05d1a
Fix mobile client crash on game start by using server's existing tracker
MostCromulent Feb 8, 2026
e054d52
Merge branch 'master' into NetworkPlay/main
MostCromulent Feb 9, 2026
b04e2e6
Fix CantHaveKeyword type mismatch: StringListType → StringSetType
MostCromulent Feb 9, 2026
6d66b60
Fix 4-player lobby slot assignment race causing startup failures
MostCromulent Feb 9, 2026
c3a1197
Refactor NetworkDebugLogger to SLF4J/Logback facade
MostCromulent Feb 12, 2026
4154496
Use reflection for logback API to avoid compile-time coupling
MostCromulent Feb 12, 2026
e82c09b
Add TRACE log level and [GAME EVENT] category for log optimization
MostCromulent Feb 12, 2026
11f543d
Merge branch 'master' into NetworkPlay/main
MostCromulent Feb 12, 2026
3644758
Merge branch 'NetworkPlay/logrefactor' into NetworkPlay/main
MostCromulent Feb 12, 2026
bf3e049
Fix connection stagger and finalize log refactor cleanup
MostCromulent Feb 12, 2026
03b0b64
Clean up dead code and simplify analysis report
MostCromulent Feb 12, 2026
09eb615
Address code review findings: correctness, thread safety, and cleanup
MostCromulent Feb 12, 2026
8d71574
Merge remote-tracking branch 'upstream/master' into NetworkPlay/main
MostCromulent Feb 18, 2026
265d8cb
Fix GameEventGameOutcome API usage after upstream merge
MostCromulent Feb 18, 2026
9616833
Merge upstream/master into NetworkPlay/main
MostCromulent Feb 23, 2026
069e4dd
Discover StackItemView card references in delta sync walker
MostCromulent Feb 24, 2026
886c6ce
Merge remote-tracking branch 'upstream/master' into NetworkPlay/main
MostCromulent Feb 26, 2026
a24b7d5
Migrate NetworkPlay logging from SLF4J/Logback to tinylog 2
MostCromulent Feb 26, 2026
4602e1d
Merge remote-tracking branch 'upstream/master' into NetworkPlay/main
MostCromulent Feb 28, 2026
fa86ff2
Merge upstream/master into NetworkPlay/main
MostCromulent Feb 28, 2026
83885aa
Address PR #9642 review feedback from tool4ever
MostCromulent Feb 28, 2026
c41a66c
Remove low-value wiring tests from DeltaSyncUnitTest and NetworkPlayI…
MostCromulent Feb 28, 2026
907caa5
Move DeltaSyncUnitTest from gamesimulationtests to net package
MostCromulent Feb 28, 2026
f77aed0
Delete dead code and consolidate result class hierarchies
MostCromulent Feb 28, 2026
76879c0
Remove redundant test methods from NetworkPlayIntegrationTest
MostCromulent Feb 28, 2026
8346cd1
Apply PR #9935 review feedback to batch testing infrastructure
MostCromulent Mar 1, 2026
4adae21
Replace binary serialization with property map transport in delta sync
MostCromulent Mar 6, 2026
5e9c9a9
Merge remote-tracking branch 'origin/master' into NetworkPlay/main
MostCromulent Mar 6, 2026
ece98f5
Merge remote-tracking branch 'origin/master' into NetworkPlay/main
MostCromulent Mar 6, 2026
595fdb5
Fix merge conflicts with upstream master
MostCromulent Mar 6, 2026
c2721ae
Merge upstream master into NetworkPlay/main
MostCromulent Mar 7, 2026
bc6618b
Remove NetworkDebugLogger facade — use tinylog directly
MostCromulent Mar 7, 2026
3bacd49
Fix delta sync regression and improve bandwidth measurement methodology
MostCromulent Mar 8, 2026
ee6ff15
Minor cleanup
Mar 8, 2026
de22706
Address PR #9642 review feedback from tool4ever
MostCromulent Mar 8, 2026
b4bec09
Replace arbitrary safety limits with visited-set cycle detection in D…
MostCromulent Mar 8, 2026
c8dd861
Move network prefs to ForgeNetPreferences, remove obsolete ones
MostCromulent Mar 8, 2026
5b992aa
Minor cleanup
Mar 8, 2026
0f69585
Fix tinylog error parameter order, guard CMatchUI network logging
MostCromulent Mar 8, 2026
fd5e586
Merge branch 'master' into NetworkPlay/main
tool4ever Mar 8, 2026
b7015b2
Address PR review feedback: rename NetGuiGame, add client LoggingHandler
MostCromulent Mar 8, 2026
fae6be1
Consolidate fullStateSync into setGameView
MostCromulent Mar 8, 2026
0adaa28
Improve log analyzer: network metrics, CLI, subdirectory layout
MostCromulent Mar 9, 2026
8f9bed7
Lazily initialize GameLog for deserialized GameView instances
MostCromulent Mar 9, 2026
4b162bd
Fix network client cards rendering as hidden due to stale Zone property
MostCromulent Mar 9, 2026
5062486
Add client-side assertions to network CI test
MostCromulent Mar 9, 2026
795594d
Merge branch 'master' into NetworkPlay/main
MostCromulent Mar 9, 2026
69ade26
Address PR review feedback
MostCromulent Mar 9, 2026
f61c19e
Consolidate type-detection logic into DeltaPacket
MostCromulent Mar 9, 2026
c054c3c
Fix misleading network metrics labels in log analyzer
MostCromulent Mar 9, 2026
d96ce98
Merge branch 'master' into NetworkPlay/main
MostCromulent Mar 10, 2026
702e10d
Remove redundant attached-cards walk from DeltaSyncManager.collectCar…
MostCromulent Mar 10, 2026
a7e5d9f
Remove server-side enhanceWaitingMessage, obsoleted by #9671
MostCromulent Mar 10, 2026
7d4b243
Fix write-buffering regression in handleGameEvents
MostCromulent Mar 10, 2026
73043c9
Consolidate client tracker initialization into GameClientHandler.befo…
MostCromulent Mar 11, 2026
e821df7
Merge branch 'master' into NetworkPlay/main
tool4ever Mar 11, 2026
b2445da
Clean up
Mar 11, 2026
37433d7
Consolidate Battlefield into forEachZone helper in DeltaSyncManager
MostCromulent Mar 11, 2026
27b274b
Clean up
Mar 11, 2026
e0176a0
Merge remote-tracking branch 'claude/NetworkPlay/main' into NetworkPl…
Mar 11, 2026
1bb3089
Clean up
Mar 11, 2026
31d2bfd
Clean up
Mar 12, 2026
66a7902
Simplify DeltaPacket and clean up NetworkGuiGame
MostCromulent Mar 12, 2026
3cb02ed
Add CombatView delta sync and complete TrackableType coverage
MostCromulent Mar 12, 2026
9762da8
Clean up redundant comments across network play files
MostCromulent Mar 12, 2026
490d95f
Clean up
Mar 12, 2026
5f69225
Clean up
Mar 12, 2026
7498873
Clean up
Mar 12, 2026
4afa09d
Replace hardcoded DeltaSyncManager traversal with generic graph walker
MostCromulent Mar 12, 2026
a5df703
Fix client phase indicator desync during delta sync
MostCromulent Mar 12, 2026
368311c
Fix client card state desync and phase indicator during network play
MostCromulent Mar 12, 2026
b9019bc
Address PR review feedback from tool4ever
MostCromulent Mar 13, 2026
9bf1be7
Fix bandwidth logging and add state-only analysis metric
MostCromulent Mar 13, 2026
e4c4097
Fix adventure/transform card display on remote client
MostCromulent Mar 13, 2026
6595f8d
Unify event delivery through DeltaPacket
MostCromulent Mar 13, 2026
7f9d723
Improve code
Mar 13, 2026
b15757e
Merge branch 'master' into NetworkPlay/main
tool4ever Mar 13, 2026
4b0615a
Clean up
Mar 13, 2026
f190270
Remove unused ack tracking from delta sync
MostCromulent Mar 14, 2026
f6c83b0
Fix card property desync on remote client (tapped state, etc.)
MostCromulent Mar 14, 2026
7763dc9
Clean up
Mar 14, 2026
c4f8eb1
Fix remote client card selection NPE from virtual zone mapping
MostCromulent Mar 14, 2026
436ca57
Add deep checksum validation for network play batch tests
MostCromulent Mar 14, 2026
590a455
Fix CardStateView delta sync and applyCardStateData property routing
MostCromulent Mar 14, 2026
5c26322
Fix delta sync checksum desync from mutable aliasing and stale replac…
MostCromulent Mar 14, 2026
793f958
Add Commander format to batch testing and checksum mismatch breakdown…
MostCromulent Mar 14, 2026
177e911
Fix commander deltaKey collision, tracker freeze, and checksum race
MostCromulent Mar 14, 2026
68fcd42
Fix tapped state not syncing to client when tracker is frozen
MostCromulent Mar 15, 2026
2a7c004
Add event-delta consistency validation to batch tests
MostCromulent Mar 15, 2026
9861d60
Fix Playable Zone Cards not showing commander on network client
MostCromulent Mar 15, 2026
bfeeddd
Improve batch test reliability: port allocation, event validation, ti…
MostCromulent Mar 15, 2026
fb1f633
Clean up
Mar 15, 2026
6397cab
Clean up
Mar 15, 2026
dc1ed55
Use flagAsChanged for in-place-mutated view properties
MostCromulent Mar 15, 2026
848a5dc
Extend CardStateView delta tracking to all four state slots and froze…
MostCromulent Mar 16, 2026
111eb35
Clean up
Mar 16, 2026
243538f
Replace shallow production checksum with sampled property checksum
MostCromulent Mar 16, 2026
8db2b93
Remove unused Lists import from CardView
MostCromulent Mar 16, 2026
48240d8
Refine comments
Mar 16, 2026
3d9c8b7
Cleanup redundant field
Mar 16, 2026
5f3104c
Cleanup method signatures
Mar 16, 2026
09ac37b
Cleanup duplicated type management
Mar 16, 2026
2c818a3
Clean up
Mar 16, 2026
af07abd
Clean up
Mar 16, 2026
144037c
Clean up
Mar 17, 2026
c4e91ff
Fix checksum validation: eliminate false positives, ensure regular fi…
MostCromulent Mar 16, 2026
cef100f
Refactor CSV delta sync: composite key replaces special-case code
MostCromulent Mar 16, 2026
cd768ab
Add per-game checksum stats to batch test analysis
MostCromulent Mar 16, 2026
40eabb9
Log server-side checksum breakdown on mismatch, fix double newline in…
MostCromulent Mar 16, 2026
ef4638e
Fix commander desync: update commander list on zone change
MostCromulent Mar 17, 2026
da4cdab
Fix analysis: accurate mismatch count, reduce error context bloat
MostCromulent Mar 17, 2026
c84044f
Fix delta sync desyncs: defer initial sync, preserve CSVs on slot swap
MostCromulent Mar 17, 2026
999ad10
Fix delta sync: merge delayed props for new objects, improve checksum…
MostCromulent Mar 17, 2026
11ff112
Merge remote-tracking branch 'upstream/master' into NetworkPlay/main
MostCromulent Mar 17, 2026
69fefc2
Clean up redundant comments & inline CSV key check
Mar 18, 2026
0688613
Fix logic
Mar 18, 2026
a01da32
Fix delta sync: resolve persistent desyncs, improve daemon thread safety
MostCromulent Mar 18, 2026
706b661
Compute server checksum from delta-consistent snapshots
MostCromulent Mar 18, 2026
8bea87b
Fix delta sync: CSV key encoding, new-object ordering, stale referenc…
MostCromulent Mar 18, 2026
9ade718
Fix checksum snapshot race: capture from same read as delta values
MostCromulent Mar 19, 2026
b580481
Fix consumer map race in TrackableObject for concurrent DeltaSyncMana…
MostCromulent Mar 19, 2026
1ada042
Clean up review issues: deduplicate snapshot capture, consolidate che…
MostCromulent Mar 19, 2026
e67ce6c
Fix sampled checksum: snapshot-aware object discovery and determinist…
MostCromulent Mar 20, 2026
e6fdfd3
Merge TestTrueNetworkTraffic into NetworkPlayIntegrationTest
MostCromulent Mar 20, 2026
ed8369c
Refactor Fix #7 based on past experiences
Mar 20, 2026
3cc351b
Avoid merging delayed props extra for checksums
Mar 20, 2026
23ca2ff
Remove dead code
Mar 20, 2026
412b208
Reorder methods based on main logic flow
Mar 20, 2026
a55e2e5
Clean up
Mar 20, 2026
bd7ae7f
Fix stack/mutate card discovery, checksum collection race, and game l…
MostCromulent Mar 22, 2026
2f76cc1
Merge branch 'master' into NetworkPlay/main
tool4ever Mar 22, 2026
0707bb0
Fix stale cross-reference CardView replacements in delta sync
MostCromulent Mar 22, 2026
b310ef1
Clean up
Mar 22, 2026
cf9ae23
Merge branch 'master' into NetworkPlay/main
MostCromulent Mar 23, 2026
60f23da
Simplify walkAndCollect into sorted single loop
MostCromulent Mar 24, 2026
a9ae9e1
Rework analysis report: separate completion from data integrity
MostCromulent Mar 24, 2026
946defd
Game-thread-only delta production
MostCromulent Mar 24, 2026
5b7a7c3
Cleanup: remove obsolete snapshot code, revert null tracker
MostCromulent Mar 24, 2026
4f3100f
Clean up
Mar 25, 2026
6ef63c1
Fix non-delta path regression, flush events after mana undo
MostCromulent Mar 27, 2026
0c9c0c8
Move ZoneType→TrackableProperty mapping to ZoneType enum
MostCromulent Mar 28, 2026
b4a5b14
Simplify walker: skip stale children, remove sort, simplify block checks
MostCromulent Mar 28, 2026
8e7b18c
Fix cross-JVM checksum divergence for Map properties with enum keys
MostCromulent Mar 28, 2026
61db32f
Simplify walkAndCollect: move auth check before seen-set mutation
MostCromulent Mar 28, 2026
debc9aa
Clean up
Mar 28, 2026
d4154c9
Merge branch 'master' into NetworkPlay/main
tool4ever Mar 28, 2026
e67bc8b
Fix CombatView desync: placeholder for fake Card(-1) combat defenders
MostCromulent Mar 28, 2026
43070f7
Fix client game log/stack showing wrong card image after zone change
MostCromulent Mar 28, 2026
c6289f0
Remove obsolete daemon-thread concurrency artifacts
MostCromulent Mar 28, 2026
7e07262
Fix resync thread-safety: defer sendFullState to game thread
MostCromulent Mar 29, 2026
2b24bd1
Clean up
Mar 29, 2026
6c3bd5c
Merge branch 'master' into NetworkPlay/main
tool4ever Mar 29, 2026
3d4bf61
Clean up
Mar 29, 2026
f784c68
Fix remote client hand not refreshing after delta sync zone changes
MostCromulent Mar 29, 2026
1cea9c5
Clean up test infrastructure comments and javadoc
MostCromulent Mar 30, 2026
a3cc77e
Clean up
Mar 30, 2026
fd5d69a
Add "Open Network Logs" menu item to Online menu
MostCromulent Mar 31, 2026
9ea6142
Merge branch 'master' into NetworkPlay/main
tool4ever Apr 2, 2026
66fa37c
Merge branch 'master' into NetworkPlay/main
tool4ever Apr 2, 2026
5888d5d
Last cleaning?
Apr 2, 2026
d238ff2
Add test configuration flags and checksum firing validation
MostCromulent Apr 2, 2026
40a4de9
Merge remote-tracking branch 'upstream/master' into NetworkPlay/main
Apr 4, 2026
0cefb9a
Merge
Apr 4, 2026
5c1a990
Prepare unarmed
Apr 6, 2026
782fa96
Merge branch 'master' into NetworkPlay/main
tool4ever Apr 6, 2026
cdf3459
comment cleanup
MostCromulent Apr 8, 2026
c173381
Merge remote-tracking branch 'upstream/master' into NetworkPlay/main
MostCromulent Apr 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion forge-game/src/main/java/forge/game/GameLogFormatter.java
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public GameLogEntry visit(final GameEventBlockersDeclared ev) {
}

String controllerName;
if (defender instanceof CardView c) {
if (defender instanceof CardView c && c.getController() != null) {
controllerName = c.getCurrentState().isBattle() ? c.getProtectingPlayer().getName() : c.getController().getName();
} else {
controllerName = defender.getName();
Expand Down
37 changes: 15 additions & 22 deletions forge-game/src/main/java/forge/game/GameView.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class GameView extends TrackableObject {

private final transient Game game; //TODO: Remove this when possible before network support added
private final transient Match match; //TODO: Remove this when possible before network support added
private final transient GameLog gameLog;
private transient GameLog gameLog;

public GameView(final Game game) {
super(game.getId(), game.getTracker());
Expand Down Expand Up @@ -184,6 +184,11 @@ public GameLog getGameLog() {
return gameLog;
}

/** Initialize the game log for network-deserialized GameViews (transient field is null after deserialization). */
public void initGameLog() {
this.gameLog = new GameLog();
}

public TrackableCollection<CardView> getRevealedCollection() {
return get(TrackableProperty.RevealedCardsCollection);
}
Expand Down Expand Up @@ -218,9 +223,6 @@ public void setDependencies(Table<StaticAbility, StaticAbility, Set<StaticAbilit
public CombatView getCombat() {
return get(TrackableProperty.CombatView);
}
public void updateCombatView(CombatView combatView) {
set(TrackableProperty.CombatView, combatView);
}

void updateCombat(Combat combat) {
if (combat == null) {
Expand All @@ -240,24 +242,7 @@ void updateCombat(Combat combat) {
isBlocked ? CardView.getCollection(blockers) : null,
CardView.getCollection(blockers));
}
updateCombatView(combatView);
}

public void serialize() {
/*try {
GameStateSerializer serializer = new GameStateSerializer(filename);
game.saveState(serializer);
serializer.writeEndOfFile();
serializer.bw.close();
}
catch (Exception e) {
e.printStackTrace();
}*/
}

public void deserialize() {
/*GameStateDeserializer deserializer = new GameStateDeserializer();
deserializer.readObject();*/
set(TrackableProperty.CombatView, combatView);
}

//TODO: Find better ways to make this information available to all GUIs without using the Game class
Expand Down Expand Up @@ -294,4 +279,12 @@ public GameOutcome getOutcome() {
public AnteResult getAnteResult(PlayerView player) {
return getOutcome().getAnteResult(player);
}

@Override
public String toString() {
return String.format("GameView[id=%d, turn=%d, phase=%s, players=%d, gameOver=%b]",
getId(), getTurn(), getPhase(),
getPlayers() != null ? getPlayers().size() : 0,
isGameOver());
}
}
7 changes: 6 additions & 1 deletion forge-game/src/main/java/forge/game/card/CardView.java
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ public boolean hasSamePT(CardView otherCard) {
}
void updateCounters(Card c) {
set(TrackableProperty.Counters, c.getCounters());
flagAsChanged(TrackableProperty.Counters);
updateLethalDamage(c);
CardStateView state = getCurrentState();
state.updatePower(c);
Expand Down Expand Up @@ -425,6 +426,7 @@ public List<String> getNotedTypes() {
}
void updateNotedTypes(Card c) {
set(TrackableProperty.NotedTypes, c.getNotedTypes());
flagAsChanged(TrackableProperty.NotedTypes);
}

public String getChosenNumber() {
Expand All @@ -449,6 +451,7 @@ public List<String> getChosenColors() {
}
void updateChosenColors(Card c) {
set(TrackableProperty.ChosenColors, c.getChosenColors());
flagAsChanged(TrackableProperty.ChosenColors);
}
public boolean hasPaperFoil() {
return get(TrackableProperty.PaperFoil);
Expand Down Expand Up @@ -621,13 +624,15 @@ void updateSprocket(Card c) {
public List<String> getDraftAction() { return get(TrackableProperty.DraftAction); }
void updateDraftAction(Card c) {
set(TrackableProperty.DraftAction, c.getDraftActions());
flagAsChanged(TrackableProperty.DraftAction);
}

public List<String> getNamedCard() {
return get(TrackableProperty.NamedCard);
}
void updateNamedCard(Card c) {
set(TrackableProperty.NamedCard, c.getNamedCards());
flagAsChanged(TrackableProperty.NamedCard);
}
public boolean getMayPlayPlayers(PlayerView pv) {
TrackableCollection<PlayerView> col = get(TrackableProperty.MayPlayPlayers);
Expand Down Expand Up @@ -995,7 +1000,7 @@ public boolean hasBackSide() {
}
public String getBackSideName() { return get(TrackableProperty.BackSideName); }

CardStateView createAlternateState(final CardStateName state0) {
public CardStateView createAlternateState(final CardStateName state0) {
return new CardStateView(getId(), state0, tracker);
}

Expand Down
8 changes: 6 additions & 2 deletions forge-game/src/main/java/forge/game/combat/CombatView.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@
import forge.util.collect.FCollection;

public class CombatView extends TrackableObject {
private static final long serialVersionUID = 68085618912864941L;
private static final long serialVersionUID = 68085618912864942L;

// Unique negative IDs so TrackableObject.equals() distinguishes instances.
// Negative IDs avoid tracker registration (only id >= 0 is registered).
private static int nextId = -2;

public CombatView(final Tracker tracker) {
super(-1, tracker); //ID not needed
super(nextId--, tracker);
set(TrackableProperty.AttackersWithDefenders, new ConcurrentHashMap<CardView, GameEntityView>());
set(TrackableProperty.AttackersWithBlockers, new ConcurrentHashMap<CardView, FCollection<CardView>>());
set(TrackableProperty.BandsWithDefenders, new ConcurrentHashMap<FCollection<CardView>, GameEntityView>());
Expand Down
32 changes: 8 additions & 24 deletions forge-game/src/main/java/forge/game/player/PlayerView.java
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ public int getCounters(CounterType counterType) {
}
void updateCounters(Player p) {
set(TrackableProperty.Counters, p.getCounters());
flagAsChanged(TrackableProperty.Counters);
}

public boolean getIsExtraTurn() {
Expand Down Expand Up @@ -390,18 +391,20 @@ void updateCommanderCast(Player p, Card c) {
Map<Integer, Integer> map = get(TrackableProperty.CommanderCast);
if (map == null) {
map = Maps.newHashMap();
set(TrackableProperty.CommanderCast, map);
}
map.put(c.getId(), p.getCommanderCast(c));
set(TrackableProperty.CommanderCast, map);
flagAsChanged(TrackableProperty.CommanderCast);
}

void updateMergedCommanderCast(Player p, Card target, Card commander) {
Map<Integer, Integer> map = get(TrackableProperty.CommanderCast);
if (map == null) {
map = Maps.newHashMap();
set(TrackableProperty.CommanderCast, map);
}
map.put(target.getId(), p.getCommanderCast(commander));
set(TrackableProperty.CommanderCast, map);
flagAsChanged(TrackableProperty.CommanderCast);
}

public PlayerView getMindSlaveMaster() {
Expand Down Expand Up @@ -448,7 +451,7 @@ public FCollectionView<CardView> getSideboard() {
}

public FCollectionView<CardView> getCards(final ZoneType zone) {
TrackableProperty prop = getZoneProp(zone);
TrackableProperty prop = zone.getTrackableProperty();
if (prop != null) {
return get(prop);
}
Expand All @@ -460,7 +463,7 @@ private int getZoneSize(TrackableProperty zoneProp) {
}

public int getZoneSize(final ZoneType zone) {
TrackableProperty prop = getZoneProp(zone);
TrackableProperty prop = zone.getTrackableProperty();
return prop == null ? 0 : getZoneSize(prop);
}

Expand All @@ -481,27 +484,8 @@ public boolean hasDelirium() {
return getZoneTypes(TrackableProperty.Graveyard) >= 4;
}

private static TrackableProperty getZoneProp(final ZoneType zone) {
switch (zone) {
case Ante: return TrackableProperty.Ante;
case Battlefield: return TrackableProperty.Battlefield;
case Command: return TrackableProperty.Command;
case Exile: return TrackableProperty.Exile;
case Graveyard: return TrackableProperty.Graveyard;
case Hand: return TrackableProperty.Hand;
case Library: return TrackableProperty.Library;
case Flashback: return TrackableProperty.Flashback;
case Sideboard: return TrackableProperty.Sideboard;
case PlanarDeck: return TrackableProperty.PlanarDeck;
case SchemeDeck: return TrackableProperty.SchemeDeck;
case AttractionDeck: return TrackableProperty.AttractionDeck;
case ContraptionDeck: return TrackableProperty.ContraptionDeck;
case Junkyard: return TrackableProperty.Junkyard;
default: return null; //other zones not represented
}
}
void updateZone(PlayerZone zone) {
TrackableProperty prop = getZoneProp(zone.getZoneType());
TrackableProperty prop = zone.getZoneType().getTrackableProperty();
if (prop == null) { return; }
set(prop, CardView.getCollection(zone.getCards(false)));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import forge.game.player.PlayerView;
import forge.trackable.TrackableCollection;
import forge.trackable.TrackableObject;
import forge.trackable.Tracker;
import forge.trackable.TrackableProperty;
import forge.util.collect.FCollectionView;

Expand Down Expand Up @@ -41,6 +42,14 @@ public StackItemView(SpellAbilityStackInstance si) {
updateOptionalCost(si);
}

/**
* Constructor for network deserialization.
* Creates an empty StackItemView that will be populated via property deserialization.
*/
public StackItemView(final int id0, final Tracker tracker) {
super(id0, tracker);
}

public String getKey() {
return get(TrackableProperty.Key);
}
Expand Down
40 changes: 26 additions & 14 deletions forge-game/src/main/java/forge/game/zone/ZoneType.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package forge.game.zone;

import forge.trackable.TrackableProperty;
import forge.util.ITranslatable;
import forge.util.Localizer;

Expand All @@ -11,22 +12,22 @@
* The Enum Zone.
*/
public enum ZoneType implements ITranslatable {
Hand(true, "lblHandZone"),
Library(true, "lblLibraryZone"),
Graveyard(false, "lblGraveyardZone"),
Battlefield(false, "lblBattlefieldZone"),
Exile(false, "lblExileZone"),
Flashback(false, "lblFlashbackZone"),
Command(false, "lblCommandZone"),
Hand(true, "lblHandZone", TrackableProperty.Hand),
Library(true, "lblLibraryZone", TrackableProperty.Library),
Graveyard(false, "lblGraveyardZone", TrackableProperty.Graveyard),
Battlefield(false, "lblBattlefieldZone", TrackableProperty.Battlefield),
Exile(false, "lblExileZone", TrackableProperty.Exile),
Flashback(false, "lblFlashbackZone", TrackableProperty.Flashback),
Command(false, "lblCommandZone", TrackableProperty.Command),
Stack(false, "lblStackZone"),
Sideboard(true, "lblSideboardZone"),
Ante(false, "lblAnteZone"),
Sideboard(true, "lblSideboardZone", TrackableProperty.Sideboard),
Ante(false, "lblAnteZone", TrackableProperty.Ante),
Merged(false, "lblBattlefieldZone"),
SchemeDeck(true, "lblSchemeDeckZone"),
PlanarDeck(true, "lblPlanarDeckZone"),
AttractionDeck(true, "lblAttractionDeckZone"),
Junkyard(false, "lblJunkyardZone"),
ContraptionDeck(true, "lblContraptionDeckZone"),
SchemeDeck(true, "lblSchemeDeckZone", TrackableProperty.SchemeDeck),
PlanarDeck(true, "lblPlanarDeckZone", TrackableProperty.PlanarDeck),
AttractionDeck(true, "lblAttractionDeckZone", TrackableProperty.AttractionDeck),
Junkyard(false, "lblJunkyardZone", TrackableProperty.Junkyard),
ContraptionDeck(true, "lblContraptionDeckZone", TrackableProperty.ContraptionDeck),
//Scrapyard is like the Junkyard but for contraptions; just going to recycle the Junkyard for this.
Subgame(true, "lblSubgameZone"),
// ExtraHand is used for Backup Plan for temporary extra hands
Expand All @@ -40,9 +41,20 @@ public enum ZoneType implements ITranslatable {

private final boolean holdsHiddenInfo;
private final String label;
private final TrackableProperty trackableProperty;

ZoneType(boolean holdsHidden, String label) {
this(holdsHidden, label, null);
}
ZoneType(boolean holdsHidden, String label, TrackableProperty trackableProperty) {
holdsHiddenInfo = holdsHidden;
this.label = label;
this.trackableProperty = trackableProperty;
}

/** Returns the TrackableProperty that holds this zone's cards on PlayerView, or null. */
public TrackableProperty getTrackableProperty() {
return trackableProperty;
}

public static ZoneType smartValueOf(final String value) {
Expand Down

This file was deleted.

Loading
Loading