L L4D2node

CMatchTitleGameSettingsMgr::ExecuteCommand

0x0003bd50 · 1361 bytes · __thiscall

_ZN26CMatchTitleGameSettingsMgr14ExecuteCommandEP9KeyValuesS1_S1_PS1_

Decompiled

undefined (5 params)

/* CMatchTitleGameSettingsMgr::ExecuteCommand(KeyValues*, KeyValues*, KeyValues*, KeyValues**) */

void __thiscall
CMatchTitleGameSettingsMgr::ExecuteCommand
          (CMatchTitleGameSettingsMgr *this,KeyValues *param_1,KeyValues *param_2,KeyValues *param_3
          ,KeyValues **param_4)

{
  ulonglong uVar1;
  bool bVar2;
  char *pcVar3;
  int iVar4;
  KeyValues *pKVar5;
  KeyValues *pKVar6;
  KeyValues *pKVar7;
  char *pcVar8;
  int iVar9;
  int *piVar10;
  longlong lVar11;
  longlong lVar12;
  
  pcVar3 = (char *)KeyValues::GetName(param_1);
  lVar11 = KeyValues::GetUint64((char *)param_1,0xb4d28);
  if ((param_2 == (KeyValues *)0x0) ||
     (((lVar12 = KeyValues::GetUint64((char *)param_2,0xb0f40), lVar11 == lVar12 &&
       (lVar12 = KeyValues::GetUint64((char *)param_1,0xb0f49), lVar12 == 0)) ||
      (lVar12 = KeyValues::GetUint64((char *)param_1,0xb0f49), lVar12 == lVar11)))) {
    iVar4 = _V_stricmp("Game::Avatar",pcVar3);
    if (iVar4 == 0) {
      pcVar3 = (char *)KeyValues::GetString(param_2,"type","host");
      iVar4 = _V_stricmp("host",pcVar3);
      if ((iVar4 == 0) && (param_4 != (KeyValues **)0x0)) {
        pcVar3 = (char *)KeyValues::GetString(param_1,"avatar","");
        if (*pcVar3 == '\0') {
          pcVar3 = (char *)KeyValues::GetString(param_2,"state","lobby");
          iVar4 = _V_stricmp("lobby",pcVar3);
          if (iVar4 != 0) {
            return;
          }
          pcVar3 = (char *)KeyValues::GetString(param_3,"System/lock","");
          if (*pcVar3 != '\0') {
            return;
          }
        }
        OnRunCommand_Avatar(param_1,param_3,param_4);
        return;
      }
    }
    else {
      iVar4 = _V_stricmp("Game::PlayerInfo",pcVar3);
      if (iVar4 == 0) {
        pcVar3 = (char *)KeyValues::GetString(param_2,"type","host");
        iVar4 = _V_stricmp("host",pcVar3);
        if ((iVar4 == 0) && (param_4 != (KeyValues **)0x0)) {
          uVar1 = KeyValues::GetUint64((char *)param_1,0xb4d28);
          pKVar5 = (KeyValues *)KeyValues::FindKey(param_1,"game",false);
          if ((pKVar5 != (KeyValues *)0x0) &&
             (((pKVar6 = (KeyValues *)SessionMembersFindPlayer(param_3,uVar1,(KeyValues **)0x0),
               pKVar6 != (KeyValues *)0x0 &&
               (pKVar7 = (KeyValues *)KeyValues::FindKey(pKVar6,"game",true),
               pKVar7 != (KeyValues *)0x0)) &&
              (pKVar5 = (KeyValues *)KeyValues::GetFirstValue(pKVar5), pKVar5 != (KeyValues *)0x0)))
             ) {
            bVar2 = false;
            do {
              pcVar8 = (char *)KeyValues::GetName(pKVar5);
              pcVar3 = "sk_";
              iVar4 = StringAfterPrefix(pcVar8,"sk_");
              if (iVar4 != 0) {
                iVar4 = KeyValues::GetInt(pKVar5,(char *)0x0,0);
                pcVar3 = pcVar8;
                iVar9 = KeyValues::GetInt(pKVar7,pcVar8,0);
                if (iVar4 != iVar9) {
                  KeyValues::SetInt(pKVar7,pcVar8,iVar4);
                  bVar2 = true;
                  pcVar3 = pcVar8;
                }
              }
              pKVar5 = (KeyValues *)KeyValues::GetNextValue(pKVar5);
            } while (pKVar5 != (KeyValues *)0x0);
            if (bVar2) {
              *param_4 = pKVar6;
              piVar10 = (int *)(**(code **)(*g_pMatchFramework + 0x24))(g_pMatchFramework);
              if (piVar10 != (int *)0x0) {
                pKVar5 = KeyValues::operator_new((KeyValues *)0x2c,(uint)pcVar3);
                    /* try { // try from 0003c0ca to 0003c0ce has its CatchHandler @ 0003c2a9 */
                KeyValues::KeyValues(pKVar5,"Update",(IKeyValuesSystem *)0x0,false);
                pKVar6 = (KeyValues *)KeyValues::FindKey(pKVar5,"update",true);
                if (pKVar6 != (KeyValues *)0x0) {
                  pKVar7 = (KeyValues *)(**(code **)(*piVar10 + 4))(piVar10);
                  UpdateAggregateMembersSettings(pKVar7,pKVar6);
                }
                    /* try { // try from 0003c10a to 0003c10c has its CatchHandler @ 0003c2bb */
                (**(code **)(*piVar10 + 8))(piVar10,pKVar5);
                if (pKVar5 != (KeyValues *)0x0) {
                  KeyValues::deleteThis();
                  return;
                }
              }
            }
          }
        }
      }
      else {
        iVar4 = _V_stricmp("Game::Ready",pcVar3);
        if (iVar4 == 0) {
          pcVar3 = (char *)KeyValues::GetString(param_2,"type","host");
          iVar4 = _V_stricmp("host",pcVar3);
          if ((iVar4 == 0) && (param_4 != (KeyValues **)0x0)) {
            pcVar3 = (char *)KeyValues::GetString(param_1,"ready","");
            iVar4 = _V_stricmp("yes",pcVar3);
            uVar1 = KeyValues::GetUint64((char *)param_1,0xb4d28);
            iVar9 = KeyValues::FindKey(param_3,"Members",false);
            if ((iVar9 != 0) &&
               ((pKVar5 = (KeyValues *)SessionMembersFindPlayer(param_3,uVar1,(KeyValues **)0x0),
                pKVar5 != (KeyValues *)0x0 &&
                (pKVar6 = (KeyValues *)KeyValues::FindKey(pKVar5,"Game",true),
                pKVar6 != (KeyValues *)0x0)))) {
              pcVar3 = (char *)KeyValues::GetString(pKVar6,"ready","");
              iVar9 = _V_stricmp("yes",pcVar3);
              if ((iVar4 == 0) != (iVar9 == 0)) {
                pcVar3 = "yes";
                if (iVar4 != 0) {
                  pcVar3 = "no";
                }
                KeyValues::SetString(pKVar6,"ready",pcVar3);
                *param_4 = pKVar5;
              }
            }
          }
        }
      }
    }
  }
  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)