L L4D2node

tv_relay

0x00173340 · 241 bytes · __cdecl

_ZL8tv_relayRK8CCommand

Decompiled

undefined (1 param)

/* tv_relay(CCommand const&) */

void tv_relay(CCommand *param_1)

{
  code *pcVar1;
  undefined1 uVar2;
  int iVar3;
  CHLTVServer *this;
  CCommand *pCVar4;
  
  if (*(int *)param_1 < 2) {
    param_1 = (CCommand *)s_Usage__tv_relay_<ip:port>_002b186e;
  }
  else {
    pCVar4 = (CCommand *)&DAT_002c79d4;
    if (*(int *)(param_1 + 4) != 0) {
      pCVar4 = param_1 + *(int *)(param_1 + 4) + 8;
    }
    iVar3 = V_strncmp((char *)pCVar4,"localhost",9);
    if (iVar3 == 0) {
      ConMsg("SourceTV can\'t connect to localhost.\n");
      return;
    }
    if (hltv == (CHLTVServer *)0x0) {
      this = operator_new(0x8abc);
                    /* try { // try from 00173419 to 0017341d has its CatchHandler @ 00173449 */
      CHLTVServer::CHLTVServer(this);
      pcVar1 = *(code **)(*(int *)this + 0x10);
      hltv = this;
      uVar2 = NET_IsDedicated();
      (*pcVar1)(hltv,uVar2);
    }
    if (hltv[0x63a0] == (CHLTVServer)0x0) {
      Host_Disconnect(false);
      NET_SetMutiplayer(true);
      CHLTVServer::ConnectRelay(hltv,(char *)pCVar4);
      return;
    }
    param_1 = (CCommand *)s_SourceTV_in_Master_Only_mode__002b1a8c;
  }
  ConMsg((char *)param_1);
  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)