L L4D2node

CBaseServer::SetReservationCookie

0x0010e2a0 · 264 bytes · __cdecl

_ZN11CBaseServer20SetReservationCookieEyPKcz

Decompiled

undefined (2 params)

/* CBaseServer::SetReservationCookie(unsigned long long, char const*, ...) */

void CBaseServer::SetReservationCookie(ulonglong param_1,char *param_2,...)

{
  uint uVar1;
  int iVar2;
  char *pcVar3;
  int in_GS_OFFSET;
  char *in_stack_00000010;
  undefined1 *puVar4;
  Color local_124;
  undefined1 local_123;
  undefined1 local_122;
  undefined1 local_121;
  char local_120 [256];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (*(char **)((CBaseServer *)param_1 + 0x170) != param_2 ||
      param_1._4_4_ != *(int *)((CBaseServer *)param_1 + 0x16c)) {
    pcVar3 = local_120;
    for (iVar2 = 0x40; iVar2 != 0; iVar2 = iVar2 + -1) {
      pcVar3[0] = '\0';
      pcVar3[1] = '\0';
      pcVar3[2] = '\0';
      pcVar3[3] = '\0';
      pcVar3 = pcVar3 + 4;
    }
    V_vsnprintf(local_120,0x100,in_stack_00000010,&stack0x00000014);
    local_124 = (Color)0xff;
    local_123 = 0;
    local_122 = 0xff;
    local_121 = 0xff;
    ConColorMsg(&local_124,"-> Reservation cookie %llx:  reason %s\n",param_1._4_4_,param_2,
                local_120);
  }
  *(char **)((CBaseServer *)param_1 + 0x170) = param_2;
  *(int *)((CBaseServer *)param_1 + 0x16c) = param_1._4_4_;
  UpdateGameType((CBaseServer *)param_1);
  puVar4 = sv_hosting_lobby;
  uVar1 = (uint)(*(int *)((CBaseServer *)param_1 + 0x16c) != 0 ||
                *(int *)((CBaseServer *)param_1 + 0x170) != 0);
  ConVar::SetValue(0x350a00);
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail(puVar4,uVar1);
}

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)