L L4D2node

CKickIssue::OnVoteStarted

0x00a05060 · 341 bytes · __thiscall

_ZN10CKickIssue13OnVoteStartedEv

Decompiled

undefined (1 param)

/* CKickIssue::OnVoteStarted() */

void __thiscall CKickIssue::OnVoteStarted(CKickIssue *this)

{
  char cVar1;
  CTerrorPlayer *pCVar2;
  int iVar3;
  int *piVar4;
  char *pcVar5;
  longdouble lVar6;
  double dVar7;
  CTerrorPlayer *local_10;
  
  local_10 = (CTerrorPlayer *)0x0;
  FindPlayerFromDetails(this,(char *)(this + 0x44),&local_10);
  pCVar2 = (CTerrorPlayer *)0x0;
  if (local_10 != (CTerrorPlayer *)0x0) {
    cVar1 = CTerrorPlayer::IsAwayFromKeyboard(local_10);
    pCVar2 = local_10;
    if (cVar1 == '\0') {
      iVar3 = CBaseEntity::GetTeamNumber((CBaseEntity *)local_10);
      pCVar2 = local_10;
      if (iVar3 != 1) {
        if (*(int *)(local_10 + 0x30) == 0) {
          iVar3 = 0;
        }
        else {
          iVar3 = *(int *)(local_10 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
        }
        CVoteController::TryCastVote(g_voteController,iVar3,"No");
        pCVar2 = local_10;
      }
    }
  }
  this[0x84] = (CKickIssue)0x0;
  this[0x85] = (CKickIssue)0x0;
  if (pCVar2 != (CTerrorPlayer *)0x0) {
    if (*(int *)(pCVar2 + 0x30) == 0) {
      iVar3 = 0;
    }
    else {
      iVar3 = *(int *)(pCVar2 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
    }
    piVar4 = (int *)(**(code **)(*engine + 0x54))(engine,iVar3);
    if (piVar4 == (int *)0x0) {
      dVar7 = 0.0;
    }
    else {
      cVar1 = (**(code **)(*piVar4 + 0x1c))(piVar4);
      if (cVar1 == '\0') {
        pcVar5 = (char *)CBasePlayer::GetNetworkIDString((CBasePlayer *)local_10);
        V_strncpy((char *)(this + 0x85),pcVar5,0x80);
        return;
      }
      lVar6 = (longdouble)(**(code **)(*piVar4 + 0x58))(piVar4);
      dVar7 = (double)(float)lVar6;
    }
    DevMsg("Will not ban kicked player: net channel was idle for %.2f sec.\n",dVar7);
    this[0x84] = (CKickIssue)0x1;
  }
  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)