L L4D2node

CNetConsoleMgr::Execute

0x001a26c0 · 226 bytes · __thiscall

_ZN14CNetConsoleMgr7ExecuteEP24CConnectedNetConsoleData

Decompiled

undefined (2 params)

/* CNetConsoleMgr::Execute(CConnectedNetConsoleData*) */

void __thiscall CNetConsoleMgr::Execute(CNetConsoleMgr *this,CConnectedNetConsoleData *param_1)

{
  int iVar1;
  
  iVar1 = memcmp(param_1 + 8,"PASS ",5);
  if (iVar1 == 0) {
    iVar1 = _V_strcmp((char *)(param_1 + 0xd),(char *)(this + 0x2c));
    if (iVar1 == 0) {
      param_1[0x808] = (CConnectedNetConsoleData)0x1;
      return;
    }
    Warning("Bad password attempt from net console\n");
    param_1[0x808] = (CConnectedNetConsoleData)0x0;
  }
  else {
    if (param_1[0x808] != (CConnectedNetConsoleData)0x0) {
      Cbuf_AddText(4,param_1 + 8,0);
      Cbuf_AddText(4,"\n",0);
      Cbuf_Execute();
      return;
    }
    send(*(int *)param_1,
         "This server is password protected for console access. Must send PASS command\n\r",0x4e,
         0x4000);
  }
  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)