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

Method OnClientCommandKeyValues_Post

core/PlayerManager.cpp:1242–1275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1240}
1241
1242void PlayerManager::OnClientCommandKeyValues_Post(edict_t *pEntity, KeyValues *pCommand)
1243{
1244 if (!s_LastCCKVAllowed)
1245 {
1246 return;
1247 }
1248
1249 int client = IndexOfEdict(pEntity);
1250
1251 CPlayer *pPlayer = &m_Players[client];
1252
1253 if (!pPlayer->IsInGame())
1254 {
1255 return;
1256 }
1257
1258 KeyValueStack *pStk = new KeyValueStack;
1259 pStk->pBase = pCommand;
1260 pStk->pCurRoot.push(pStk->pBase);
1261 pStk->m_bDeleteOnDestroy = false;
1262
1263 Handle_t hndl = handlesys->CreateHandle(g_KeyValueType, pStk, g_pCoreIdent, g_pCoreIdent, NULL);
1264
1265 m_bInCCKVHook = true;
1266 m_clcommandkv_post->PushCell(client);
1267 m_clcommandkv_post->PushCell(hndl);
1268 m_clcommandkv_post->Execute();
1269 m_bInCCKVHook = false;
1270
1271 HandleSecurity sec(g_pCoreIdent, g_pCoreIdent);
1272
1273 // Deletes pStk
1274 handlesys->FreeHandle(hndl, &sec);
1275}
1276#endif
1277
1278void PlayerManager::OnClientSettingsChanged(edict_t *pEntity)

Callers

nothing calls this directly

Calls 7

IndexOfEdictFunction · 0.85
IsInGameMethod · 0.80
PushCellMethod · 0.80
FreeHandleMethod · 0.80
pushMethod · 0.45
CreateHandleMethod · 0.45
ExecuteMethod · 0.45

Tested by

no test coverage detected