L L4D2node

GCSDK::CRecordInfo::InitFromDSSchema

0x00094430 · 830 bytes · __thiscall

_ZN5GCSDK11CRecordInfo16InitFromDSSchemaEPNS_7CSchemaE

Decompiled

undefined (2 params)

/* GCSDK::CRecordInfo::InitFromDSSchema(GCSDK::CSchema*) */

void __thiscall GCSDK::CRecordInfo::InitFromDSSchema(CRecordInfo *this,CSchema *param_1)

{
  void *pvVar1;
  int iVar2;
  undefined4 *puVar3;
  int iVar4;
  FKData_t *pFVar5;
  CUtlVector<int,CUtlMemory<int,int>> *this_00;
  int iVar6;
  int *piVar7;
  int local_20;
  
  V_strncpy((char *)(this + 8),(char *)(param_1 + 8),0x81);
  iVar4 = *(int *)(param_1 + 0x94);
  if ((*(int *)(this + 0x94) < iVar4) && (-1 < *(int *)(this + 0x98))) {
    *(int *)(this + 0x94) = iVar4;
    if (*(void **)(this + 0x90) == (void *)0x0) {
      pvVar1 = malloc(iVar4 * 0xa0);
      *(void **)(this + 0x90) = pvVar1;
    }
    else {
      pvVar1 = realloc(*(void **)(this + 0x90),iVar4 * 0xa0);
      *(void **)(this + 0x90) = pvVar1;
    }
  }
  else {
    pvVar1 = *(void **)(this + 0x90);
  }
  *(void **)(this + 0xa0) = pvVar1;
  if (0 < iVar4) {
    iVar6 = 0;
    do {
      iVar2 = iVar6 * 0x118;
      iVar6 = iVar6 + 1;
      puVar3 = (undefined4 *)(iVar2 + *(int *)(param_1 + 0x88));
      AddColumn(this,puVar3 + 0x24,iVar6,*puVar3,puVar3[1],puVar3[0x44],puVar3[2]);
    } while (iVar6 != iVar4);
  }
  *(undefined4 *)(this + 0xc4) = *(undefined4 *)(param_1 + 4);
  iVar4 = *(int *)(param_1 + 0xa8);
  CUtlVector<GCSDK::FieldSet_t,CUtlMemory<GCSDK::FieldSet_t,int>>::SetCount
            ((CUtlVector<GCSDK::FieldSet_t,CUtlMemory<GCSDK::FieldSet_t,int>> *)(this + 200),iVar4);
  local_20 = 0;
  if (0 < iVar4) {
    do {
      piVar7 = (int *)(*(int *)(param_1 + 0x9c) + local_20 * 0xb0);
      iVar6 = piVar7[3];
      this_00 = (CUtlVector<int,CUtlMemory<int,int>> *)(local_20 * 0xb0 + *(int *)(this + 200));
      *(undefined4 *)(this_00 + 0xc) = 0;
      if (iVar6 != 0) {
        CUtlVector<int,CUtlMemory<int,int>>::GrowVector(this_00,iVar6);
        CUtlVector<int,CUtlMemory<int,int>>::ShiftElementsRight(this_00,0,iVar6);
        if (0 < iVar6) {
          iVar2 = 0;
          do {
            *(undefined4 *)(*(int *)this_00 + iVar2 * 4) = *(undefined4 *)(*piVar7 + iVar2 * 4);
            iVar2 = iVar2 + 1;
          } while (iVar2 != iVar6);
        }
      }
      iVar6 = piVar7[8];
      *(undefined4 *)(this_00 + 0x20) = 0;
      if (iVar6 != 0) {
        CUtlVector<int,CUtlMemory<int,int>>::GrowVector(this_00 + 0x14,iVar6);
        CUtlVector<int,CUtlMemory<int,int>>::ShiftElementsRight(this_00 + 0x14,0,iVar6);
        if (0 < iVar6) {
          iVar2 = 0;
          do {
            *(undefined4 *)(*(int *)(this_00 + 0x14) + iVar2 * 4) =
                 *(undefined4 *)(piVar7[5] + iVar2 * 4);
            iVar2 = iVar2 + 1;
          } while (iVar2 != iVar6);
        }
      }
      this_00[0x28] = *(CUtlVector<int,CUtlMemory<int,int>> *)(piVar7 + 10);
      this_00[0x29] = *(CUtlVector<int,CUtlMemory<int,int>> *)((int)piVar7 + 0x29);
      *(int *)(this_00 + 0x2c) = piVar7[0xb];
      V_strncpy((char *)(this_00 + 0x30),(char *)(piVar7 + 0xc),0x80);
      local_20 = local_20 + 1;
    } while (local_20 != iVar4);
  }
  *(undefined4 *)(this + 0xe8) = *(undefined4 *)(param_1 + 0xfc);
  iVar4 = *(int *)(param_1 + 0xd4);
  *(undefined4 *)(this + 0xf8) = 0;
  if (iVar4 != 0) {
    CUtlVector<int,CUtlMemory<int,int>>::GrowVector
              ((CUtlVector<int,CUtlMemory<int,int>> *)(this + 0xec),iVar4);
    CUtlVector<int,CUtlMemory<int,int>>::ShiftElementsRight
              ((CUtlVector<int,CUtlMemory<int,int>> *)(this + 0xec),0,iVar4);
    if (0 < iVar4) {
      iVar6 = 0;
      do {
        *(undefined4 *)(*(int *)(this + 0xec) + iVar6 * 4) =
             *(undefined4 *)(*(int *)(param_1 + 200) + iVar6 * 4);
        iVar6 = iVar6 + 1;
      } while (iVar6 != iVar4);
    }
  }
  *(undefined4 *)(this + 0x100) = *(undefined4 *)(param_1 + 0xdc);
  iVar4 = CSchema::GetFKCount(param_1);
  if (0 < iVar4) {
    iVar6 = 0;
    do {
      iVar2 = iVar6 + 1;
      pFVar5 = (FKData_t *)CSchema::GetFKData(param_1,iVar6);
      CUtlVector<GCSDK::FKData_t,CUtlMemory<GCSDK::FKData_t,int>>::InsertBefore
                ((CUtlVector<GCSDK::FKData_t,CUtlMemory<GCSDK::FKData_t,int>> *)(this + 0x104),
                 *(int *)(this + 0x110),pFVar5);
      iVar6 = iVar2;
    } while (iVar2 != iVar4);
  }
  PrepareForUse(this);
  return;
}

SourceMod gamedata

paste into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)