send_all_trees
0x000ebab0 · 408 bytes · __cdecl
_Z14send_all_treesR6TStateiii
Decompiled
undefined (4 params)
/* send_all_trees(TState&, int, int, int) */
void send_all_trees(TState *param_1,int param_2,int param_3,int param_4)
{
byte bVar1;
int iVar2;
if (((param_2 < 0x101) || (param_3 < 1)) || (param_4 < 4)) {
*(char **)(param_1 + 0x6afa4) = "not enough codes";
}
if (((0x11e < param_2) || (0x1e < param_3)) || (0x13 < param_4)) {
*(char **)(param_1 + 0x6afa4) = "too many codes";
}
iVar2 = 0;
Trace("\nbl counts: ");
send_bits(param_1,param_2 + -0x101,5);
send_bits(param_1,param_3 + -1,5);
send_bits(param_1,param_4 + -4,4);
if (0 < param_4) {
do {
bVar1 = (&bl_order)[iVar2];
iVar2 = iVar2 + 1;
Trace("\nbl code %2d ",(uint)bVar1);
send_bits(param_1,(uint)*(ushort *)(param_1 + (uint)bVar1 * 4 + 0xef6),3);
} while (iVar2 != param_4);
}
Trace("\nbl tree: sent %ld",*(undefined4 *)(param_1 + 0x1af6c));
send_tree(param_1,(ct_data *)(param_1 + 0x14),param_2 + -1);
Trace("\nlit tree: sent %ld",*(undefined4 *)(param_1 + 0x1af6c));
send_tree(param_1,(ct_data *)(param_1 + 0x908),param_3 + -1);
Trace("\ndist tree: sent %ld");
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.