GCSDK::CSchema::AddField
0x0008d6d0 · 526 bytes · __thiscall
_ZN5GCSDK7CSchema8AddFieldEPcS1_10EGCSQLTypejjbi
Decompiled
undefined (8 params)
/* GCSDK::CSchema::AddField(char*, char*, EGCSQLType, unsigned int, unsigned int, bool, int) */
void __thiscall
GCSDK::CSchema::AddField
(CSchema *this,char *param_1,char *param_2,undefined4 param_4,undefined4 param_5,
int param_6,undefined4 param_7,undefined4 param_8)
{
int iVar1;
char cVar2;
int iVar3;
void *pvVar4;
int iVar5;
int iVar6;
undefined4 *puVar7;
iVar1 = *(int *)(this + 0x94);
iVar6 = *(int *)(this + 0x8c);
iVar5 = iVar1 + 1;
if (iVar6 < iVar5) {
iVar3 = *(int *)(this + 0x90);
if (-1 < iVar3) {
if (iVar3 == 0) {
if (iVar6 == 0) {
if (iVar5 < 2) {
iVar3 = 1;
goto LAB_0008d7e7;
}
iVar6 = 1;
}
do {
iVar3 = iVar6 * 2;
if (iVar5 <= iVar3) break;
iVar3 = iVar6 * 4;
iVar6 = iVar3;
} while (iVar3 < iVar5);
}
else {
for (iVar3 = (iVar1 / iVar3 + 1) * iVar3; iVar3 < iVar5; iVar3 = (iVar3 + iVar5) / 2) {
}
}
LAB_0008d7e7:
*(int *)(this + 0x8c) = iVar3;
if (*(void **)(this + 0x88) == (void *)0x0) {
pvVar4 = malloc(iVar3 * 0x118);
*(void **)(this + 0x88) = pvVar4;
}
else {
pvVar4 = realloc(*(void **)(this + 0x88),iVar3 * 0x118);
*(void **)(this + 0x88) = pvVar4;
iVar5 = *(int *)(this + 0x94) + 1;
}
goto LAB_0008d6f9;
}
}
pvVar4 = *(void **)(this + 0x88);
LAB_0008d6f9:
*(int *)(this + 0x94) = iVar5;
iVar6 = iVar1 * 0x118;
iVar5 = (iVar5 - iVar1) + -1;
*(void **)(this + 0x98) = pvVar4;
if (0 < iVar5) {
_V_memmove((void *)((int)pvVar4 + iVar6 + 0x118),(void *)((int)pvVar4 + iVar6),iVar5 * 0x118);
pvVar4 = *(void **)(this + 0x88);
}
puVar7 = (undefined4 *)(iVar6 + (int)pvVar4);
if ((param_6 != 0) &&
(iVar5 = LoggingSystem_LogAssert
("%s (%d) : %s\n","/data/src/gcsdk/sqlaccess/schema.cpp",0x299,
"Assertion Failed: 0 == cubElement"), iVar5 == 1)) {
cVar2 = ShouldUseNewAssertDialog();
if ((cVar2 == '\0') ||
(cVar2 = DoNewAssertDialog("/data/src/gcsdk/sqlaccess/schema.cpp",0x299,
"Assertion Failed: 0 == cubElement"), cVar2 != '\0')) {
raise(5);
}
_ExitOnFatalAssert("/data/src/gcsdk/sqlaccess/schema.cpp",0x299);
}
puVar7[0x44] = 0;
*puVar7 = param_4;
puVar7[1] = param_5;
puVar7[3] = param_6;
V_strncpy((char *)(puVar7 + 4),param_1,0x80);
V_strncpy((char *)(puVar7 + 0x24),param_2,0x80);
puVar7[2] = param_8;
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.