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

Method CheckSetAdminName

core/PlayerManager.cpp:381–404  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

379}
380
381bool PlayerManager::CheckSetAdminName(int index, CPlayer *pPlayer, AdminId id)
382{
383 const char *password = adminsys->GetAdminPassword(id);
384 if (password == NULL)
385 {
386 return false;
387 }
388
389 if (m_PassInfoVar.size() < 1)
390 {
391 return false;
392 }
393
394 /* Whoa... the user needs a password! */
395 const char *given = engine->GetClientConVarValue(index, m_PassInfoVar.c_str());
396 if (!given || strcmp(given, password) != 0)
397 {
398 return false;
399 }
400
401 pPlayer->SetAdminId(id, false);
402
403 return true;
404}
405
406void PlayerManager::RunAuthChecks()
407{

Callers 1

DoBasicAdminChecksMethod · 0.80

Calls 5

GetAdminPasswordMethod · 0.80
GetClientConVarValueMethod · 0.80
SetAdminIdMethod · 0.80
sizeMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected