CNetworkStringTable::CNetworkStringTable
0x001a36d0 · 454 bytes · __thiscall
_ZN19CNetworkStringTableC2EiPKciiii
Decompiled
undefined (7 params)
/* CNetworkStringTable::CNetworkStringTable(int, char const*, int, int, int, int) */
void __thiscall
CNetworkStringTable::CNetworkStringTable
(CNetworkStringTable *this,int param_1,char *param_2,int param_3,int param_4,int param_5,
int param_6)
{
CNetworkStringTable CVar1;
size_t sVar2;
char *pcVar3;
uint uVar4;
int iVar5;
undefined4 uVar6;
undefined4 *puVar7;
uint uVar8;
this[0x1c] = (CNetworkStringTable)((byte)this[0x1c] & 0xfb);
*(undefined ***)this = &PTR__CNetworkStringTable_002ba028;
*(int *)(this + 0x20) = param_6;
*(undefined4 *)(this + 0x3c) = 0;
*(int *)(this + 4) = param_1;
sVar2 = strlen(param_2);
uVar8 = sVar2 + 1;
/* try { // try from 001a370d to 001a3890 has its CatchHandler @ 001a3896 */
pcVar3 = operator_new__(uVar8);
*(char **)(this + 8) = pcVar3;
V_strncpy(pcVar3,param_2,uVar8);
this[0x1c] = (CNetworkStringTable)((byte)this[0x1c] & 0xfc);
*(undefined4 *)(this + 0x2c) = 0;
*(undefined4 *)(this + 0x30) = 0;
uVar4 = param_3 - 1U >> 1 | param_3 - 1U;
*(undefined4 *)(this + 0x14) = 0;
*(undefined4 *)(this + 0x34) = 0;
*(undefined4 *)(this + 0x18) = 0;
uVar4 = uVar4 >> 2 | uVar4;
*(int *)(this + 0xc) = param_3;
uVar4 = uVar4 >> 4 | uVar4;
uVar4 = uVar4 >> 8 | uVar4;
iVar5 = (uVar4 >> 0x10 | uVar4) + 1;
uVar6 = Q_log2(iVar5 + (uint)(iVar5 == 0));
*(undefined4 *)(this + 0x10) = uVar6;
this[0x1c] = (CNetworkStringTable)((byte)this[0x1c] & 0xf7 | (param_4 != 0) << 3);
*(int *)(this + 0x24) = param_4;
*(int *)(this + 0x28) = param_5;
if (0xe < param_5) {
Host_Error("String tables user data bits restricted to %i bits, requested %i is too large\n",0xe
,param_5);
param_4 = *(int *)(this + 0x24);
uVar8 = param_5;
}
if (0x4000 < param_4) {
Host_Error("String tables user data size restricted to %i bytes, requested %i is too large\n",
0x4000,param_4);
uVar8 = param_4;
}
if (1 << ((byte)*(undefined4 *)(this + 0x10) & 0x1f) < param_3) {
Host_Error("String tables bits won\'t fit! %i is did not round to power of 2\n",param_3,uVar8);
}
puVar7 = operator_new(0x24);
CVar1 = this[0x20];
*puVar7 = &PTR__CNetworkStringDict_002b9fe8;
puVar7[2] = CNetworkStringDict::CTableItem::Less;
puVar7[3] = 0;
puVar7[4] = 0;
*(byte *)(puVar7 + 1) = (byte)CVar1 & 1;
puVar7[5] = 0;
*(undefined2 *)(puVar7 + 6) = 0xffff;
*(undefined2 *)((int)puVar7 + 0x1a) = 0;
*(undefined2 *)(puVar7 + 7) = 0xffff;
*(undefined2 *)((int)puVar7 + 0x1e) = 0xffff;
puVar7[8] = 0;
*(undefined4 **)(this + 0x38) = puVar7;
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.