CServerRemoteAccess::SetValue
0x0020d6b0 · 460 bytes · __thiscall
_ZN19CServerRemoteAccess8SetValueEPKcS1_
Decompiled
undefined (3 params)
/* CServerRemoteAccess::SetValue(char const*, char const*) */
void __thiscall CServerRemoteAccess::SetValue(CServerRemoteAccess *this,char *param_1,char *param_2)
{
code *pcVar1;
char cVar2;
int iVar3;
char *pcVar4;
int iVar5;
undefined4 uVar6;
undefined4 *local_14;
int local_10;
iVar3 = _V_stricmp(param_1,"map");
if (iVar3 == 0) {
pcVar4 = (char *)va("changelevel %s\n",param_2);
}
else {
iVar3 = _V_stricmp(param_1,"mapcycle");
if (iVar3 == 0) {
ConVarRef::ConVarRef((ConVarRef *)&local_14,"mapcyclefile");
cVar2 = ConVarRef::IsValid((ConVarRef *)&local_14);
if (cVar2 == '\0') {
return;
}
iVar3 = (**(code **)(*(int *)(g_pFileSystem + 4) + 8))
(g_pFileSystem + 4,*(undefined4 *)(local_10 + 0x24),&DAT_002a5dab,0);
if (iVar3 == 0) {
Msg("Couldn\'t write to read-only file %s, using file _temp_mapcycle.txt instead.\n",
*(undefined4 *)(local_10 + 0x24));
(**(code **)*local_14)(local_14,"_temp_mapcycle.txt");
iVar3 = (**(code **)(*(int *)(g_pFileSystem + 4) + 8))
(g_pFileSystem + 4,*(undefined4 *)(local_10 + 0x24),&DAT_002a5dab,0);
if (iVar3 == 0) {
return;
}
}
pcVar1 = *(code **)(*(int *)(g_pFileSystem + 4) + 4);
iVar5 = _V_strlen(param_2);
(*pcVar1)(g_pFileSystem + 4,param_2,iVar5 + 1,iVar3);
(**(code **)(*(int *)(g_pFileSystem + 4) + 0xc))(g_pFileSystem + 4,iVar3);
return;
}
uVar6 = va("%s %s",param_1,param_2);
Cbuf_AddText(4,uVar6,0);
pcVar4 = "\n";
}
Cbuf_AddText(4,pcVar4,0);
cVar2 = NET_IsDedicated();
if (cVar2 == '\0') {
return;
}
Cbuf_Execute();
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.