MCPcopy Create free account
hub / github.com/alliedmodders/sourcemod / FindAdminByIdentity

Method FindAdminByIdentity

core/logic/AdminCache.cpp:1175–1195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1173}
1174
1175AdminId AdminCache::FindAdminByIdentity(const char *auth, const char *identity)
1176{
1177 AuthMethod *method;
1178 if (!m_AuthTables.retrieve(auth, &method))
1179 return INVALID_ADMIN_ID;
1180
1181 /* If the auth type is steam, the id could be in a number of formats. Unify it. */
1182 char steamIdent[16];
1183 if (strcmp(auth, "steam") == 0)
1184 {
1185 if (!GetUnifiedSteamIdentity(identity, steamIdent, sizeof(steamIdent)))
1186 return INVALID_ADMIN_ID;
1187
1188 identity = steamIdent;
1189 }
1190
1191 AdminId id;
1192 if (!method->identities.retrieve(identity, &id))
1193 return INVALID_ADMIN_ID;
1194 return id;
1195}
1196
1197void AdminCache::SetAdminFlag(AdminId id, AdminFlag flag, bool enabled)
1198{

Callers 3

DoBasicAdminChecksMethod · 0.80
FindAdminByIdentityFunction · 0.80

Calls 1

retrieveMethod · 0.45

Tested by

no test coverage detected