From 3473a51e038e3289016ddf3e5f6472baf2425e8a Mon Sep 17 00:00:00 2001 From: Kyle Sanderson Date: Fri, 4 Mar 2016 12:57:55 -0800 Subject: [PATCH] Add support for Steam| SIDs. --- Extension/extension.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Extension/extension.cpp b/Extension/extension.cpp index 9d09578..b0c2d75 100644 --- a/Extension/extension.cpp +++ b/Extension/extension.cpp @@ -80,12 +80,20 @@ CSteamID SteamWorks::CreateCommonCSteamID(IGamePlayer *pPlayer, const cell_t *pa EAccountType type = k_EAccountTypeIndividual; const char *pAuth = pPlayer->GetAuthString(false); /* We're not using this for Auth. */ - if (pAuth == NULL || pAuth[0] == '\0' || pAuth[0] == '[' || strlen(pAuth) < 11 || pAuth[6] == 'I') + if (pAuth == NULL || pAuth[0] == '\0' || strlen(pAuth) < 7 || pAuth[6] == 'I') { return this->CreateCommonCSteamID(pPlayer->GetSteamAccountID(false), params, universeplace, typeplace); } - universe = static_cast(atoi(&pAuth[6])); + if (pAuth[0] == '[') + { + universe = static_cast(atoi(&pAuth[3])); + } + else + { + universe = static_cast(atoi(&pAuth[6])); + } + if (universe == k_EUniverseInvalid) { universe = k_EUniversePublic; /* Legacy Engine shim. */