Repository navigation
Conversation
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.
Windows console input is currently converted to UTF-8 before dispatch. On a GBK server,
say 中文therefore sends UTF-8 bytes to clients expectingD6 D0 CE C4. Remote RCON has the same mismatch when an external tool sends UTF-8 commands. Separately, the existingcplayer query has no IDs, and open.mp does not answerd, so external tools cannot obtain actual player pool IDs through public queries.This adds explicit, lossless Windows conversion settings while preserving existing defaults, plus detailed player queries that never truncate or invent IDs. The implementation is based on current master (
68435c7a), with no submodule changes.Behavior
console.input_codepagedefaults to 65001, preserving UTF-8. Setting 936 converts Unicode console input to GBK; 950 and the Windows ANSI code page are also supported. Unrepresentable characters are rejected before command dispatch. Local command replies are converted to UTF-8 for logging.rcon.utf8_command_codepagedefaults to 0 (original bytes). Setting 936 explicitly accepts UTF-8 remote commands and converts them to GBK after authenticating the original password bytes. Invalid UTF-8 or lossy conversion returns an error without dispatch. In-game RCON, the script command API, and remote reply bytes are unchanged. This is Windows-only and intentionally does not guess the encoding of untagged legacy packets.cresponses stay unchanged. Legacydreturns actual IDs only when there are at most 100 players and all IDs fit in one byte.Dversion 1 uses 16-bit IDs and consistent paginated snapshots (32 players/page, maximum 1144-byte response, 16 retained snapshots). It handles IDs 0–999 with RCON disabled and respectsenable_query=false. Player data is copied on the main thread; the network thread reads bounded snapshots.The
Dwire format andsc_d16=1capability are compatible with the existing SampCtrl client. They are documented as an experimental extension for review, not an official protocol standard. I would appreciate maintainer feedback on accepting this extension/capability or separating the encoding and query changes.Validation
The upstream workflows currently require maintainer approval to run for this contribution. No production deployment or real game-client rendering validation was performed. Encoding integration was tested on Windows; the query unit-test workflow also covers Linux. See
CONSOLE_QUERY.mdfor configuration and the exact wire format, andTests/ConsoleQuery/README.mdfor reproduction commands.@AmyrAhmady, could you review the proposed encoding boundary and player-query extension? Thank you.