L L4D2node

CServerManager::RemoveOldServers

0x0005a600 · 143 bytes · __thiscall

_ZN14CServerManager16RemoveOldServersEv

Decompiled

undefined (1 param)

/* CServerManager::RemoveOldServers() */

void __thiscall CServerManager::RemoveOldServers(CServerManager *this)

{
  int iVar1;
  int iVar2;
  longdouble lVar3;
  
  lVar3 = (longdouble)Plat_FloatTime();
  iVar2 = 0;
  if (0 < *(int *)(this + 0x20)) {
    do {
      while ((iVar1 = *(int *)(*(int *)(this + 0x14) + iVar2 * 4), iVar1 != 0 &&
             ((float)lVar3 - *(float *)(iVar1 + 4) <
              *(float *)(mm_server_search_server_lifetime._28_4_ + 0x2c)))) {
        iVar2 = iVar2 + 1;
        if (*(int *)(this + 0x20) <= iVar2) {
          return;
        }
      }
      CUtlVector<CServer*,CUtlMemory<CServer*,int>>::ShiftElementsLeft
                ((CUtlVector<CServer*,CUtlMemory<CServer*,int>> *)(this + 0x14),iVar2,1);
      iVar1 = *(int *)(this + 0x20);
      *(int *)(this + 0x20) = iVar1 + -1;
    } while (iVar2 < iVar1 + -1);
  }
  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)