Translate ##P<n> chat tokens to player names from configstrings#145
Open
ozy24 wants to merge 3 commits intoParil:rerelease-gamefrom
Open
Translate ##P<n> chat tokens to player names from configstrings#145ozy24 wants to merge 3 commits intoParil:rerelease-gamefrom
ozy24 wants to merge 3 commits intoParil:rerelease-gamefrom
Conversation
res2k
requested changes
Mar 6, 2026
| Q_strlcpy(s, out, size); | ||
| } | ||
|
|
||
| static void CL_HandlePrint(int level, char *s) |
Collaborator
There was a problem hiding this comment.
Can placeholders occur in any "print" from the server, or just localized prints?
If it's the latter, the translation should only be called from CL_ParseLocPrint().
Author
There was a problem hiding this comment.
Looking at the server code, ##P tokens occur in broadcast prints, which are sent as regular svc_print messages (not localized prints). So keeping the translation in CL_HandlePrint is necessary to catch them — moving it to CL_ParseLocPrint only would miss them.
Collaborator
There was a problem hiding this comment.
I'm thinking the server should probably not generate "standard" prints in PF_Loc_Print, but that's a different discussion.
res2k
reviewed
Mar 14, 2026
Collaborator
|
LGTM so far. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Rerelease/KEX servers encode player names in chat and broadcast messages as
##P<n>tokens, expecting the client to resolve them. Without client-side handling, these tokens are shown as raw strings (e.g.,##P0instead of the real player name). This is most noticeable when connected to a dedicated server.Solution
Added client-side
CL_TranslatePlayerNameTokensand called it fromCL_HandlePrintto:cl.csr.playerskins.netnamefrom the playerskins configstring format (name\skin\dogtag).cls.state < ca_loadingto ensurecl.csris valid (set bysvc_serverdata).Verification
cl.csr.playerskinsmatchesCS_PLAYERSKINSinshared.c.cl.csris set correctly forPROTOCOL_VERSION_RERELEASEandPROTOCOL_VERSION_KEXinparse.c.