L L4D2node

CHLTVDirector::SetHLTVServer

0x006dbe20 · 384 bytes · __thiscall

_ZN13CHLTVDirector13SetHLTVServerEP11IHLTVServer

Decompiled

undefined (2 params)

/* CHLTVDirector::SetHLTVServer(IHLTVServer*) */

void __thiscall CHLTVDirector::SetHLTVServer(CHLTVDirector *this,IHLTVServer *param_1)

{
  int *piVar1;
  int iVar2;
  
  RemoveEventsFromHistory(this,-1);
  if (param_1 != (IHLTVServer *)0x0) {
    iVar2 = (**(code **)(*(int *)param_1 + 0x10))(param_1);
    iVar2 = UTIL_PlayerByIndex(iVar2 + 1);
    *(int *)(this + 0x34) = iVar2;
    if ((iVar2 == 0) || (*(char *)(iVar2 + 0x1ca4) == '\0')) {
      *(undefined4 *)(this + 0x14) = 0;
      Error("Couldn\'t find HLTV client player.");
    }
    else {
      *(IHLTVServer **)(this + 0x14) = param_1;
    }
    piVar1 = gameeventmanager;
    this[8] = (CHLTVDirector)0x1;
    (**(code **)(*piVar1 + 0x10))(piVar1,this,"player_hurt",1);
    piVar1 = gameeventmanager;
    this[8] = (CHLTVDirector)0x1;
    (**(code **)(*piVar1 + 0x10))(piVar1,this,"player_death",1);
    piVar1 = gameeventmanager;
    this[8] = (CHLTVDirector)0x1;
    (**(code **)(*piVar1 + 0x10))(piVar1,this,"round_end",1);
    piVar1 = gameeventmanager;
    this[8] = (CHLTVDirector)0x1;
    (**(code **)(*piVar1 + 0x10))(piVar1,this,"round_start",1);
    piVar1 = gameeventmanager;
    this[8] = (CHLTVDirector)0x1;
    (**(code **)(*piVar1 + 0x10))(piVar1,this,"hltv_cameraman",1);
    piVar1 = gameeventmanager;
    this[8] = (CHLTVDirector)0x1;
    (**(code **)(*piVar1 + 0x10))(piVar1,this,"hltv_rank_entity",1);
    piVar1 = gameeventmanager;
    this[8] = (CHLTVDirector)0x1;
    (**(code **)(*piVar1 + 0x10))(piVar1,this,"hltv_rank_camera",1);
    return;
  }
  *(undefined4 *)(this + 0x14) = 0;
  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)