L L4D2node

CServerManager::UpdateLanSearch

0x0005a390 · 550 bytes · __thiscall

_ZN14CServerManager15UpdateLanSearchEv

Decompiled

undefined (1 param)

/* CServerManager::UpdateLanSearch() */

void __thiscall CServerManager::UpdateLanSearch(CServerManager *this)

{
  KeyValues *this_00;
  char *pcVar1;
  int iVar2;
  int iVar3;
  int in_GS_OFFSET;
  longdouble lVar4;
  uint in_stack_fffffe98;
  int local_144 [3];
  int local_138;
  CFmtStrN<256> local_12c [5];
  undefined1 local_127 [263];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if ((*(float *)(this + 0x40) == 0.0) || (*(float *)(this + 0x44) == 0.0)) {
    lVar4 = (longdouble)Plat_FloatTime();
    *(float *)(this + 0x40) = (float)lVar4;
  }
  else {
    lVar4 = (longdouble)Plat_FloatTime();
    if (*(float *)(mm_server_search_lan_ping_duration._28_4_ + 0x2c) + *(float *)(this + 0x40) <
        (float)lVar4) {
      *(undefined4 *)(this + 0x3c) = 2;
      goto LAB_0005a511;
    }
    lVar4 = (longdouble)Plat_FloatTime();
    if ((float)lVar4 <
        *(float *)(mm_server_search_lan_ping_interval._28_4_ + 0x2c) + *(float *)(this + 0x44))
    goto LAB_0005a511;
  }
  lVar4 = (longdouble)Plat_FloatTime();
  *(float *)(this + 0x44) = (float)lVar4;
  this_00 = KeyValues::operator_new((KeyValues *)0x2c,in_stack_fffffe98);
                    /* try { // try from 0005a426 to 0005a42a has its CatchHandler @ 0005a5c3 */
  KeyValues::KeyValues(this_00,"LanSearchServerPing",(IKeyValuesSystem *)0x0,false);
                    /* try { // try from 0005a42b to 0005a487 has its CatchHandler @ 0005a5f9 */
  lVar4 = (longdouble)Plat_FloatTime();
  KeyValues::SetFloat(this_00,"timestamp",(float)lVar4);
  if ((mm_server_search_lan_ports[0x15] & 0x10) == 0) {
    pcVar1 = *(char **)(mm_server_search_lan_ports._28_4_ + 0x24);
    if ((pcVar1 != (char *)0x0) && (*pcVar1 != '\0')) goto LAB_0005a46e;
  }
  else {
    pcVar1 = "FCVAR_NEVER_AS_STRING";
LAB_0005a46e:
    CSplitString::CSplitString((CSplitString *)local_144,pcVar1,",");
    iVar3 = 0;
    if (0 < local_138) {
      do {
                    /* try { // try from 0005a4ac to 0005a4eb has its CatchHandler @ 0005a5d5 */
        iVar2 = V_atoi(*(char **)(local_144[0] + iVar3 * 4));
        if (0 < iVar2) {
          CFmtStrN<256>::CFmtStrN(local_12c,"*:%d",iVar2);
          CConnectionlessLanMgr::SendPacket
                    ((CConnectionlessLanMgr *)g_pConnectionlessLanMgr,this_00,local_127,0);
        }
        iVar3 = iVar3 + 1;
      } while (iVar3 < local_138);
    }
    CSplitString::~CSplitString((CSplitString *)local_144);
  }
  if (this_00 != (KeyValues *)0x0) {
    KeyValues::deleteThis();
  }
LAB_0005a511:
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  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)