From de12f64c146e49bc49f2e3b3cbbe31b1ca81f3fe Mon Sep 17 00:00:00 2001 From: Nicholas Hastings Date: Sat, 13 Dec 2014 19:39:44 -0500 Subject: [PATCH] Convert CPlayer::m_AuthID to ke::AString. --- core/PlayerManager.cpp | 14 +++++++------- core/PlayerManager.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/core/PlayerManager.cpp b/core/PlayerManager.cpp index 9d9e0a4b..6707da59 100644 --- a/core/PlayerManager.cpp +++ b/core/PlayerManager.cpp @@ -405,7 +405,7 @@ void PlayerManager::RunAuthChecks() pPlayer = &m_Players[m_AuthQueue[i]]; pPlayer->UpdateAuthIds(); - authstr = pPlayer->m_AuthID.c_str(); + authstr = pPlayer->m_AuthID.chars(); if (!pPlayer->IsAuthStringValidated()) { @@ -717,14 +717,14 @@ void PlayerManager::OnClientPutInServer(edict_t *pEntity, const char *playername for (iter=m_hooks.begin(); iter!=m_hooks.end(); iter++) { pListener = (*iter); - pListener->OnClientAuthorized(client, steamId ? steamId : pPlayer->m_AuthID.c_str()); + pListener->OnClientAuthorized(client, steamId ? steamId : pPlayer->m_AuthID.chars()); } /* Finally, tell plugins */ if (m_clauth->GetFunctionCount()) { m_clauth->PushCell(client); /* For legacy reasons, people are expecting the Steam2 id here if using Steam auth */ - m_clauth->PushString(steamId ? steamId : pPlayer->m_AuthID.c_str()); + m_clauth->PushString(steamId ? steamId : pPlayer->m_AuthID.chars()); m_clauth->Execute(NULL); } pPlayer->Authorize_Post(); @@ -2001,7 +2001,7 @@ void CPlayer::UpdateAuthIds() #else authstr = engine->GetPlayerNetworkIDString(m_pEdict); #endif - m_AuthID.assign(authstr); + m_AuthID = authstr; // Then, cache SteamId if (IsFakeClient()) @@ -2097,7 +2097,7 @@ void CPlayer::Disconnect() m_IsAuthorized = false; m_Name.clear(); m_Ip.clear(); - m_AuthID.clear(); + m_AuthID = ""; m_SteamId = k_steamIDNil; m_Steam2Id = ""; m_Steam3Id = ""; @@ -2142,7 +2142,7 @@ const char *CPlayer::GetAuthString(bool validated) return NULL; } - return m_AuthID.c_str(); + return m_AuthID.chars(); } const CSteamID &CPlayer::GetSteamId(bool validated) @@ -2451,7 +2451,7 @@ void CPlayer::DoBasicAdminChecks() } /* Check steam id */ - if ((id = adminsys->FindAdminByIdentity("steam", m_AuthID.c_str())) != INVALID_ADMIN_ID) + if ((id = adminsys->FindAdminByIdentity("steam", m_AuthID.chars())) != INVALID_ADMIN_ID) { if (g_Players.CheckSetAdmin(client, this, id)) { diff --git a/core/PlayerManager.h b/core/PlayerManager.h index 22ca01fc..3f78c9f8 100644 --- a/core/PlayerManager.h +++ b/core/PlayerManager.h @@ -123,7 +123,7 @@ private: String m_Name; String m_Ip; String m_IpNoPort; - String m_AuthID; + ke::AString m_AuthID; ke::AString m_Steam2Id; ke::AString m_Steam3Id; AdminId m_Admin;