Skip to content

Highlight server warnings in multiplayer chat#10437

Open
MostCromulent wants to merge 2 commits intoCard-Forge:masterfrom
MostCromulent:NetworkPlay/chat-warnings
Open

Highlight server warnings in multiplayer chat#10437
MostCromulent wants to merge 2 commits intoCard-Forge:masterfrom
MostCromulent:NetworkPlay/chat-warnings

Conversation

@MostCromulent
Copy link
Copy Markdown
Contributor

@MostCromulent MostCromulent commented Apr 18, 2026

Screenshot 2026-04-18 112759

Summary

  • Adds a WARNING ChatMessage.MessageType rendered amber on desktop (foreground) and mobile (bubble background), distinct from blue system / default player styles. Amber chosen over red for legibility on both light and dark themes.
  • Tags session/connection-health broadcasts in FServerManager: UPnP failure, heartbeat timeout, disconnect notice, version mismatch, "did not reconnect in time".
  • MessageEvent.type is stored as String (not enum) for serialization safety — unknown enum constants cause InvalidObjectException on older clients even when skipping fields the old class doesn't declare. getType() converts back to enum with fallback to SYSTEM for unrecognized values.

🤖 Generated with Claude Code

Adds a WARNING ChatMessage.MessageType, rendered as amber foreground
text on desktop (FNetOverlay) and an amber bubble background on mobile
(ChatMessageBubble), distinct from the existing blue system and default
player styles.

Tagged call sites in FServerManager (all session/connection health):
- UPnP port mapping failure (success path stays blue)
- Heartbeat timeout forcing disconnect
- Initial disconnect + reconnect-waiting notice
- Forge version null/mismatch warnings
- "Did not reconnect in time, AI takeover"

MessageEvent gains a nullable type field with serialVersionUID unchanged,
so old and new clients continue to interoperate. Pre-WARNING-tag senders
deserialize as null; MessageEvent.getType() normalizes to SYSTEM/PLAYER
based on source, so receivers never see null.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
MessageEvent: store type as String not enum — unknown enum constants
cause InvalidObjectException on older clients even for skipped fields.

Remove ILobbyListener default overload, dead isSystemMessage(), inline
imports in test files, trailing periods on comments.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@MostCromulent MostCromulent force-pushed the NetworkPlay/chat-warnings branch from 10ac5f5 to 23eac9f Compare April 18, 2026 03:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants