L L4D2node

CMatchTitleGameSettingsMgr::ExtendServerDetails

0x00039220 · 987 bytes · __thiscall

_ZN26CMatchTitleGameSettingsMgr19ExtendServerDetailsEP9KeyValuesS1_

Decompiled

undefined (3 params)

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

void __thiscall
CMatchTitleGameSettingsMgr::ExtendServerDetails
          (CMatchTitleGameSettingsMgr *this,KeyValues *param_1,KeyValues *param_2)

{
  int *piVar1;
  char cVar2;
  undefined *puVar3;
  int iVar4;
  KeyValues *pKVar5;
  char *pcVar6;
  undefined4 uVar7;
  KeyValues *extraout_ECX;
  int in_GS_OFFSET;
  KeyValues *local_54;
  netadr_s local_50 [12];
  netadr_s local_44 [14];
  char local_36;
  undefined *local_2c;
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  netadr_s::SetIP(local_50,0);
  netadr_s::SetPort(local_50,0);
  netadr_s::SetType(local_50,3);
  netadr_s::SetIP(local_44,0);
  netadr_s::SetPort(local_44,0);
  netadr_s::SetType(local_44,3);
  (**(code **)(**(int **)(g_pMatchExtensions + 0x54) + 0x18))
            (*(int **)(g_pMatchExtensions + 0x54),(short)local_50);
  puVar3 = local_2c;
  if ((local_36 == '\0') && (piVar1 = *(int **)(g_pMatchExtensions + 0x5c), piVar1 != (int *)0x0)) {
    puVar3 = (undefined *)(**(code **)(*piVar1 + 0xd4))(piVar1);
  }
  if (puVar3 == (undefined *)0x0) {
    puVar3 = &DAT_000b2b65;
  }
  KeyValues::SetString(param_1,"Game/state","game");
  if (ExtendServerDetails(KeyValues*,KeyValues*)::mp_gamemode == '\0') {
    iVar4 = __cxa_guard_acquire(&ExtendServerDetails(KeyValues*,KeyValues*)::mp_gamemode);
    if (iVar4 != 0) {
                    /* try { // try from 000395c7 to 000395cb has its CatchHandler @ 00039628 */
      ConVarRef::ConVarRef
                ((ConVarRef *)&ExtendServerDetails(KeyValues*,KeyValues*)::mp_gamemode,"mp_gamemode"
                 ,true);
      __cxa_guard_release(&ExtendServerDetails(KeyValues*,KeyValues*)::mp_gamemode);
    }
  }
  cVar2 = ConVarRef::IsValid((ConVarRef *)&ExtendServerDetails(KeyValues*,KeyValues*)::mp_gamemode);
  if (cVar2 != '\0') {
    pcVar6 = *(char **)(ExtendServerDetails(KeyValues*,KeyValues*)::mp_gamemode._4_4_ + 0x24);
    KeyValues::SetString(param_1,"Game/mode",pcVar6);
    pKVar5 = (KeyValues *)(**(code **)(*(int *)g_pMatchExtL4D + 0x10))(g_pMatchExtL4D,(short)pcVar6)
    ;
    if (pKVar5 != (KeyValues *)0x0) {
      iVar4 = KeyValues::GetInt(pKVar5,"vanilla",0);
      KeyValues::SetInt(param_1,"Game/vanilla",(uint)(iVar4 != 0));
    }
  }
  local_54 = (KeyValues *)0x0;
  pKVar5 = (KeyValues *)
           (**(code **)(*(int *)g_pMatchExtL4D + 0xc))
                     (g_pMatchExtL4D,(short)param_1,puVar3,&local_54);
  if (pKVar5 != (KeyValues *)0x0) {
    pcVar6 = (char *)KeyValues::GetString(local_54,"Name","");
    KeyValues::SetString(param_1,"Game/campaign",pcVar6);
    iVar4 = KeyValues::GetInt(pKVar5,"chapter",0);
    KeyValues::SetInt(param_1,"Game/chapter",iVar4);
    pKVar5 = (KeyValues *)KeyValues::FindKey(param_1,"Game/MissionInfo",true);
    pcVar6 = (char *)KeyValues::GetString(param_1,"Game/campaign","");
    TransferMissionInformationToInfo(pcVar6,pKVar5,param_2);
    pKVar5 = (KeyValues *)KeyValues::FindKey(param_1,"Game/ModeInfo",true);
    pcVar6 = (char *)KeyValues::GetString(param_1,"Game/mode","");
    TransferModeInformationToInfo(pcVar6,pKVar5,extraout_ECX);
  }
  if (ExtendServerDetails(KeyValues*,KeyValues*)::ZombieDifficulty == '\0') {
    iVar4 = __cxa_guard_acquire(&ExtendServerDetails(KeyValues*,KeyValues*)::ZombieDifficulty);
    if (iVar4 != 0) {
                    /* try { // try from 000395f7 to 000395fb has its CatchHandler @ 00039612 */
      ConVarRef::ConVarRef
                ((ConVarRef *)&ExtendServerDetails(KeyValues*,KeyValues*)::ZombieDifficulty,
                 "z_difficulty",true);
      __cxa_guard_release(&ExtendServerDetails(KeyValues*,KeyValues*)::ZombieDifficulty);
    }
  }
  cVar2 = ConVarRef::IsValid((ConVarRef *)
                             &ExtendServerDetails(KeyValues*,KeyValues*)::ZombieDifficulty);
  if (cVar2 != '\0') {
    KeyValues::SetString
              (param_1,"Game/difficulty",
               *(char **)(ExtendServerDetails(KeyValues*,KeyValues*)::ZombieDifficulty._4_4_ + 0x24)
              );
  }
  if (ExtendServerDetails(KeyValues*,KeyValues*)::r_mp_roundlimit == '\0') {
    iVar4 = __cxa_guard_acquire(&ExtendServerDetails(KeyValues*,KeyValues*)::r_mp_roundlimit);
    if (iVar4 != 0) {
                    /* try { // try from 00039597 to 0003959b has its CatchHandler @ 0003963e */
      ConVarRef::ConVarRef
                ((ConVarRef *)&ExtendServerDetails(KeyValues*,KeyValues*)::r_mp_roundlimit,
                 "mp_roundlimit",true);
      __cxa_guard_release(&ExtendServerDetails(KeyValues*,KeyValues*)::r_mp_roundlimit);
    }
  }
  cVar2 = ConVarRef::IsValid((ConVarRef *)
                             &ExtendServerDetails(KeyValues*,KeyValues*)::r_mp_roundlimit);
  if (cVar2 != '\0') {
    KeyValues::SetInt(param_1,"Game/maxrounds",
                      *(int *)(ExtendServerDetails(KeyValues*,KeyValues*)::r_mp_roundlimit._4_4_ +
                              0x30));
  }
  uVar7 = DetermineDlcRequiredMask(param_1);
  KeyValues::SetUint64((char *)param_1,CONCAT44(uVar7,"Game/dlcrequired"));
  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)