L L4D2node

CGameServer::FinishCertificateCheck

0x001fbbf0 · 303 bytes · __thiscall

_ZN11CGameServer22FinishCertificateCheckER8netadr_siPKc

Decompiled

undefined (4 params)

/* CGameServer::FinishCertificateCheck(netadr_s&, int, char const*) */

char __thiscall
CGameServer::FinishCertificateCheck(CGameServer *this,netadr_s *param_1,int param_2,char *param_3)

{
  int *piVar1;
  char cVar2;
  char cVar3;
  int iVar4;
  int iVar5;
  char *pcVar6;
  int local_24;
  
  if (param_2 != 2) {
    if (param_2 == 3) {
      return '\x01';
    }
    (**(code **)(*(int *)this + 0xc4))(this,param_1,"Authentication disabled!!!\n");
    return '\0';
  }
  cVar2 = UseCDKeyAuth();
  if (cVar2 != '\0') {
    iVar4 = _V_strlen(param_3);
    if (iVar4 == 0x20) {
      local_24 = 0;
      for (iVar4 = 0; iVar5 = (**(code **)(*(int *)this + 0x20))(this), iVar4 < iVar5;
          iVar4 = iVar4 + 1) {
        piVar1 = *(int **)(*(int *)(this + 0x114) + iVar4 * 4);
        cVar3 = (**(code **)(*piVar1 + 0x6c))(piVar1);
        if (cVar3 != '\0') {
          iVar5 = V_strnicmp(param_3,(char *)(piVar1 + 0x17),0x20);
          local_24 = local_24 + (uint)(iVar5 == 0);
        }
      }
      if (local_24 < 5) {
        return cVar2;
      }
      iVar4 = *(int *)this;
      pcVar6 = "#Valve_Reject_CD_Key_In_Use";
    }
    else {
      iVar4 = *(int *)this;
      pcVar6 = "#Valve_Reject_Invalid_CD_Key";
    }
    (**(code **)(iVar4 + 0xc4))(this,param_1,pcVar6);
    return '\0';
  }
  (**(code **)(*(int *)this + 0xc4))(this,param_1,"#Valve_Reject_CD_Key_Auth_Invalid");
  return '\0';
}

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)