L L4D2node

CServerGameDLL::GetMatchmakingGameData

0x006c5040 · 447 bytes · __thiscall

_ZN14CServerGameDLL22GetMatchmakingGameDataEPcj

Decompiled

undefined (3 params)

/* CServerGameDLL::GetMatchmakingGameData(char*, unsigned int) */

void __thiscall
CServerGameDLL::GetMatchmakingGameData(CServerGameDLL *this,char *param_1,uint param_2)

{
  char cVar1;
  size_t sVar2;
  int iVar3;
  KeyValues *pKVar4;
  char *pcVar5;
  undefined4 uVar6;
  char *__s;
  uint local_20;
  
  V_snprintf(param_1,param_2,"g:l4d2,");
  sVar2 = strlen(param_1);
  local_20 = param_2 - sVar2;
  __s = param_1 + sVar2;
  if ((GetMatchmakingGameData(char*,unsigned_int)::sv_gametypes == '\0') &&
     (iVar3 = __cxa_guard_acquire(&GetMatchmakingGameData(char*,unsigned_int)::sv_gametypes),
     iVar3 != 0)) {
                    /* try { // try from 006c51ff to 006c5203 has its CatchHandler @ 006c5215 */
    ConVarRef::ConVarRef
              ((ConVarRef *)&GetMatchmakingGameData(char*,unsigned_int)::sv_gametypes,"sv_gametypes"
              );
    __cxa_guard_release(&GetMatchmakingGameData(char*,unsigned_int)::sv_gametypes);
  }
  cVar1 = ConVarRef::IsValid((ConVarRef *)&GetMatchmakingGameData(char*,unsigned_int)::sv_gametypes)
  ;
  if ((cVar1 != '\0') &&
     (**(char **)(GetMatchmakingGameData(char*,unsigned_int)::sv_gametypes._4_4_ + 0x24) != '\0')) {
    V_snprintf(__s,local_20,"%s,",
               *(char **)(GetMatchmakingGameData(char*,unsigned_int)::sv_gametypes._4_4_ + 0x24));
    sVar2 = strlen(__s);
    local_20 = local_20 - sVar2;
    __s = __s + sVar2;
  }
  pKVar4 = (KeyValues *)(**(code **)*g_pMatchExtL4D)(g_pMatchExtL4D);
  if (pKVar4 == (KeyValues *)0x0) {
LAB_006c5170:
    if (param_1 < __s) {
      __s[-1] = '\0';
    }
    return;
  }
  pKVar4 = (KeyValues *)KeyValues::GetFirstTrueSubKey(pKVar4);
joined_r0x006c50d6:
  if (pKVar4 != (KeyValues *)0x0) {
    do {
      iVar3 = KeyValues::GetInt(pKVar4,"BuiltIn",0);
      if (iVar3 == 0) {
        pcVar5 = (char *)KeyValues::GetString(pKVar4,"CfgTag","");
        sVar2 = strlen(pcVar5);
        if (local_20 <= sVar2 + 1) goto code_r0x006c513a;
        V_strncpy(__s,pcVar5,sVar2 + 1);
        pcVar5 = __s + sVar2;
        __s = pcVar5 + 1;
        *pcVar5 = ',';
        local_20 = (local_20 - sVar2) - 1;
      }
      pKVar4 = (KeyValues *)KeyValues::GetNextTrueSubKey(pKVar4);
      if (pKVar4 == (KeyValues *)0x0) break;
    } while( true );
  }
  goto LAB_006c5170;
code_r0x006c513a:
  uVar6 = KeyValues::GetString(pKVar4,"Name","");
  Warning("GameData: Too many missions installed, not advertising for mission \"%s\"\n",uVar6);
  pKVar4 = (KeyValues *)KeyValues::GetNextTrueSubKey(pKVar4);
  goto joined_r0x006c50d6;
}

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)