L L4D2node

CMapReslistGenerator::EnableDeletionsTracking

0x0018d830 · 998 bytes · __thiscall

_ZN20CMapReslistGenerator23EnableDeletionsTrackingEv

Decompiled

undefined (1 param)

/* CMapReslistGenerator::EnableDeletionsTracking() */

void __thiscall CMapReslistGenerator::EnableDeletionsTracking(CMapReslistGenerator *this)

{
  short sVar1;
  int iVar2;
  int iVar3;
  char *pcVar4;
  int iVar5;
  char *pcVar6;
  int in_GS_OFFSET;
  int local_14c;
  int local_144;
  char local_13c [22];
  CUtlSymbol local_126 [2];
  char local_124 [260];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  *this = (CMapReslistGenerator)0x1;
  iVar2 = (**(code **)(g_pFileSystem[1] + 8))(g_pFileSystem + 1,"deletions.bat",&DAT_002a3e98,0);
  if (iVar2 == 0) {
    Warning("Unable to load deletions.bat file %s\n","deletions.bat");
    *this = (CMapReslistGenerator)0x0;
    goto LAB_0018da45;
  }
  iVar3 = (**(code **)(g_pFileSystem[1] + 0x18))(g_pFileSystem + 1,iVar2);
  if (iVar3 < 1) {
LAB_0018d900:
    local_144 = 0;
  }
  else {
    pcVar4 = operator_new__(iVar3 + 1);
    if (pcVar4 == (char *)0x0) goto LAB_0018d900;
    iVar5 = (**(code **)g_pFileSystem[1])(g_pFileSystem + 1,pcVar4,iVar3,iVar2);
    if (iVar3 == iVar5) {
      local_144 = 0;
      pcVar4[iVar3] = '\0';
      pcVar6 = pcVar4;
      while( true ) {
        pcVar6 = (char *)COM_Parse(pcVar6);
        if (com_token == '\0') break;
        iVar3 = _V_stricmp(&com_token,"del");
        if (iVar3 != 0) {
          V_snprintf(local_124,0x104,"%s/%s",com_gamedir,&com_token);
          while( true ) {
            iVar3 = COM_TokenWaiting(pcVar6);
            if (iVar3 == 0) break;
            pcVar6 = (char *)COM_Parse(pcVar6);
          }
          V_FixSlashes(local_124,'/');
          _V_strlower(local_124);
          CUtlSymbolTable::AddString(local_13c);
          local_144 = local_144 + 1;
        }
      }
    }
    else {
      local_144 = 0;
    }
    operator_delete__(pcVar4);
  }
  (**(code **)(g_pFileSystem[1] + 0xc))(g_pFileSystem + 1,iVar2);
  iVar2 = (**(code **)(g_pFileSystem[1] + 8))(g_pFileSystem + 1,"undelete.lst",&DAT_002a3e98,0);
  if (iVar2 == 0) {
    local_14c = 0;
  }
  else {
    iVar3 = (**(code **)(g_pFileSystem[1] + 0x18))(g_pFileSystem + 1,iVar2);
    if (iVar3 < 1) {
LAB_0018d9d8:
      local_14c = 0;
    }
    else {
      pcVar4 = operator_new__(iVar3 + 1);
      if (pcVar4 == (char *)0x0) goto LAB_0018d9d8;
      iVar5 = (**(code **)g_pFileSystem[1])(g_pFileSystem + 1,pcVar4,iVar3,iVar2);
      if (iVar3 == iVar5) {
        local_14c = 0;
        pcVar4[iVar3] = '\0';
        pcVar6 = pcVar4;
        while( true ) {
          pcVar6 = (char *)COM_Parse(pcVar6);
          if (com_token == '\0') break;
          V_FixSlashes(&com_token,'/');
          _V_strlower(&com_token);
          CUtlSymbolTable::AddString((char *)local_126);
          sVar1 = CUtlRBTree<CUtlSymbol,unsigned_short,bool(*)(CUtlSymbol_const&,CUtlSymbol_const&),CUtlMemory<UtlRBTreeNode_t<CUtlSymbol,unsigned_short>,unsigned_short>>
                  ::Find((CUtlRBTree<CUtlSymbol,unsigned_short,bool(*)(CUtlSymbol_const&,CUtlSymbol_const&),CUtlMemory<UtlRBTreeNode_t<CUtlSymbol,unsigned_short>,unsigned_short>>
                          *)(this + 0x120),local_126);
          if (sVar1 == -1) {
            CUtlRBTree<CUtlSymbol,unsigned_short,bool(*)(CUtlSymbol_const&,CUtlSymbol_const&),CUtlMemory<UtlRBTreeNode_t<CUtlSymbol,unsigned_short>,unsigned_short>>
            ::Insert((CUtlRBTree<CUtlSymbol,unsigned_short,bool(*)(CUtlSymbol_const&,CUtlSymbol_const&),CUtlMemory<UtlRBTreeNode_t<CUtlSymbol,unsigned_short>,unsigned_short>>
                      *)(this + 0x120),local_126);
            local_14c = local_14c + 1;
          }
        }
      }
      else {
        local_14c = 0;
      }
      operator_delete__(pcVar4);
    }
    (**(code **)(g_pFileSystem[1] + 0xc))(g_pFileSystem + 1,iVar2);
  }
  (**(code **)(*g_pFileSystem + 0x108))(g_pFileSystem,TrackDeletionsLoggingFunc);
  Msg("Tracking deletions (%u files in deletion list in \'%s\', %u previous warnings loaded from \'%s\'\n"
      ,local_144,"deletions.bat",local_14c,"undelete.lst");
LAB_0018da45:
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

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)