L L4D2node

CBaseServer::CheckChallengeNr

0x0010a880 · 353 bytes · __thiscall

_ZN11CBaseServer16CheckChallengeNrER8netadr_si

Decompiled

undefined (3 params)

/* CBaseServer::CheckChallengeNr(netadr_s&, int) */

char __thiscall CBaseServer::CheckChallengeNr(CBaseServer *this,netadr_s *param_1,int param_2)

{
  int iVar1;
  char cVar2;
  char cVar3;
  undefined4 uVar4;
  int iVar5;
  
  cVar2 = netadr_s::IsLoopback(param_1);
  if (cVar2 == '\0') {
    iVar5 = 0;
    if (0 < *(int *)(this + 0x138)) {
      do {
        while( true ) {
          iVar1 = iVar5 * 0x14;
          cVar3 = netadr_s::CompareAdr(param_1,(netadr_s *)(*(int *)(this + 300) + iVar1),true);
          if (cVar3 != '\0') {
            if (param_2 != *(int *)(*(int *)(this + 300) + iVar1 + 0xc)) {
              return '\0';
            }
            if (net_time <= (double)(*(float *)(*(int *)(this + 300) + iVar1 + 0x10) + 3600.0)) {
              return cVar3;
            }
            CUtlVector<challenge_t,CUtlMemory<challenge_t,int>>::FastRemove
                      ((CUtlVector<challenge_t,CUtlMemory<challenge_t,int>> *)(this + 300),iVar5);
            uVar4 = netadr_s::ToString(param_1,false);
            ConMsg("Old challenge from %s.\n",uVar4);
            return '\0';
          }
          if (net_time <= (double)(*(float *)(*(int *)(this + 300) + 0x10 + iVar1) + 3600.0)) break;
          CUtlVector<challenge_t,CUtlMemory<challenge_t,int>>::FastRemove
                    ((CUtlVector<challenge_t,CUtlMemory<challenge_t,int>> *)(this + 300),iVar5);
          if (*(int *)(this + 0x138) <= iVar5) goto LAB_0010a93d;
        }
        iVar5 = iVar5 + 1;
      } while (iVar5 < *(int *)(this + 0x138));
    }
LAB_0010a93d:
    if (param_2 != -1) {
      uVar4 = netadr_s::ToString(param_1,false);
      ConDMsg("No challenge from %s.\n",uVar4);
    }
  }
  return cVar2;
}

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)