Host_Changelevel_f
0x0017dc90 · 246 bytes · __cdecl
_Z18Host_Changelevel_fRK8CCommand
Decompiled
undefined (1 param)
/* Host_Changelevel_f(CCommand const&) */
void Host_Changelevel_f(CCommand *param_1)
{
char cVar1;
int iVar2;
char *pcVar3;
char *pcVar4;
undefined1 *puVar5;
if (*(int *)param_1 < 2) {
ConMsg("changelevel <levelname> : continue game on a new level\n");
return;
}
if (DAT_003b7f64 < 2) {
ConMsg("Can\'t changelevel, not running server\n");
return;
}
iVar2 = (**(code **)(*(int *)g_pVEngineServer + 4))
(g_pVEngineServer,*(undefined4 *)(param_1 + 0x40c));
if (iVar2 == 0) {
LAB_0017dccb:
if (*(int *)param_1 < 2) {
puVar5 = &DAT_002c79d4;
}
else {
puVar5 = *(undefined1 **)(param_1 + 0x40c);
}
Warning("changelevel failed: %s not found\n",puVar5);
return;
}
pcVar3 = "";
if (1 < *(int *)param_1) {
pcVar3 = *(char **)(param_1 + 0x40c);
}
cVar1 = CL_HL2Demo_MapCheck(pcVar3);
if (cVar1 == '\0') goto LAB_0017dccb;
pcVar3 = "";
if (1 < *(int *)param_1) {
pcVar3 = *(char **)(param_1 + 0x40c);
}
cVar1 = CL_PortalDemo_MapCheck(pcVar3);
if (cVar1 == '\0') goto LAB_0017dccb;
SetLaunchOptions(param_1);
if (*(int *)param_1 < 3) {
pcVar3 = "";
if (*(int *)param_1 != 2) {
pcVar4 = "";
goto LAB_0017dd3e;
}
}
else {
pcVar3 = *(char **)(param_1 + 0x410);
}
pcVar4 = *(char **)(param_1 + 0x40c);
LAB_0017dd3e:
HostState_ChangeLevelMP(pcVar4,pcVar3);
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.