L L4D2node

log

0x001faa90 · 514 bytes · __cdecl

_ZL3logRK8CCommand

Decompiled

undefined (1 param)

/* log(CCommand const&) */

void log(CCommand *param_1)

{
  int iVar1;
  char *pcVar2;
  undefined1 *puVar3;
  
  if (*(int *)param_1 == 2) {
    iVar1 = _V_stricmp(*(char **)(param_1 + 0x40c),"off");
    if (iVar1 != 0) {
      pcVar2 = "";
      if (1 < *(int *)param_1) {
        pcVar2 = *(char **)(param_1 + 0x40c);
      }
      iVar1 = _V_stricmp(pcVar2,"0");
      if (iVar1 != 0) {
        pcVar2 = "";
        if (1 < *(int *)param_1) {
          pcVar2 = *(char **)(param_1 + 0x40c);
        }
        iVar1 = _V_stricmp(pcVar2,"on");
        if (iVar1 != 0) {
          pcVar2 = "";
          if (1 < *(int *)param_1) {
            pcVar2 = *(char **)(param_1 + 0x40c);
          }
          iVar1 = _V_stricmp(pcVar2,"1");
          if (iVar1 != 0) {
            puVar3 = &DAT_002c79d4;
            if (1 < *(int *)param_1) {
              puVar3 = *(undefined1 **)(param_1 + 0x40c);
            }
            ConMsg("log:  unknown parameter %s, \'on\' and \'off\' are valid\n",puVar3);
            return;
          }
        }
        g_Log[8] = 1;
        ConMsg("Server logging enabled.\n");
        CLog::Open((CLog *)g_Log);
        return;
      }
    }
    if (g_Log[8] == '\0') {
      return;
    }
    CLog::Close((CLog *)g_Log);
    g_Log[8] = 0;
    ConMsg("Server logging disabled.\n");
    return;
  }
  ConMsg("Usage:  log < on | off >\n");
  if (g_Log[8] == '\0') {
    ConMsg("not currently logging\n");
    return;
  }
  ConMsg("currently logging to: ");
  if (*(int *)(sv_logfile._28_4_ + 0x30) == 0) {
    if (*(int *)(sv_logecho._28_4_ + 0x30) == 0) {
      if ((int)g_Log._24_4_ < 1) {
        ConMsg("no destinations! (file, console, or udp)\n");
        ConMsg("check \"sv_logfile\", \"sv_logecho\", and \"logaddress_list\"");
      }
      else {
        ConMsg("udp");
      }
      goto LAB_001faafc;
    }
    ConMsg("console");
  }
  else {
    ConMsg("file");
    if (*(int *)(sv_logecho._28_4_ + 0x30) != 0) {
      ConMsg(", console");
    }
  }
  if (0 < (int)g_Log._24_4_) {
    ConMsg(", udp");
  }
LAB_001faafc:
  ConMsg("\n");
  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)