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

Method CheckClientCommandAccess

core/logic/AdminCache.cpp:2005–2027  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2003}
2004
2005bool AdminCache::CheckClientCommandAccess(int client, const char *cmd, FlagBits cmdflags)
2006{
2007 if (cmdflags == 0 || client == 0)
2008 {
2009 return true;
2010 }
2011
2012 /* If running listen server, then client 1 is the server host and should have 'root' access */
2013 if (client == 1 && !engine->IsDedicatedServer())
2014 {
2015 return true;
2016 }
2017
2018 IGamePlayer *player = playerhelpers->GetGamePlayer(client);
2019 if (!player
2020 || player->GetEdict() == NULL
2021 || player->IsFakeClient())
2022 {
2023 return false;
2024 }
2025
2026 return CheckAdminCommandAccess(player->GetAdminId(), cmd, cmdflags);
2027}
2028
2029bool AdminCache::CheckAdminCommandAccess(AdminId adm, const char *cmd, FlagBits cmdflags)
2030{

Callers 2

CheckAccessMethod · 0.80
CheckCommandAccessFunction · 0.80

Calls 5

IsDedicatedServerMethod · 0.80
GetGamePlayerMethod · 0.80
GetEdictMethod · 0.80
IsFakeClientMethod · 0.80
GetAdminIdMethod · 0.80

Tested by

no test coverage detected