CBaseServer::RecalculateTags
0x0010a1a0 · 547 bytes · __thiscall
_ZN11CBaseServer15RecalculateTagsEv
Decompiled
undefined (1 param)
/* WARNING: Type propagation algorithm not settling */
/* CBaseServer::RecalculateTags() */
void __thiscall CBaseServer::RecalculateTags(CBaseServer *this)
{
code *pcVar1;
char cVar2;
KeyValues *pKVar3;
undefined4 uVar4;
ConVar *this_00;
char *pcVar5;
int iVar6;
char *pcVar7;
uint in_stack_ffffffa8;
undefined4 local_34;
int local_30 [3];
int local_24;
int local_20 [4];
cVar2 = (**(code **)(*(int *)this + 0x70))(this);
if ((cVar2 == '\0') && (RecalculateTags()::bRecalculatingTags == '\0')) {
RecalculateTags()::bRecalculatingTags = 1;
if (serverGameTags != (undefined4 *)0x0) {
pKVar3 = KeyValues::operator_new((KeyValues *)0x2c,in_stack_ffffffa8);
/* try { // try from 0010a205 to 0010a209 has its CatchHandler @ 0010a3da */
KeyValues::KeyValues(pKVar3,"GameTags",(IKeyValuesSystem *)0x0,false);
(**(code **)*serverGameTags)(serverGameTags,pKVar3);
for (pKVar3 = (KeyValues *)KeyValues::GetFirstSubKey(pKVar3); pKVar3 != (KeyValues *)0x0;
pKVar3 = (KeyValues *)KeyValues::GetNextKey(pKVar3)) {
pcVar1 = *(code **)(*g_pCVar + 0x30);
uVar4 = KeyValues::GetString(pKVar3,"convar","");
this_00 = (ConVar *)(*pcVar1)(g_pCVar,uVar4);
if (this_00 != (ConVar *)0x0) {
pcVar5 = (char *)ConVar::GetDefault(this_00);
pcVar7 = "FCVAR_NEVER_AS_STRING";
if (((byte)this_00[0x15] & 0x10) == 0) {
pcVar7 = "";
if (*(char **)(*(int *)(this_00 + 0x1c) + 0x24) != (char *)0x0) {
pcVar7 = *(char **)(*(int *)(this_00 + 0x1c) + 0x24);
}
}
iVar6 = _V_strcmp(pcVar5,pcVar7);
if (iVar6 == 0) {
pcVar7 = (char *)KeyValues::GetString(pKVar3,"tag","");
RemoveTag(this,pcVar7,false);
}
else {
pcVar7 = (char *)KeyValues::GetString(pKVar3,"tag","");
AddTag(this,pcVar7,(char *)0x0);
}
}
}
KeyValues::deleteThis();
}
local_34 = 1;
local_30[0] = 0x20;
local_30[1] = 1;
(**(code **)*serverGameClients)(serverGameClients,&local_34,local_30,local_30 + 1);
GetMasterServerPlayerCounts(this,local_30 + 2,&local_24,local_20);
if (local_30[0] < local_24) {
AddTag(this,"increased_maxplayers",(char *)0x0);
}
else {
RemoveTag(this,"increased_maxplayers",false);
}
if (g_bLowViolence == '\0') {
RemoveTag(this,"low_violence",false);
}
else {
AddTag(this,"low_violence",(char *)0x0);
}
RecalculateTags()::bRecalculatingTags = '\0';
}
return;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)
Just a Signatures{} block, ready to drop into a gamedata
file. Wire it up in your plugin however you like - SDKCall, DHooks,
raw memory ops, or anything else.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.