Skip to content

Network multiplayer optimization (UI improvements)#9671

Open
MostCromulent wants to merge 3 commits intoCard-Forge:masterfrom
MostCromulent:NetworkPlay/ui
Open

Network multiplayer optimization (UI improvements)#9671
MostCromulent wants to merge 3 commits intoCard-Forge:masterfrom
MostCromulent:NetworkPlay/ui

Conversation

@MostCromulent
Copy link
Contributor

THIS PR HAS BEEN SPLIT FROM #9642.

Network UI Improvements: Better feedback during network operations including the prompt window identifying which player currently has priority and how long the game has been waiting for them to take an action; e.g. "Waiting for MostCromulent... (32 seconds)".

Dependency
This branch is has been refactored to be fully independent from other features in #9642.

Features
Waiting timer and connection error improvements for network games:

  • Show player name in waiting messages ("Waiting for Bob..." instead of generic "Waiting for opponent...")
  • Add elapsed time counter to waiting prompts (e.g., "Waiting for Bob... (1:23)")
  • Replace generic "Unable to connect" with more detailed connection error messages (connection refused, unknown host,
    timeout, no route to host)
    • "Unknown host. Please check the hostname or IP address is correct."
    • "Connection timed out. The server may be unreachable or behind a firewall."
    • "No route to host. Please check your network connection."

Files Changed

File Module Description
CMatchUI.java forge-gui-desktop Waiting timer, player name prompt messages, view-safe priority detection
InputLockUI.java forge-gui Network-aware waiting messages with player name and elapsed time
NetConnectUtil.java forge-gui Detailed connection error messages for common failure types
CSubmenuOnlineLobby.java forge-gui-desktop Handle CONN_ERROR_PREFIX for detailed error display
OnlineLobbyScreen.java forge-gui-mobile Handle CONN_ERROR_PREFIX for detailed error display
ForgeConstants.java forge-core CONN_ERROR_PREFIX constant
en-US.properties forge-gui 9 new localization strings for waiting and error messages

Screenshot 2026-02-05 064449 Screenshot 2026-02-05 064401

MostCromulent and others added 2 commits February 5, 2026 06:20
Improves user experience during network games:
- Waiting timer shows player name and elapsed time (CMatchUI, InputLockUI)
- Connection errors display detailed messages instead of generic failure
- Adds CONN_ERROR_PREFIX constant for structured error handling
- New localization strings for waiting and error messages

UI-only changes, no game logic or delta sync functionality.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Use GameView data only in findWaitingForPlayerName() to work on
  both host and client (fixes null Game on network clients)
- Add findPriorityPlayer() using PlayerView.getHasPriority()
- Use localized string prefixes in isWaitingMessage() instead of
  hardcoded English strings
- Add volatile to timer fields for thread safety

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
if (ixCall != iCall.get() || !isActive()) {
return;
}
FThreads.invokeInEdtLater(showMessageFromEdt);
Copy link
Contributor

Choose a reason for hiding this comment

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

when is this relevant in netplay? somehow I never reached a breakpoint here... 🤔

I don't understand why there should be two timer systems:
If one input isn't enough, then why isn't it only handled in AbstractGuiGame instead so it works for mobile too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants