Fix regression causing inconsistencies in clientprefs auth id handling (r=VoiDeD).
This commit is contained in:
parent
e72ff963f5
commit
570570f7a0
@ -159,7 +159,7 @@ void CookieManager::OnClientAuthorized(int client, const char *authstring)
|
||||
g_ClientPrefs.AttemptReconnection();
|
||||
|
||||
TQueryOp *op = new TQueryOp(Query_SelectData, player->GetSerial());
|
||||
UTIL_strncpy(op->m_params.steamId, authstring, MAX_NAME_LENGTH);
|
||||
UTIL_strncpy(op->m_params.steamId, GetPlayerCompatAuthId(player), MAX_NAME_LENGTH);
|
||||
|
||||
g_ClientPrefs.AddQueryToQueue(op);
|
||||
}
|
||||
@ -181,7 +181,7 @@ void CookieManager::OnClientDisconnecting(int client)
|
||||
|
||||
if (player)
|
||||
{
|
||||
pAuth = player->GetAuthString();
|
||||
pAuth = GetPlayerCompatAuthId(player);
|
||||
g_ClientPrefs.ClearQueryCache(player->GetSerial());
|
||||
}
|
||||
|
||||
|
@ -349,6 +349,13 @@ void ClientPrefs::ProcessQueryCache()
|
||||
cachedQueries.clear();
|
||||
}
|
||||
|
||||
const char *GetPlayerCompatAuthId(IGamePlayer *pPlayer)
|
||||
{
|
||||
/* For legacy reasons, OnClientAuthorized gives the Steam2 id here if using Steam auth */
|
||||
const char *steamId = pPlayer->GetSteam2Id();
|
||||
return steamId ? steamId : pPlayer->GetAuthString();
|
||||
}
|
||||
|
||||
size_t IsAuthIdConnected(char *authID)
|
||||
{
|
||||
IGamePlayer *player;
|
||||
@ -362,7 +369,7 @@ size_t IsAuthIdConnected(char *authID)
|
||||
continue;
|
||||
}
|
||||
|
||||
authString = player->GetAuthString();
|
||||
authString = GetPlayerCompatAuthId(player);
|
||||
|
||||
if (authString == NULL || authString[0] == '\0')
|
||||
{
|
||||
@ -394,9 +401,7 @@ void ClientPrefs::CatchLateLoadClients()
|
||||
continue;
|
||||
}
|
||||
|
||||
/* For legacy reasons, OnClientAuthorized gives the Steam2 id here if using Steam auth */
|
||||
const char *steamId = pPlayer->GetSteam2Id();
|
||||
g_CookieManager.OnClientAuthorized(i, steamId ? steamId : pPlayer->GetAuthString());
|
||||
g_CookieManager.OnClientAuthorized(i, GetPlayerCompatAuthId(pPlayer));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -181,6 +181,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
const char *GetPlayerCompatAuthId(IGamePlayer *pPlayer);
|
||||
size_t IsAuthIdConnected(char *authID);
|
||||
|
||||
extern sp_nativeinfo_t g_ClientPrefNatives[];
|
||||
|
Loading…
Reference in New Issue
Block a user