Skip to content

Allow STEAM_0 in ProcessArgString#2512

Open
Kenzzer wants to merge 4 commits into
masterfrom
k/issue#1240
Open

Allow STEAM_0 in ProcessArgString#2512
Kenzzer wants to merge 4 commits into
masterfrom
k/issue#1240

Conversation

@Kenzzer

@Kenzzer Kenzzer commented Jul 15, 2026

Copy link
Copy Markdown
Member

Fix #1240

@Kenzzer
Kenzzer requested a review from psychonic July 15, 2026 10:27
Comment thread core/PlayerManager.cpp Outdated
/* Do we need to look for a steam id? */
int steamIdType = 0;
if (strncmp(&info->pattern[1], "STEAM_", 6) == 0)
if (strncmp(&info->pattern[1], "STEAM_1", 6) == 0 || strncmp(&info->pattern[1], "STEAM_0", 6) == 0)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The length should be 7.

Comment thread core/PlayerManager.cpp Outdated
strcpy(new_pattern, "STEAM_");
len = strlen(&info->pattern[7]);
/* Bound the copy so the "STEAM_" prefix, the copied bytes and the
strcpy(new_pattern, "STEAM_1");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a comment about why the universe in the steamid is hardcoded to 1 here would be good as it's not obvious while reading the code.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think hardcoding STEAM_1 is right here. pTarget->GetSteamId() below is going to return with STEAM_0 on games that have the UseInvalidUniverseInSteam2IDs gamedata key enabled.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay time to rethink this then

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright so here's the new method. No more hardcoding to STEAM_1, instead the universe id gets changed based on whatever the game returns so that strcmp can succeed.

And to remain future-proof, this only happens if a STEAM_0 or STEAM_1 was provided. Say we ever support a STEAM_9 or whatever, there won't be any changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ignore "Universe" value in steamids for ProcessTargetString

3 participants