CHLTVServer::StartPlayback
0x001743b0 · 335 bytes · __cdecl
_ZN11CHLTVServer13StartPlaybackEPKcb
Decompiled
undefined (2 params)
/* CHLTVServer::StartPlayback(char const*, bool) */
undefined4 CHLTVServer::StartPlayback(char *param_1,bool param_2)
{
CDemoFile *this;
undefined4 uVar1;
int iVar2;
int *piVar3;
longdouble lVar4;
longdouble lVar5;
undefined3 in_stack_00000009;
this = (CDemoFile *)(param_1 + 0x8400);
(**(code **)(*(int *)param_1 + 0x18))(param_1);
uVar1 = CDemoFile::Open(this,_param_2,true);
if ((char)uVar1 != '\0') {
iVar2 = CDemoFile::ReadDemoHeader(this);
if (iVar2 == 0) {
uVar1 = 0;
ConMsg("Failed to read demo header.\n");
CDemoFile::Close(this);
}
else {
piVar3 = (int *)NET_CreateNetChannel
(0,(netadr_s *)0x0,"DEMO",(INetChannelHandler *)(param_1 + 0x214),
false);
*(int **)(param_1 + 0x224) = piVar3;
if (piVar3 != (int *)0x0) {
(**(code **)(*piVar3 + 0x84))(piVar3,0xbf800000,0);
param_1[0x8ab0] = '\x01';
ConMsg("Reading complete demo file at once...\n");
lVar4 = (longdouble)Plat_FloatTime();
ReadCompeleteDemoFile((CHLTVServer *)param_1);
lVar5 = (longdouble)Plat_FloatTime();
ConMsg("Reading time :%.4f\n",(double)lVar5 - (double)lVar4);
NET_RemoveNetChannel
(*(INetChannel **)(param_1 + 0x224),SUB41(*(INetChannel **)(param_1 + 0x224),0));
param_1[0x224] = '\0';
param_1[0x225] = '\0';
param_1[0x226] = '\0';
param_1[0x227] = '\0';
return uVar1;
}
uVar1 = 0;
ConMsg("CDemo::Play: failed to create demo net channel\n");
CDemoFile::Close(this);
}
}
return uVar1;
}
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.