Skip to content

Add version check warning for network play#9698

Merged
tool4ever merged 1 commit intoCard-Forge:masterfrom
MostCromulent:NetworkPlay/version
Feb 8, 2026
Merged

Add version check warning for network play#9698
tool4ever merged 1 commit intoCard-Forge:masterfrom
MostCromulent:NetworkPlay/version

Conversation

@MostCromulent
Copy link
Contributor

@MostCromulent MostCromulent commented Feb 8, 2026

Summary

  • Client now sends its Forge version to the server as part of the login handshake
  • Server compares client version against host version when a player joins
  • If versions differ, a chat warning is displayed advising players to use the same version to avoid network compatibility issues

Requested by @tool4ever in #9642 — small standalone PR to give hosts visibility over potential version mismatches before they cause problems.

Details

Adds a version field to LoginEvent, populated with BuildInfo.getVersionString(). The server checks it in LobbyInputHandler after the player is assigned a lobby slot. Three cases:

Scenario Result
Versions match Silent (no message)
Versions differ Warning: "PlayerName is using Forge version X (host: Y). Please use the same version as the host to avoid network compatibility issues."
Old client (no version field) Warning: "Could not determine PlayerName's Forge version..."

Backward compatible — serialVersionUID is unchanged, so old clients/servers handle the new field gracefully (defaults to null).

3 files changed, +24 −2 lines.

Test plan

  • Compile check passes (0 checkstyle violations)
  • Manually tested version mismatch warning by hardcoding a fake version on the client
  • Simulated CI locally (mvn -U -B clean test) — all 13 modules pass

🤖 Generated with Claude Code

Client sends its Forge version in LoginEvent during the connection
handshake. Server compares it against the host version and broadcasts
a chat warning if they differ, advising players to use the same
version to avoid network compatibility issues.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Contributor

@tool4ever tool4ever left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

@tool4ever tool4ever merged commit f61a5b8 into Card-Forge:master Feb 8, 2026
2 checks passed
@MostCromulent MostCromulent deleted the NetworkPlay/version branch February 8, 2026 23:35
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.

2 participants