Add #4498: Expose CPU info with a detectable client opt-out - #5205
Open
x6c85 wants to merge 3 commits into
Open
Conversation
Removed comment about packet ID stability for clarity.
Contributor
|
I know this is technically not in the scope of this PR, but if this gets merged we should consider an opt-out for sending GPU information from dxGetStatus(). |
Member
|
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.
Summary
Adds client
getCPUInfo()and servergetPlayerCPUInfo(player)so scripts can read CPU name, max clock, cores, threads and L1/L2/L3 cache sizes.Sharing is on by default (
allow_cpu_info, Settings → Multiplayer → Allow CPU info). When the player opts out, hardware fields are omitted and the table only containsAllowCPUInfo = false, so a server resource cannot recover the data through a client event.The client sends
PACKET_ID_PLAYER_CPUINFOat join (appended after existing packet ids). The server stores it, firesonPlayerCPUInfo, andgetPlayerCPUInforeturnsfalseuntil that packet arrives (old clients stayfalse).Motivation
Fixes #4498. GPU details are already exposed via
dxGetStatuswith no opt-out. CPU info is useful for quality presets and for servers that want to reject clients who hide it, similar to screen upload.Test plan
getCPUInfo()- expectAllowCPUInfo = trueplus name, MHz, cores, threads and cache.AllowCPUInfo = false; servergetPlayerCPUInfois the same table, notfalse.getPlayerCPUInfostaysfalse(no packet).onPlayerCPUInforuns after join and can kick whenallowed == false.Checklist