L L4D2node

CServerManager::RequestPingingDetails

0x0005a6a0 · 460 bytes · __thiscall

_ZN14CServerManager21RequestPingingDetailsEv

Decompiled

undefined (1 param)

/* CServerManager::RequestPingingDetails() */

void __thiscall CServerManager::RequestPingingDetails(CServerManager *this)

{
  int *piVar1;
  KeyValues *this_00;
  int iVar2;
  int iVar3;
  longdouble lVar4;
  uint in_stack_ffffffc8;
  char *pcVar5;
  int iVar6;
  
  this_00 = KeyValues::operator_new((KeyValues *)0x2c,in_stack_ffffffc8);
                    /* try { // try from 0005a6d6 to 0005a6da has its CatchHandler @ 0005a878 */
  KeyValues::KeyValues(this_00,"InetSearchServerDetails",(IKeyValuesSystem *)0x0,false);
  if ((0 < *(int *)(this + 0x34)) && (0 < *(int *)(mm_server_search_inet_ping_window._28_4_ + 0x30))
     ) {
    iVar2 = 0;
    do {
      piVar1 = *(int **)(*(int *)(this + 0x28) + iVar2 * 4);
      if ((float)piVar1[7] == 0.0) {
LAB_0005a721:
                    /* try { // try from 0005a721 to 0005a7c9 has its CatchHandler @ 0005a88d */
        lVar4 = (longdouble)Plat_FloatTime();
        KeyValues::SetFloat(this_00,"timestamp",(float)lVar4);
        iVar3 = piVar1[2];
        iVar6 = piVar1[3];
        pcVar5 = "pingxuid";
        KeyValues::SetUint64((char *)this_00,CONCAT44(iVar3,"pingxuid"));
        DevWarning("Cannot request internet pinging server details.\n",pcVar5,iVar3,iVar6);
        iVar3 = iVar2;
        if ((float)piVar1[7] == 0.0) {
          lVar4 = (longdouble)Plat_FloatTime();
          piVar1[7] = (int)((float)lVar4 +
                           *(float *)(mm_server_search_inet_ping_timeout._28_4_ + 0x2c));
        }
      }
      else {
                    /* try { // try from 0005a7e8 to 0005a844 has its CatchHandler @ 0005a88d */
        lVar4 = (longdouble)Plat_FloatTime();
        if ((float)lVar4 <= (float)piVar1[7]) goto LAB_0005a721;
        iVar3 = iVar2 + -1;
        CUtlVector<CServer*,CUtlMemory<CServer*,int>>::ShiftElementsLeft
                  ((CUtlVector<CServer*,CUtlMemory<CServer*,int>> *)(this + 0x28),iVar2,1);
        *(int *)(this + 0x34) = *(int *)(this + 0x34) + -1;
        (**(code **)(*piVar1 + 0x14))(piVar1);
      }
      iVar2 = iVar3 + 1;
    } while ((iVar2 < *(int *)(this + 0x34)) &&
            (iVar2 < *(int *)(mm_server_search_inet_ping_window._28_4_ + 0x30)));
  }
  lVar4 = (longdouble)Plat_FloatTime();
  *(float *)(this + 0x44) = (float)lVar4;
  DevMsg(2,"Server manager waiting for game details from %d servers...\n",
         *(undefined4 *)(this + 0x34));
  if (this_00 != (KeyValues *)0x0) {
    KeyValues::deleteThis();
    return;
  }
  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)