GCSDK::AppendTableConstraints
0x000912e0 · 869 bytes · __cdecl
_ZN5GCSDK22AppendTableConstraintsEPNS_11CRecordInfoER8CFmtStrNILi8192EE
Decompiled
undefined (2 params)
/* GCSDK::AppendTableConstraints(GCSDK::CRecordInfo*, CFmtStrN<8192>&) */
void GCSDK::AppendTableConstraints(CRecordInfo *param_1,CFmtStrN *param_2)
{
int iVar1;
int iVar2;
undefined4 uVar3;
undefined4 uVar4;
char *pcVar5;
int *piVar6;
int iVar7;
int in_GS_OFFSET;
int local_650;
undefined **local_644;
undefined1 local_640;
undefined1 local_63f [259];
undefined4 local_53c;
undefined **local_538;
undefined1 local_534;
undefined1 local_533 [259];
undefined4 local_430;
undefined **local_42c;
undefined1 local_428;
char local_427 [1027];
undefined4 local_24;
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
if (*(int *)(param_1 + 0xc0) == 2) {
local_428 = 1;
local_42c = &PTR_InitQuietTruncation_000b6348;
local_427[0] = '\0';
local_24 = 0;
piVar6 = (int *)(*(int *)(param_1 + 0xc4) * 0xb0 + *(int *)(param_1 + 200));
pcVar5 = "CLUSTERED";
if ((char)piVar6[10] == '\0') {
pcVar5 = "NONCLUSTERED";
}
CFmtStrN<1024>::sprintf
((CFmtStrN<1024> *)&local_42c,", CONSTRAINT %s_PrimaryKey PRIMARY KEY %s ( ",
param_1 + 8,pcVar5);
if (0 < piVar6[3]) {
iVar1 = 0;
pcVar5 = (char *)(*(int *)*piVar6 * 0xa0 + *(int *)(param_1 + 0x90));
while( true ) {
iVar1 = iVar1 + 1;
CFmtStrN<1024>::AppendFormat((CFmtStrN<1024> *)&local_42c,pcVar5);
if (piVar6[3] <= iVar1) break;
pcVar5 = (char *)(*(int *)(*piVar6 + iVar1 * 4) * 0xa0 + *(int *)(param_1 + 0x90));
if (iVar1 != 0) {
CFmtStrN<1024>::AppendFormat((CFmtStrN<1024> *)&local_42c,", ");
}
}
}
CFmtStrN<1024>::AppendFormat((CFmtStrN<1024> *)&local_42c,") ");
if (piVar6[0xb] != 0) {
CFmtStrN<1024>::AppendFormat
((CFmtStrN<1024> *)&local_42c," WITH FILLFACTOR = %d ",piVar6[0xb]);
}
CFmtStrN<8192>::AppendFormat((CFmtStrN<8192> *)param_2,local_427);
}
iVar1 = CRecordInfo::GetFKCount(param_1);
if (0 < iVar1) {
local_650 = 0;
do {
iVar2 = CRecordInfo::GetFKData(param_1,local_650);
local_640 = 1;
local_644 = &PTR_InitQuietTruncation_000b0520;
local_63f[0] = 0;
local_53c = 0;
local_538 = &PTR_InitQuietTruncation_000b0520;
local_534 = 1;
local_533[0] = 0;
local_430 = 0;
if (0 < *(int *)(iVar2 + 0x114)) {
pcVar5 = *(char **)(iVar2 + 0x108);
iVar7 = 0;
while( true ) {
iVar7 = iVar7 + 1;
CFmtStrN<256>::AppendFormat((CFmtStrN<256> *)&local_644,pcVar5);
CFmtStrN<256>::AppendFormat((CFmtStrN<256> *)&local_538,pcVar5 + 0x81);
if (*(int *)(iVar2 + 0x114) <= iVar7) break;
pcVar5 = (char *)(iVar7 * 0x102 + *(int *)(iVar2 + 0x108));
if (0 < iVar7) {
CFmtStrN<256>::AppendFormat((CFmtStrN<256> *)&local_644,",");
CFmtStrN<256>::AppendFormat((CFmtStrN<256> *)&local_538,",");
}
}
}
local_42c = &PTR_InitQuietTruncation_000b6348;
local_428 = 1;
local_427[0] = '\0';
local_24 = 0;
uVar3 = PchNameFromEForeignKeyAction(*(undefined4 *)(iVar2 + 0x120));
uVar4 = PchNameFromEForeignKeyAction(*(undefined4 *)(iVar2 + 0x11c));
CFmtStrN<1024>::sprintf
((CFmtStrN<1024> *)&local_42c,
", CONSTRAINT %s FOREIGN KEY (%s) REFERENCES %s(%s) ON DELETE %s ON UPDATE %s",
iVar2,local_63f,iVar2 + 0x81,local_533,uVar4,uVar3);
CFmtStrN<8192>::AppendFormat((CFmtStrN<8192> *)param_2,local_427);
local_650 = local_650 + 1;
} while (local_650 != iVar1);
}
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.