CBaseServer::AddTag
0x00109550 · 522 bytes · __thiscall
_ZN11CBaseServer6AddTagEPKcS1_
Decompiled
undefined (3 params)
/* CBaseServer::AddTag(char const*, char const*) */
void __thiscall CBaseServer::AddTag(CBaseServer *this,char *param_1,char *param_2)
{
char *pcVar1;
size_t sVar2;
int iVar3;
char *pcVar4;
int iVar5;
int in_GS_OFFSET;
CSplitString *this_00;
int local_b8 [3];
int local_ac;
char local_a0 [128];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
pcVar1 = "FCVAR_NEVER_AS_STRING";
if ((sv_tags[0x15] & 0x10) == 0) {
pcVar1 = "";
if (*(char **)(sv_tags._28_4_ + 0x24) != (char *)0x0) {
pcVar1 = *(char **)(sv_tags._28_4_ + 0x24);
}
}
CSplitString::CSplitString((CSplitString *)local_b8,pcVar1,",");
if (0 < local_ac) {
iVar5 = 0;
do {
while (param_2 == (char *)0x0) {
pcVar1 = param_1;
iVar3 = _V_stricmp(*(char **)(local_b8[0] + iVar5 * 4),param_1);
if (iVar3 == 0) goto LAB_00109700;
LAB_001095c8:
iVar5 = iVar5 + 1;
if (local_ac <= iVar5) goto LAB_00109665;
}
sVar2 = strlen(param_1);
/* try { // try from 00109608 to 0010973c has its CatchHandler @ 0010976c */
iVar3 = V_strnicmp(*(char **)(local_b8[0] + iVar5 * 4),param_1,sVar2);
if (iVar3 != 0) goto LAB_001095c8;
sVar2 = strlen(param_1);
pcVar1 = param_2;
iVar3 = _V_stricmp((char *)(sVar2 + *(int *)(local_b8[0] + iVar5 * 4)),param_2);
if (iVar3 == 0) goto LAB_00109700;
RemoveTag(this,param_1,true);
iVar5 = iVar5 + 1;
} while (iVar5 < local_ac);
}
LAB_00109665:
pcVar1 = local_a0;
local_a0[0] = '\0';
V_strncpy(pcVar1,param_1,0x80);
if (param_2 != (char *)0x0) {
V_strncat(pcVar1,param_2,0x80,-1);
}
V_strncat(pcVar1,",",0x80,-1);
pcVar4 = "FCVAR_NEVER_AS_STRING";
if ((sv_tags[0x15] & 0x10) == 0) {
pcVar4 = "";
if (*(char **)(sv_tags._28_4_ + 0x24) != (char *)0x0) {
pcVar4 = *(char **)(sv_tags._28_4_ + 0x24);
}
}
V_strncat(pcVar1,pcVar4,0x80,-1);
ConVar::SetValue(sv_tags);
LAB_00109700:
this_00 = (CSplitString *)local_b8;
CSplitString::~CSplitString(this_00);
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail(this_00,pcVar1);
}
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.