Fix regression causing inconsistencies in clientprefs auth id handling (r=VoiDeD).

This commit is contained in:
Nicholas Hastings
2014-09-12 13:04:37 -07:00
parent e72ff963f5
commit 570570f7a0
3 changed files with 12 additions and 6 deletions
+9 -4
View File
@@ -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));
}
}