SourceMod now handles steamid's internally without the STEAM_*: part (bug 3428)
This commit is contained in:
parent
25a0a192a2
commit
321443450a
@ -1182,6 +1182,12 @@ bool AdminCache::BindAdminIdentity(AdminId id, const char *auth, const char *ide
|
||||
return false;
|
||||
}
|
||||
|
||||
/* If the id was a steam id strip off the STEAM_*: part */
|
||||
if (strcmp(auth, "steam") == 0 && strncmp(ident, "STEAM_", 6) == 0)
|
||||
{
|
||||
ident += 8;
|
||||
}
|
||||
|
||||
if (sm_trie_retrieve(pTable, ident, NULL))
|
||||
{
|
||||
return false;
|
||||
@ -1204,6 +1210,12 @@ AdminId AdminCache::FindAdminByIdentity(const char *auth, const char *identity)
|
||||
return INVALID_ADMIN_ID;
|
||||
}
|
||||
|
||||
/* If the id was a steam id strip off the STEAM_*: part */
|
||||
if (strcmp(auth, "steam") == 0 && strncmp(identity, "STEAM_", 6) == 0)
|
||||
{
|
||||
identity += 8;
|
||||
}
|
||||
|
||||
void *object;
|
||||
if (!sm_trie_retrieve(pTable, identity, &object))
|
||||
{
|
||||
|
@ -1632,7 +1632,7 @@ void CPlayer::DoBasicAdminChecks()
|
||||
}
|
||||
}
|
||||
|
||||
/* Check IP address */
|
||||
/* Check steam id */
|
||||
if ((id = g_Admins.FindAdminByIdentity("steam", m_AuthID.c_str())) != INVALID_ADMIN_ID)
|
||||
{
|
||||
if (g_Players.CheckSetAdmin(client, this, id))
|
||||
|
@ -96,7 +96,7 @@ public ReadSimpleUsers()
|
||||
|
||||
DecodeAuthMethod(const String:auth[], String:method[32], &offset)
|
||||
{
|
||||
if (StrContains(auth, "STEAM_") == 0)
|
||||
if ((StrContains(auth, "STEAM_") == 0) || (strncmp("0:", auth, 2) == 0) || (strncmp("1:", auth, 2) == 0))
|
||||
{
|
||||
strcopy(method, sizeof(method), AUTHMETHOD_STEAM);
|
||||
offset = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user