DataTable_CreateClientClassInfosFromServerClasses
0x001445c0 · 430 bytes · __cdecl
_Z49DataTable_CreateClientClassInfosFromServerClassesP16CBaseClientState
Decompiled
undefined (1 param)
/* DataTable_CreateClientClassInfosFromServerClasses(CBaseClientState*) */
void DataTable_CreateClientClassInfosFromServerClasses(CBaseClientState *param_1)
{
int iVar1;
undefined4 *puVar2;
undefined4 *puVar3;
C_ServerClassInfo *pCVar4;
uint uVar5;
uint *puVar6;
undefined4 uVar7;
int iVar8;
C_ServerClassInfo *pCVar9;
int iVar10;
uint local_28;
uint local_20;
if (serverGameDLL == (int *)0x0) {
Sys_Error("DataTable_CreateClientClassInfosFromServerClasses: No serverGameDLL loaded!");
}
puVar2 = (undefined4 *)(**(code **)(*serverGameDLL + 0x28))(serverGameDLL);
if (puVar2 == (undefined4 *)0x0) {
local_28 = 0xffffffff;
local_20 = 0;
}
else {
puVar3 = puVar2;
local_20 = 0;
do {
local_28 = local_20;
puVar3 = (undefined4 *)puVar3[2];
local_20 = local_28 + 1;
} while (puVar3 != (undefined4 *)0x0);
}
pCVar9 = *(C_ServerClassInfo **)(param_1 + 0x41c4);
if (pCVar9 != (C_ServerClassInfo *)0x0) {
pCVar4 = pCVar9 + *(int *)(pCVar9 + -4) * 0x10;
if (pCVar9 != pCVar4) {
do {
pCVar4 = pCVar4 + -0x10;
C_ServerClassInfo::~C_ServerClassInfo(pCVar4);
pCVar9 = *(C_ServerClassInfo **)(param_1 + 0x41c4);
} while (pCVar9 != pCVar4);
}
operator_delete__(pCVar9 + -4);
}
*(uint *)(param_1 + 0x41c8) = local_20;
uVar5 = 0xffffffff;
if (local_20 < 0x7f00001) {
uVar5 = local_20 * 0x10 + 4;
}
puVar6 = operator_new__(uVar5);
pCVar4 = (C_ServerClassInfo *)(puVar6 + 1);
*puVar6 = local_20;
pCVar9 = pCVar4;
for (; local_28 != 0xffffffff; local_28 = local_28 - 1) {
/* try { // try from 001446a3 to 001446a7 has its CatchHandler @ 0014476e */
C_ServerClassInfo::C_ServerClassInfo(pCVar9);
pCVar9 = pCVar9 + 0x10;
}
*(C_ServerClassInfo **)(param_1 + 0x41c4) = pCVar4;
if (pCVar4 == (C_ServerClassInfo *)0x0) {
Host_EndGame(true,"CL_ParseClassInfo: can\'t allocate %d C_ServerClassInfos.\n",
*(undefined4 *)(param_1 + 0x41c8));
}
else {
iVar10 = 0;
for (; puVar2 != (undefined4 *)0x0; puVar2 = (undefined4 *)puVar2[2]) {
puVar2[3] = iVar10;
iVar8 = iVar10 * 0x10;
iVar10 = iVar10 + 1;
iVar1 = *(int *)(param_1 + 0x41c4);
uVar7 = COM_StringCopy((char *)*puVar2);
*(undefined4 *)(iVar8 + iVar1 + 4) = uVar7;
iVar1 = puVar2[3];
iVar8 = *(int *)(param_1 + 0x41c4);
uVar7 = COM_StringCopy(*(char **)(puVar2[1] + 8));
*(undefined4 *)(iVar1 * 0x10 + iVar8 + 8) = uVar7;
}
}
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.