ping
0x0017ca00 · 280 bytes · __cdecl
_ZL4pingRK8CCommand
Decompiled
undefined (1 param)
/* ping(CCommand const&) */
void ping(CCommand *param_1)
{
int iVar1;
code *pcVar2;
char cVar3;
undefined4 uVar4;
int *piVar5;
int iVar6;
longdouble lVar7;
if (cmd_source == 1) {
Cmd_ForwardToServer(param_1,true);
return;
}
iVar6 = 0;
(**(code **)(*host_client + 0x68))(host_client,"Client ping times:\n");
if (0 < DAT_003b8080) {
do {
while( true ) {
iVar1 = *(int *)(DAT_003b8074 + iVar6 * 4);
piVar5 = (int *)(iVar1 + 4);
if (iVar1 == 0) {
piVar5 = (int *)0x0;
}
cVar3 = (**(code **)(*piVar5 + 0x80))(piVar5);
if ((cVar3 != '\0') && (cVar3 = (**(code **)(*piVar5 + 0x8c))(piVar5), cVar3 == '\0'))
break;
iVar6 = iVar6 + 1;
if (DAT_003b8080 <= iVar6) {
return;
}
}
iVar6 = iVar6 + 1;
pcVar2 = *(code **)(*host_client + 0x68);
uVar4 = (**(code **)(*piVar5 + 0x48))(piVar5);
piVar5 = (int *)(**(code **)(*piVar5 + 0x4c))(piVar5);
lVar7 = (longdouble)(**(code **)(*piVar5 + 0x28))(piVar5,0);
(*pcVar2)(host_client,"%4.0f ms : %s\n",(double)((float)lVar7 * 1000.0),uVar4);
} while (iVar6 < DAT_003b8080);
}
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.