L L4D2node

CChoreoChannel::ReconcileCloseCaption

0x00b9e780 · 1529 bytes · __thiscall

_ZN14CChoreoChannel21ReconcileCloseCaptionEv

Decompiled

undefined (1 param)

/* CChoreoChannel::ReconcileCloseCaption() */

void __thiscall CChoreoChannel::ReconcileCloseCaption(CChoreoChannel *this)

{
  ushort uVar1;
  int iVar2;
  CChoreoEvent *this_00;
  char cVar3;
  bool bVar4;
  int iVar5;
  code *pcVar6;
  uint uVar7;
  int iVar8;
  int iVar9;
  CChoreoEvent *pCVar10;
  longdouble lVar11;
  CUtlDict<EventGroup,int> *local_8c;
  int local_84;
  int local_80;
  CUtlRBTree<CChoreoEvent*,unsigned_short,bool(*)(CChoreoEvent*const&,CChoreoEvent*const&),CUtlMemory<UtlRBTreeNode_t<CChoreoEvent*,unsigned_short>,unsigned_short>>
  *local_78;
  int local_70;
  CChoreoEvent *local_64;
  code *local_60;
  code *local_5c;
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_50;
  undefined2 local_4c;
  undefined2 local_4a;
  undefined4 local_48;
  undefined4 local_44;
  code *local_40;
  int local_3c [11];
  
  local_3c[0] = 0;
  local_3c[1] = 0;
  local_3c[2] = 0;
  local_3c[3] = -1;
  local_3c[4] = 0;
  iVar2 = *(int *)(this + 0x90);
  local_3c[5] = 0xffffffff;
  local_3c[6] = 0xffffffff;
  local_3c[7] = 0;
  local_40 = CaselessStringLessThan;
  if (0 < iVar2) {
    iVar9 = 0;
    do {
      while( true ) {
        if (iVar9 < *(int *)(this + 0x90)) {
          local_64 = *(CChoreoEvent **)(*(int *)(this + 0x84) + iVar9 * 4);
        }
        else {
          local_64 = (CChoreoEvent *)0x0;
        }
                    /* try { // try from 00b9e7f8 to 00b9e841 has its CatchHandler @ 00b9edd2 */
        iVar5 = CChoreoEvent::GetType(local_64);
        if (iVar5 == 5) break;
LAB_00b9e802:
        iVar9 = iVar9 + 1;
        if (iVar9 == iVar2) goto LAB_00b9ea0c;
      }
      iVar5 = CChoreoEvent::GetCloseCaptionType(local_64);
      if (iVar5 == 2) {
LAB_00b9ebcd:
        CChoreoEvent::SetUsingCombinedFile(local_64,false);
        CChoreoEvent::SetRequiredCombinedChecksum(local_64,0);
        CChoreoEvent::SetNumSlaves(local_64,0);
        CChoreoEvent::SetLastSlaveEndTime(local_64,0.0);
        goto LAB_00b9e802;
      }
      pcVar6 = (code *)CChoreoEvent::GetCloseCaptionToken(local_64);
      if ((pcVar6 == (code *)0x0) || (*pcVar6 == (code)0x0)) {
        if (iVar5 != 1) goto LAB_00b9e802;
        CChoreoEvent::SetCloseCaptionType(local_64,0);
        goto LAB_00b9ebcd;
      }
      local_5c = ChoreEventStartTimeLessFunc;
      local_58 = 0;
      local_54 = 0;
      local_50 = 0;
      local_4c = 0xffff;
      local_4a = 0;
      local_48._2_2_ = 0xffff;
      local_48._0_2_ = 0xffff;
      local_44 = 0;
      local_70 = local_3c[3];
      local_60 = pcVar6;
      if (local_3c[3] != -1) {
        do {
          while( true ) {
            iVar5 = local_70 * 0x30;
                    /* try { // try from 00b9e8ed to 00b9e908 has its CatchHandler @ 00b9ed69 */
            cVar3 = (*local_40)(&local_60,local_3c[0] + 0x10 + iVar5);
            if (cVar3 != '\0') break;
            cVar3 = (*local_40)(local_3c[0] + iVar5 + 0x10,&local_60);
            if (cVar3 == '\0') {
              CUtlRBTree<CChoreoEvent*,unsigned_short,bool(*)(CChoreoEvent*const&,CChoreoEvent*const&),CUtlMemory<UtlRBTreeNode_t<CChoreoEvent*,unsigned_short>,unsigned_short>>
              ::RemoveAll((CUtlRBTree<CChoreoEvent*,unsigned_short,bool(*)(CChoreoEvent*const&,CChoreoEvent*const&),CUtlMemory<UtlRBTreeNode_t<CChoreoEvent*,unsigned_short>,unsigned_short>>
                           *)&local_5c);
              local_48 = CONCAT22(local_48._2_2_,0xffff);
              CUtlMemory<UtlRBTreeNode_t<CChoreoEvent*,unsigned_short>,unsigned_short>::Purge
                        ((CUtlMemory<UtlRBTreeNode_t<CChoreoEvent*,unsigned_short>,unsigned_short> *
                         )&local_58);
              local_48 = CONCAT22(0xffff,(undefined2)local_48);
              CUtlMemory<UtlRBTreeNode_t<CChoreoEvent*,unsigned_short>,unsigned_short>::Purge
                        ((CUtlMemory<UtlRBTreeNode_t<CChoreoEvent*,unsigned_short>,unsigned_short> *
                         )&local_58);
              if (local_70 == -1) goto LAB_00b9e961;
              CUtlRBTree<CChoreoEvent*,unsigned_short,bool(*)(CChoreoEvent*const&,CChoreoEvent*const&),CUtlMemory<UtlRBTreeNode_t<CChoreoEvent*,unsigned_short>,unsigned_short>>
              ::Insert((CUtlRBTree<CChoreoEvent*,unsigned_short,bool(*)(CChoreoEvent*const&,CChoreoEvent*const&),CUtlMemory<UtlRBTreeNode_t<CChoreoEvent*,unsigned_short>,unsigned_short>>
                        *)(local_3c[0] + iVar5 + 0x14),&local_64);
              goto LAB_00b9e802;
            }
            if ((CUtlRBTree<CUtlMap<char_const*,EventGroup,int>::Node_t,int,CUtlMap<char_const*,EventGroup,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,EventGroup,int>::Node_t,int>,int>>
                 ::Links(int)::s_Sentinel == '\0') &&
               (iVar8 = __cxa_guard_acquire(&CUtlRBTree<CUtlMap<char_const*,EventGroup,int>::Node_t,int,CUtlMap<char_const*,EventGroup,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,EventGroup,int>::Node_t,int>,int>>
                                             ::Links(int)::s_Sentinel), iVar8 != 0)) {
              CUtlRBTree<CUtlMap<char_const*,EventGroup,int>::Node_t,int,CUtlMap<char_const*,EventGroup,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,EventGroup,int>::Node_t,int>,int>>
              ::Links(int)::s_Sentinel = 0xffffffff;
              DAT_00f6d208 = 0xffffffff;
              DAT_00f6d20c = 0xffffffff;
              __cxa_guard_release(&CUtlRBTree<CUtlMap<char_const*,EventGroup,int>::Node_t,int,CUtlMap<char_const*,EventGroup,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,EventGroup,int>::Node_t,int>,int>>
                                   ::Links(int)::s_Sentinel);
            }
            local_70 = *(int *)(local_3c[0] + 4 + iVar5);
            if (local_70 == -1) goto LAB_00b9e92e;
          }
          if ((CUtlRBTree<CUtlMap<char_const*,EventGroup,int>::Node_t,int,CUtlMap<char_const*,EventGroup,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,EventGroup,int>::Node_t,int>,int>>
               ::Links(int)::s_Sentinel == '\0') &&
             (iVar8 = __cxa_guard_acquire(&CUtlRBTree<CUtlMap<char_const*,EventGroup,int>::Node_t,int,CUtlMap<char_const*,EventGroup,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,EventGroup,int>::Node_t,int>,int>>
                                           ::Links(int)::s_Sentinel), iVar8 != 0)) {
            CUtlRBTree<CUtlMap<char_const*,EventGroup,int>::Node_t,int,CUtlMap<char_const*,EventGroup,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,EventGroup,int>::Node_t,int>,int>>
            ::Links(int)::s_Sentinel = 0xffffffff;
            DAT_00f6d208 = 0xffffffff;
            DAT_00f6d20c = 0xffffffff;
            __cxa_guard_release(&CUtlRBTree<CUtlMap<char_const*,EventGroup,int>::Node_t,int,CUtlMap<char_const*,EventGroup,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,EventGroup,int>::Node_t,int>,int>>
                                 ::Links(int)::s_Sentinel);
          }
          local_70 = *(int *)(local_3c[0] + iVar5);
        } while (local_70 != -1);
      }
LAB_00b9e92e:
      CUtlRBTree<CChoreoEvent*,unsigned_short,bool(*)(CChoreoEvent*const&,CChoreoEvent*const&),CUtlMemory<UtlRBTreeNode_t<CChoreoEvent*,unsigned_short>,unsigned_short>>
      ::RemoveAll((CUtlRBTree<CChoreoEvent*,unsigned_short,bool(*)(CChoreoEvent*const&,CChoreoEvent*const&),CUtlMemory<UtlRBTreeNode_t<CChoreoEvent*,unsigned_short>,unsigned_short>>
                   *)&local_5c);
      local_48 = CONCAT22(local_48._2_2_,0xffff);
      CUtlMemory<UtlRBTreeNode_t<CChoreoEvent*,unsigned_short>,unsigned_short>::Purge
                ((CUtlMemory<UtlRBTreeNode_t<CChoreoEvent*,unsigned_short>,unsigned_short> *)
                 &local_58);
      local_48 = CONCAT22(0xffff,(undefined2)local_48);
      CUtlMemory<UtlRBTreeNode_t<CChoreoEvent*,unsigned_short>,unsigned_short>::Purge
                ((CUtlMemory<UtlRBTreeNode_t<CChoreoEvent*,unsigned_short>,unsigned_short> *)
                 &local_58);
LAB_00b9e961:
      local_78 = (CUtlRBTree<CChoreoEvent*,unsigned_short,bool(*)(CChoreoEvent*const&,CChoreoEvent*const&),CUtlMemory<UtlRBTreeNode_t<CChoreoEvent*,unsigned_short>,unsigned_short>>
                  *)&local_60;
      local_60 = ChoreEventStartTimeLessFunc;
      local_50 = 0xffff;
      local_4c = 0xffff;
      local_4a = 0xffff;
      local_5c = (code *)0x0;
      local_58 = 0;
      local_54 = 0;
      local_48 = 0;
                    /* try { // try from 00b9e9b2 to 00b9e9cf has its CatchHandler @ 00b9edb5 */
      CUtlRBTree<CChoreoEvent*,unsigned_short,bool(*)(CChoreoEvent*const&,CChoreoEvent*const&),CUtlMemory<UtlRBTreeNode_t<CChoreoEvent*,unsigned_short>,unsigned_short>>
      ::Insert(local_78,&local_64);
      CUtlDict<EventGroup,int>::Insert
                ((CUtlDict<EventGroup,int> *)&local_40,(char *)pcVar6,(EventGroup *)local_78);
      iVar9 = iVar9 + 1;
      CUtlRBTree<CChoreoEvent*,unsigned_short,bool(*)(CChoreoEvent*const&,CChoreoEvent*const&),CUtlMemory<UtlRBTreeNode_t<CChoreoEvent*,unsigned_short>,unsigned_short>>
      ::RemoveAll(local_78);
      local_4c = 0xffff;
      CUtlMemory<UtlRBTreeNode_t<CChoreoEvent*,unsigned_short>,unsigned_short>::Purge
                ((CUtlMemory<UtlRBTreeNode_t<CChoreoEvent*,unsigned_short>,unsigned_short> *)
                 &local_5c);
      local_4a = 0xffff;
      CUtlMemory<UtlRBTreeNode_t<CChoreoEvent*,unsigned_short>,unsigned_short>::Purge
                ((CUtlMemory<UtlRBTreeNode_t<CChoreoEvent*,unsigned_short>,unsigned_short> *)
                 &local_5c);
    } while (iVar9 != iVar2);
LAB_00b9ea0c:
    iVar2 = local_3c[4];
    if ((local_3c[4] != 0) && (0 < local_3c[4])) {
      local_80 = 0;
      local_84 = 0;
      do {
        iVar9 = local_80 + local_3c[0];
        uVar1 = *(ushort *)(iVar9 + 0x26);
        if (uVar1 < 2) {
          pCVar10 = *(CChoreoEvent **)(*(int *)(iVar9 + 0x18) + 8);
          CChoreoEvent::SetCloseCaptionType(pCVar10,0);
          CChoreoEvent::SetUsingCombinedFile(pCVar10,false);
          CChoreoEvent::SetRequiredCombinedChecksum(pCVar10,0);
          CChoreoEvent::SetNumSlaves(pCVar10,0);
          CChoreoEvent::SetLastSlaveEndTime(pCVar10,0.0);
        }
        else {
          uVar7 = CUtlRBTree<CChoreoEvent*,unsigned_short,bool(*)(CChoreoEvent*const&,CChoreoEvent*const&),CUtlMemory<UtlRBTreeNode_t<CChoreoEvent*,unsigned_short>,unsigned_short>>
                  ::FirstInorder((CUtlRBTree<CChoreoEvent*,unsigned_short,bool(*)(CChoreoEvent*const&,CChoreoEvent*const&),CUtlMemory<UtlRBTreeNode_t<CChoreoEvent*,unsigned_short>,unsigned_short>>
                                  *)(iVar9 + 0x14));
          uVar7 = uVar7 & 0xffff;
          if (uVar7 != 0xffff) {
            pCVar10 = (CChoreoEvent *)0x0;
            do {
              this_00 = *(CChoreoEvent **)(uVar7 * 0xc + *(int *)(iVar9 + 0x18) + 8);
              if (pCVar10 == (CChoreoEvent *)0x0) {
                CChoreoEvent::SetCloseCaptionType(this_00,0);
                CChoreoEvent::SetRequiredCombinedChecksum(this_00,0);
                CChoreoEvent::SetNumSlaves(this_00,uVar1 - 1);
                lVar11 = (longdouble)CChoreoEvent::GetEndTime(this_00);
                CChoreoEvent::SetLastSlaveEndTime(this_00,(float)lVar11);
                pCVar10 = this_00;
              }
              else {
                    /* try { // try from 00b9ea83 to 00b9ed63 has its CatchHandler @ 00b9edd2 */
                lVar11 = (longdouble)CChoreoEvent::GetEndTime(this_00);
                CChoreoEvent::SetLastSlaveEndTime(pCVar10,(float)lVar11);
                CChoreoEvent::SetCloseCaptionType(this_00,1);
                bVar4 = (bool)CChoreoEvent::IsUsingCombinedFile(pCVar10);
                CChoreoEvent::SetUsingCombinedFile(this_00,bVar4);
                CChoreoEvent::SetRequiredCombinedChecksum(this_00,0);
                CChoreoEvent::SetLastSlaveEndTime(this_00,0.0);
              }
              uVar7 = CUtlRBTree<CChoreoEvent*,unsigned_short,bool(*)(CChoreoEvent*const&,CChoreoEvent*const&),CUtlMemory<UtlRBTreeNode_t<CChoreoEvent*,unsigned_short>,unsigned_short>>
                      ::NextInorder((CUtlRBTree<CChoreoEvent*,unsigned_short,bool(*)(CChoreoEvent*const&,CChoreoEvent*const&),CUtlMemory<UtlRBTreeNode_t<CChoreoEvent*,unsigned_short>,unsigned_short>>
                                     *)(iVar9 + 0x14),(ushort)uVar7);
              uVar7 = uVar7 & 0xffff;
            } while (uVar7 != 0xffff);
          }
        }
        local_84 = local_84 + 1;
        local_80 = local_80 + 0x30;
      } while (local_84 != iVar2);
    }
  }
  local_8c = (CUtlDict<EventGroup,int> *)&local_40;
  CUtlDict<EventGroup,int>::RemoveAll(local_8c);
  CUtlRBTree<CUtlMap<char_const*,EventGroup,int>::Node_t,int,CUtlMap<char_const*,EventGroup,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,EventGroup,int>::Node_t,int>,int>>
  ::RemoveAll((CUtlRBTree<CUtlMap<char_const*,EventGroup,int>::Node_t,int,CUtlMap<char_const*,EventGroup,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,EventGroup,int>::Node_t,int>,int>>
               *)local_8c);
  local_3c[5] = 0xffffffff;
  CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,EventGroup,int>::Node_t,int>,int>::Purge
            ((CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,EventGroup,int>::Node_t,int>,int> *)
             local_3c);
  local_3c[6] = 0xffffffff;
  CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,EventGroup,int>::Node_t,int>,int>::Purge
            ((CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,EventGroup,int>::Node_t,int>,int> *)
             local_3c);
  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)