diff --git a/core/AdminCache.cpp b/core/AdminCache.cpp index a03c1899..2dfd5fc3 100644 --- a/core/AdminCache.cpp +++ b/core/AdminCache.cpp @@ -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)) { diff --git a/core/PlayerManager.cpp b/core/PlayerManager.cpp index 55c25217..657741d7 100644 --- a/core/PlayerManager.cpp +++ b/core/PlayerManager.cpp @@ -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)) diff --git a/plugins/admin-flatfile/admin-simple.sp b/plugins/admin-flatfile/admin-simple.sp index c615ac8e..fbf89803 100644 --- a/plugins/admin-flatfile/admin-simple.sp +++ b/plugins/admin-flatfile/admin-simple.sp @@ -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;