L L4D2node

CBaseServer::UpdateGameType

0x0010e010 · 577 bytes · __thiscall

_ZN11CBaseServer14UpdateGameTypeEv

Decompiled

undefined (1 param)

/* CBaseServer::UpdateGameType() */

void __thiscall CBaseServer::UpdateGameType(CBaseServer *this)

{
  CUtlString *this_00;
  int *piVar1;
  code *pcVar2;
  char cVar3;
  char *pcVar4;
  uint uVar5;
  undefined4 uVar6;
  int iVar7;
  int in_GS_OFFSET;
  byte bVar8;
  CUtlString local_430 [16];
  char local_420 [1024];
  int local_20;
  
  bVar8 = 0;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  this_00 = (CUtlString *)(this + 0x180);
  CUtlString::operator=(this_00,"");
  CUtlString::CUtlString(local_430);
  if (serverGameDLL != (int *)0x0) {
    pcVar4 = local_420;
    for (iVar7 = 0x100; iVar7 != 0; iVar7 = iVar7 + -1) {
      pcVar4[0] = '\0';
      pcVar4[1] = '\0';
      pcVar4[2] = '\0';
      pcVar4[3] = '\0';
      pcVar4 = pcVar4 + ((uint)bVar8 * -2 + 1) * 4;
    }
                    /* try { // try from 0010e07e to 0010e21f has its CatchHandler @ 0010e292 */
    (**(code **)(*serverGameDLL + 0x98))(serverGameDLL,local_420,0x400);
    if (local_420[0] != '\0') {
      AddTagString(this,this_00,local_420);
    }
  }
  iVar7 = GetNumHumanPlayers(this);
  if (iVar7 < 1) {
                    /* try { // try from 0010e25f to 0010e263 has its CatchHandler @ 0010e292 */
    AddTagString(this,this_00,"empty");
  }
  if (UpdateGameType()::var == '\0') {
    iVar7 = __cxa_guard_acquire(&UpdateGameType()::var);
    if (iVar7 != 0) {
                    /* try { // try from 0010e237 to 0010e23b has its CatchHandler @ 0010e26e */
      ConVarRef::ConVarRef((ConVarRef *)&UpdateGameType()::var,"sv_tags");
      __cxa_guard_release(&UpdateGameType()::var);
    }
  }
  cVar3 = ConVarRef::IsValid((ConVarRef *)&UpdateGameType()::var);
  if ((cVar3 != '\0') && (**(char **)(UpdateGameType()::var._4_4_ + 0x24) != '\0')) {
    AddTagString(this,this_00,*(char **)(UpdateGameType()::var._4_4_ + 0x24));
  }
  iVar7 = Steam3Server();
  piVar1 = *(int **)(iVar7 + 4);
  if (piVar1 != (int *)0x0) {
    cVar3 = (**(code **)(*piVar1 + 0x24))(piVar1);
    if (cVar3 != '\0') {
      pcVar4 = "secure";
      goto LAB_0010e100;
    }
  }
  pcVar4 = "insecure";
LAB_0010e100:
  AddTagString(this,this_00,pcVar4);
  uVar5 = CUtlString::Length(this_00);
  if (uVar5 < 0x40) {
    UpdateGameType()::didWarnLength = '\0';
  }
  else {
    pcVar4 = (char *)CUtlString::Get(this_00);
    V_strncpy(local_420,pcVar4,0x40);
    CUtlString::operator=(this_00,local_420);
    if (UpdateGameType()::didWarnLength == '\0') {
      uVar6 = CUtlString::Get(this_00);
      Warning("Tags string is too long: %s\n",uVar6);
      UpdateGameType()::didWarnLength = '\x01';
    }
  }
  iVar7 = Steam3Server();
  if (*(int *)(iVar7 + 4) != 0) {
    iVar7 = Steam3Server();
    piVar1 = *(int **)(iVar7 + 4);
    pcVar2 = *(code **)(*piVar1 + 0x54);
    uVar6 = CUtlString::Get(this_00);
    (*pcVar2)(piVar1,uVar6);
  }
  CUtlMemory<unsigned_char,int>::Purge((CUtlMemory<unsigned_char,int> *)local_430);
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

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)