CDirectorSessionManager::UpdatePlaytestSetup
0x008be150 · 585 bytes · __thiscall
_ZN23CDirectorSessionManager19UpdatePlaytestSetupEv
Decompiled
undefined (1 param)
/* CDirectorSessionManager::UpdatePlaytestSetup() */
CDirectorSessionManager __thiscall
CDirectorSessionManager::UpdatePlaytestSetup(CDirectorSessionManager *this)
{
CDirectorSessionManager CVar1;
char cVar2;
int iVar3;
int iVar4;
int iVar5;
float fVar6;
int local_54;
int local_50;
undefined4 local_40;
undefined4 local_3c;
undefined4 local_38;
undefined4 local_34;
int local_30 [8];
CVar1 = this[0x28];
if (this[0x28] == (CDirectorSessionManager)0x0) {
return CVar1;
}
fVar6 = *(float *)(this + 0x2c);
if (fVar6 != 0.0) {
if (fVar6 < *(float *)(gpGlobals + 0xc) || fVar6 == *(float *)(gpGlobals + 0xc)) {
this[0x28] = (CDirectorSessionManager)0x0;
*(undefined4 *)(this + 0x2c) = 0;
return CVar1;
}
return (CDirectorSessionManager)0x0;
}
local_30[0] = 0;
local_30[1] = 0;
local_30[2] = 0;
local_30[3] = 0;
local_54 = *(int *)(DirectorMinStartPlayers._28_4_ + 0x30);
local_30[4] = 0;
local_40 = 0xffffffff;
local_3c = 7;
local_38 = 3;
local_34 = 9;
/* try { // try from 008be1e4 to 008be393 has its CatchHandler @ 008be3a2 */
ForEachPlayer<PlayerCollector>((PlayerCollector *)&local_40);
if (local_30[3] < 1) {
local_50 = 0;
LAB_008be36f:
fVar6 = *(float *)(this + 0x30);
if (fVar6 != 0.0) goto LAB_008be26e;
LAB_008be27d:
if (local_50 < local_54) goto LAB_008be2d0;
DevMsg("[INTROS] %d fully connected players matches %d exptected players. Unfreezing team.\n",
local_50,local_54);
}
else {
iVar5 = 0;
local_50 = 0;
do {
while( true ) {
iVar3 = (**(code **)(*engine + 0x40))
(engine,*(undefined4 *)(*(int *)(local_30[0] + iVar5 * 4) + 0x30));
if (0 < *(int *)(this + 0x10)) break;
LAB_008be240:
iVar5 = iVar5 + 1;
if (local_30[3] <= iVar5) goto LAB_008be248;
}
if (iVar3 != **(int **)(this + 4)) {
iVar4 = 0;
do {
iVar4 = iVar4 + 1;
if (iVar4 == *(int *)(this + 0x10)) goto LAB_008be240;
} while (iVar3 != (*(int **)(this + 4))[iVar4]);
if (iVar4 == -1) goto LAB_008be240;
}
local_50 = local_50 + 1;
iVar5 = iVar5 + 1;
} while (iVar5 < local_30[3]);
LAB_008be248:
if (local_50 == 0) goto LAB_008be36f;
fVar6 = *(float *)(this + 0x30);
if (fVar6 == 0.0) {
*(float *)(this + 0x30) =
*(float *)(DirectorUnfreezeTime._28_4_ + 0x2c) + *(float *)(gpGlobals + 0xc);
cVar2 = IsPressDemoMode();
if ((cVar2 != '\0') && (cVar2 = (**(code **)(*engine + 0x1f8))(engine), cVar2 != '\0')) {
ConVar::SetValue(0xffcce0);
local_54 = 4;
}
goto LAB_008be36f;
}
LAB_008be26e:
if (*(float *)(gpGlobals + 0xc) <= fVar6) goto LAB_008be27d;
DevMsg("[INTROS] Time is up, unfreezing players\n");
}
ConVar::SetValue(0xffcce0);
fVar6 = *(float *)(gpGlobals + 0xc);
*(undefined4 *)(this + 0x30) = 0;
*(float *)(this + 0x2c) = fVar6 + 3.0;
LAB_008be2d0:
local_30[3] = 0;
CUtlMemory<CTerrorPlayer*,int>::Purge((CUtlMemory<CTerrorPlayer*,int> *)local_30);
local_30[4] = local_30[0];
CUtlMemory<CTerrorPlayer*,int>::Purge((CUtlMemory<CTerrorPlayer*,int> *)local_30);
return (CDirectorSessionManager)0x0;
}
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.