CServerRemoteAccess::LookupStringValue
0x0020ed60 · 291 bytes · __thiscall
_ZN19CServerRemoteAccess17LookupStringValueEPKc
Decompiled
undefined (2 params)
/* CServerRemoteAccess::LookupStringValue(char const*) */
undefined1 * __thiscall
CServerRemoteAccess::LookupStringValue(CServerRemoteAccess *this,char *param_1)
{
char cVar1;
int iVar2;
undefined1 *puVar3;
int iVar4;
ConVarRef local_14 [4];
int local_10;
iVar2 = (**(code **)(*g_pCVar + 0x30))(g_pCVar,param_1);
if (iVar2 != 0) {
ConVarRef::ConVarRef(local_14,(IConVar *)(iVar2 + 0x18));
cVar1 = ConVarRef::IsValid(local_14);
if (cVar1 != '\0') {
return *(undefined1 **)(local_10 + 0x24);
}
}
iVar2 = _V_stricmp(param_1,"map");
if (iVar2 == 0) {
return &DAT_003b7f70;
}
iVar2 = _V_stricmp(param_1,"playercount");
if (iVar2 == 0) {
iVar4 = CBaseServer::GetNumClients((CBaseServer *)&sv);
iVar2 = CBaseServer::GetNumProxies((CBaseServer *)&sv);
iVar4 = iVar4 - iVar2;
}
else {
iVar2 = _V_stricmp(param_1,"maxplayers");
if (iVar2 != 0) {
iVar2 = _V_stricmp(param_1,"gamedescription");
if (iVar2 != 0) {
return (undefined1 *)0x0;
}
if (serverGameDLL == (int *)0x0) {
return (undefined1 *)0x0;
}
puVar3 = (undefined1 *)(**(code **)(*serverGameDLL + 0x2c))(serverGameDLL);
return puVar3;
}
iVar4 = CBaseServer::GetMaxClients((CBaseServer *)&sv);
}
V_snprintf(LookupStringValue(char_const*)::s_ReturnBuf,0x1f,"%d",iVar4);
return LookupStringValue(char_const*)::s_ReturnBuf;
}
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.