L L4D2node

CHLTVClient::ProcessSetConVar

0x00169600 · 409 bytes · __cdecl

_ZN11CHLTVClient16ProcessSetConVarEP13NET_SetConVar

Decompiled

undefined (1 param)

/* CHLTVClient::ProcessSetConVar(NET_SetConVar*) */

NET_SetConVar CHLTVClient::ProcessSetConVar(NET_SetConVar *param_1)

{
  code *pcVar1;
  NET_SetConVar NVar2;
  char cVar3;
  int iVar4;
  char *pcVar5;
  undefined4 uVar6;
  NET_SetConVar NVar7;
  
  NVar2 = (NET_SetConVar)CBaseClient::ProcessSetConVar(param_1);
  if (NVar2 == (NET_SetConVar)0x0) {
    return (NET_SetConVar)0x0;
  }
  if (*(int *)(param_1 + 0xec) != 2) {
    return NVar2;
  }
  iVar4 = KeyValues::GetInt(*(KeyValues **)(param_1 + 0xb0),"tv_relay",0);
  NVar7 = (NET_SetConVar)(iVar4 != 0);
  param_1[0xbc] = NVar7;
  if ((bool)NVar7) {
    pcVar5 = "FCVAR_NEVER_AS_STRING";
    if ((tv_relaypassword[0x15] & 0x10) == 0) {
      pcVar5 = "";
      if (*(char **)(tv_relaypassword._28_4_ + 0x24) != (char *)0x0) {
        pcVar5 = *(char **)(tv_relaypassword._28_4_ + 0x24);
      }
    }
    if (*pcVar5 == '\0') {
      return NVar7;
    }
    iVar4 = _V_stricmp(pcVar5,"none");
    if (iVar4 == 0) {
      return NVar7;
    }
    iVar4 = _V_stricmp((char *)(param_1 + 0x1d710),pcVar5);
    if (iVar4 == 0) {
      return NVar2;
    }
    (**(code **)(*(int *)param_1 + 0x3c))(param_1,"Bad relay password");
  }
  else {
    cVar3 = CHLTVServer::DispatchToRelay
                      (*(CHLTVServer **)(param_1 + 0x1d79c),(CHLTVClient *)param_1);
    if (cVar3 == '\0') {
      pcVar5 = (char *)(**(code **)(**(int **)(param_1 + 0x1d79c) + 0x34))
                                 (*(int **)(param_1 + 0x1d79c));
      if ((pcVar5 != (char *)0x0) &&
         (iVar4 = _V_stricmp((char *)(param_1 + 0x1d710),pcVar5), iVar4 != 0)) {
        (**(code **)(*(int *)param_1 + 0x3c))(param_1,"Bad spectator password");
        return (NET_SetConVar)0x0;
      }
      pcVar1 = *(code **)(*(int *)(*(int *)(param_1 + 0x1d79c) + 4) + 200);
      uVar6 = (**(code **)(**(int **)(param_1 + 0xe8) + 200))(*(int **)(param_1 + 0xe8));
      cVar3 = (*pcVar1)(*(int *)(param_1 + 0x1d79c) + 4,uVar6,2);
      if (cVar3 != '\0') {
        return NVar2;
      }
      (**(code **)(*(int *)param_1 + 0x3c))
                (param_1,"SourceTV server is restricted to local spectators (class C).\n");
      return (NET_SetConVar)0x0;
    }
  }
  return (NET_SetConVar)0x0;
}

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)