L L4D2node

Cbuf_InsertText

0x00116ea0 · 132 bytes · __cdecl

_Z15Cbuf_InsertText16ECommandTarget_tPKci

Decompiled

undefined (3 params)

/* Cbuf_InsertText(ECommandTarget_t, char const*, int) */

uint Cbuf_InsertText(undefined4 param_1,undefined4 param_2,undefined4 param_3)

{
  uint uVar1;
  uint uVar2;
  bool bVar3;
  
  uVar2 = ThreadGetCurrentId();
  if (uVar2 != s_CommandBufferMutex) {
    LOCK();
    bVar3 = s_CommandBufferMutex != 0;
    uVar1 = uVar2;
    if (bVar3) {
      uVar1 = s_CommandBufferMutex;
    }
    s_CommandBufferMutex = uVar1;
    UNLOCK();
    if (bVar3) {
      CThreadFastMutex::Lock(0x3887e8,uVar2);
      goto LAB_00116ecf;
    }
  }
  DAT_003887ec = DAT_003887ec + 1;
LAB_00116ecf:
                    /* try { // try from 00116ee3 to 00116ee7 has its CatchHandler @ 00116f2c */
  Cbuf_AddText(param_1,param_2,param_3);
  uVar2 = s_CommandBufferMutex;
  DAT_003887ec = DAT_003887ec - 1;
  if (DAT_003887ec == 0) {
    LOCK();
    s_CommandBufferMutex = DAT_003887ec;
    UNLOCK();
    return uVar2;
  }
  return DAT_003887ec;
}

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)