Chat private messages (protocol v2) - #15291
Conversation
Route optional toPlayerId on the server to sender+recipient sessions only, bump chatVersion to 2, and add a recipient selector in ChatPopup when the server supports it. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Merge order: if landing more than one of these chat PRs, please merge in this sequence to avoid conflicts / lost behavior:
Reason: all three touch |
|
Happy to rebase / fix merge conflicts (and any review feedback) — just say the word. |
|
is |
|
So, mainly too many unnecessary properties. |
|
Ok @Fanfblrik , I have added your protocol v2 support in UncivServer.xyz. The gist of it is below:
Kindly test with the server and see if it works. |
|
Also, I think you need to add a 4th pull request or modify this to add UI support for sending private messages. |
Address review: drop toCivName/toPlayerId echo; render (private); left-align To: selector. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Addressed review feedback in 3cd1e0a82:
|
Does UncivServer.xyz work? |

Summary
userIdon chat messages (null = public broadcast). Public chat unchanged when omitted.private: true(no recipient id/name on the wire).chatVersionis 2 when chat is enabled.ChatPopupshows a To: selector (Everyone + other human major civs) whenchatVersion >= 2. Private lines render asSender (private): text. Spectators / Unknown keep Everyone-only.ignoreUnknownKeysenabled on client/server chat JSON for forward compatibility.Test plan
.\gradlew :core:compileKotlin :server:compileKotlinSender (private)display is clear enough without recipient name in the log