L L4D2node

TransferMissionInformationToInfo

0x00038ab0 · 1115 bytes · __regparm3

_ZL32TransferMissionInformationToInfoPKcP9KeyValuesS2_

Decompiled

undefined (3 params)

/* TransferMissionInformationToInfo(char const*, KeyValues*, KeyValues*) */

void __regparm3
TransferMissionInformationToInfo(char *param_1,KeyValues *param_2,KeyValues *param_3)

{
  char *pcVar1;
  int iVar2;
  undefined4 uVar3;
  KeyValues *this;
  int iVar4;
  KeyValues *this_00;
  
  if (param_2 != (KeyValues *)0x0) {
    if ((param_1 == (char *)0x0) || (*param_1 == '\0')) {
      pcVar1 = (char *)KeyValues::GetString((KeyValues *)0x0,"Version","1");
      KeyValues::SetString(param_2,"Version",pcVar1);
      pcVar1 = (char *)KeyValues::GetString((KeyValues *)0x0,"BuiltIn","1");
      KeyValues::SetString(param_2,"BuiltIn",pcVar1);
      iVar2 = KeyValues::GetInt((KeyValues *)0x0,"addon",1);
      KeyValues::SetInt(param_2,"addon",(uint)(iVar2 != 0));
      pcVar1 = (char *)KeyValues::GetString
                                 ((KeyValues *)0x0,"DisplayTitle","#L4D360UI_Campaign_Any");
      KeyValues::SetString(param_2,"DisplayTitle",pcVar1);
      pcVar1 = (char *)KeyValues::GetString((KeyValues *)0x0,"Author","");
      KeyValues::SetString(param_2,"Author",pcVar1);
      pcVar1 = (char *)KeyValues::GetString((KeyValues *)0x0,"Website","");
      KeyValues::SetString(param_2,"Website",pcVar1);
      pcVar1 = (char *)KeyValues::GetString((KeyValues *)0x0,"CfgFile","");
      KeyValues::SetString(param_2,"MissionFile",pcVar1);
      uVar3 = KeyValues::GetUint64((char *)0x0,0xafd0a);
      KeyValues::SetUint64((char *)param_2,CONCAT44(uVar3,"workshopid"));
      iVar2 = KeyValues::GetInt((KeyValues *)0x0,"infectedonly",0);
      KeyValues::SetInt(param_2,"InfectedOnly",(uint)(iVar2 != 0));
      iVar2 = KeyValues::GetInt((KeyValues *)0x0,"survivor_set",2);
      KeyValues::SetInt(param_2,"SurvivorSet",iVar2);
    }
    else {
      this_00 = (KeyValues *)0x0;
      this = (KeyValues *)(*(code *)**(undefined4 **)g_pMatchExtL4D)(g_pMatchExtL4D);
      if (this != (KeyValues *)0x0) {
        this_00 = (KeyValues *)KeyValues::FindKey(this,param_1,false);
      }
      pcVar1 = (char *)KeyValues::GetString(this_00,"Version","");
      KeyValues::SetString(param_2,"Version",pcVar1);
      pcVar1 = (char *)KeyValues::GetString(this_00,"BuiltIn","1");
      KeyValues::SetString(param_2,"BuiltIn",pcVar1);
      iVar2 = KeyValues::GetInt(this_00,"addon",1);
      KeyValues::SetInt(param_2,"addon",(uint)(iVar2 != 0));
      pcVar1 = (char *)KeyValues::GetString(this_00,"DisplayTitle","");
      KeyValues::SetString(param_2,"DisplayTitle",pcVar1);
      pcVar1 = (char *)KeyValues::GetString(this_00,"Author","");
      KeyValues::SetString(param_2,"Author",pcVar1);
      pcVar1 = (char *)KeyValues::GetString(this_00,"Website","");
      KeyValues::SetString(param_2,"Website",pcVar1);
      pcVar1 = (char *)KeyValues::GetString(this_00,"CfgFile","");
      KeyValues::SetString(param_2,"MissionFile",pcVar1);
      uVar3 = KeyValues::GetUint64((char *)this_00,0xafd0a);
      KeyValues::SetUint64((char *)param_2,CONCAT44(uVar3,"workshopid"));
      iVar2 = KeyValues::GetInt(this_00,"infectedonly",0);
      KeyValues::SetInt(param_2,"InfectedOnly",(uint)(iVar2 != 0));
      iVar2 = KeyValues::GetInt(this_00,"survivor_set",2);
      iVar4 = KeyValues::GetInt(param_3,"Game/MissionInfo/SurvivorSet",0);
      if (iVar2 != iVar4) {
        KeyValues::SetInt(param_2,"SurvivorSet",iVar2);
        return;
      }
    }
  }
  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)