L L4D2node

CServerGameClients::ClientSettingsChanged

0x006c6330 · 1190 bytes · __thiscall

_ZN18CServerGameClients21ClientSettingsChangedEP7edict_t

Decompiled

undefined (2 params)

/* CServerGameClients::ClientSettingsChanged(edict_t*) */

void __thiscall CServerGameClients::ClientSettingsChanged(CServerGameClients *this,edict_t *param_1)

{
  float fVar1;
  float fVar2;
  int *piVar3;
  int iVar4;
  int iVar5;
  char *pcVar6;
  undefined4 uVar7;
  bool bVar8;
  longdouble lVar9;
  float fVar10;
  float local_10;
  
  piVar3 = *(int **)(param_1 + 0xc);
  if ((piVar3 != (int *)0x0) && (iVar4 = (**(code **)(*piVar3 + 0x18))(piVar3), iVar4 != 0)) {
    if (*(int *)(iVar4 + 0x30) == 0) {
      iVar5 = 0;
    }
    else {
      iVar5 = *(int *)(iVar4 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
    }
    pcVar6 = (char *)(**(code **)(*engine + 0xe0))(engine,iVar5,"cl_updaterate");
    uVar7 = V_atoi(pcVar6);
    bVar8 = ClientSettingsChanged(edict_t*)::pMinUpdateRate == '\0';
    *(undefined4 *)(iVar4 + 0x1cec) = uVar7;
    if ((bVar8) &&
       (iVar5 = __cxa_guard_acquire(&ClientSettingsChanged(edict_t*)::pMinUpdateRate), iVar5 != 0))
    {
                    /* try { // try from 006c66d6 to 006c66d8 has its CatchHandler @ 006c6879 */
      ClientSettingsChanged(edict_t*)::pMinUpdateRate =
           (**(code **)(*g_pCVar + 0x30))(g_pCVar,"sv_minupdaterate");
      __cxa_guard_release(&ClientSettingsChanged(edict_t*)::pMinUpdateRate);
    }
    if ((ClientSettingsChanged(edict_t*)::pMaxUpdateRate == '\0') &&
       (iVar5 = __cxa_guard_acquire(&ClientSettingsChanged(edict_t*)::pMaxUpdateRate), iVar5 != 0))
    {
                    /* try { // try from 006c6696 to 006c6698 has its CatchHandler @ 006c6863 */
      ClientSettingsChanged(edict_t*)::pMaxUpdateRate =
           (**(code **)(*g_pCVar + 0x30))(g_pCVar,"sv_maxupdaterate");
      __cxa_guard_release(&ClientSettingsChanged(edict_t*)::pMaxUpdateRate);
    }
    if ((ClientSettingsChanged(edict_t*)::pMinUpdateRate != 0) &&
       (ClientSettingsChanged(edict_t*)::pMaxUpdateRate != 0)) {
      fVar10 = (float)*(int *)(iVar4 + 0x1cec);
      fVar1 = *(float *)(*(int *)(ClientSettingsChanged(edict_t*)::pMaxUpdateRate + 0x1c) + 0x2c);
      if ((fVar10 <= fVar1) &&
         (fVar2 = *(float *)(*(int *)(ClientSettingsChanged(edict_t*)::pMinUpdateRate + 0x1c) + 0x2c
                            ), fVar1 = fVar10, fVar10 < fVar2)) {
        fVar1 = fVar2;
      }
      *(int *)(iVar4 + 0x1cec) = (int)fVar1;
    }
    if (*(int *)(iVar4 + 0x30) == 0) {
      iVar5 = 0;
    }
    else {
      iVar5 = *(int *)(iVar4 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
    }
    pcVar6 = (char *)(**(code **)(*engine + 0xe0))(engine,iVar5,"cl_interpolate");
    iVar5 = V_atoi(pcVar6);
    if (iVar5 == 0) {
      *(undefined4 *)(iVar4 + 0x1cf0) = 0;
    }
    else {
      if (*(int *)(iVar4 + 0x30) == 0) {
        iVar5 = 0;
      }
      else {
        iVar5 = *(int *)(iVar4 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
      }
      pcVar6 = (char *)(**(code **)(*engine + 0xe0))(engine,iVar5,"cl_interp_ratio");
      lVar9 = (longdouble)V_atof(pcVar6);
      local_10 = (float)lVar9;
      if (local_10 == 0.0) {
        local_10 = 1.0;
      }
      if (*(int *)(iVar4 + 0x30) == 0) {
        iVar5 = 0;
      }
      else {
        iVar5 = *(int *)(iVar4 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
      }
      pcVar6 = (char *)(**(code **)(*engine + 0xe0))(engine,iVar5,"cl_interp");
      lVar9 = (longdouble)V_atof(pcVar6);
      if ((ClientSettingsChanged(edict_t*)::pMin == '\0') &&
         (iVar5 = __cxa_guard_acquire(&ClientSettingsChanged(edict_t*)::pMin), iVar5 != 0)) {
                    /* try { // try from 006c67e6 to 006c67e8 has its CatchHandler @ 006c6837 */
        ClientSettingsChanged(edict_t*)::pMin =
             (**(code **)(*g_pCVar + 0x30))(g_pCVar,"sv_client_min_interp_ratio");
        __cxa_guard_release(&ClientSettingsChanged(edict_t*)::pMin);
      }
      if ((ClientSettingsChanged(edict_t*)::pMax == '\0') &&
         (iVar5 = __cxa_guard_acquire(&ClientSettingsChanged(edict_t*)::pMax), iVar5 != 0)) {
                    /* try { // try from 006c67a6 to 006c67a8 has its CatchHandler @ 006c684d */
        ClientSettingsChanged(edict_t*)::pMax =
             (**(code **)(*g_pCVar + 0x30))(g_pCVar,"sv_client_max_interp_ratio");
        __cxa_guard_release(&ClientSettingsChanged(edict_t*)::pMax);
      }
      if (((ClientSettingsChanged(edict_t*)::pMin == 0) ||
          (ClientSettingsChanged(edict_t*)::pMax == 0)) ||
         (fVar1 = *(float *)(*(int *)(ClientSettingsChanged(edict_t*)::pMin + 0x1c) + 0x2c),
         fVar1 == -1.0)) {
        fVar10 = 1.0;
        if (local_10 != 0.0) {
          fVar10 = local_10;
        }
      }
      else {
        fVar10 = *(float *)(*(int *)(ClientSettingsChanged(edict_t*)::pMax + 0x1c) + 0x2c);
        if ((local_10 <= fVar10) && (fVar10 = local_10, local_10 <= fVar1)) {
          fVar10 = fVar1;
        }
      }
      fVar10 = fVar10 / (float)*(int *)(iVar4 + 0x1cec);
      if (fVar10 <= (float)lVar9) {
        fVar10 = (float)lVar9;
      }
      *(float *)(iVar4 + 0x1cf0) = fVar10;
    }
    if (*(int *)(iVar4 + 0x30) == 0) {
      iVar5 = 0;
    }
    else {
      iVar5 = *(int *)(iVar4 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
    }
    pcVar6 = (char *)(**(code **)(*engine + 0xe0))(engine,iVar5,"cl_predict");
    iVar5 = V_atoi(pcVar6);
    if (iVar5 == 0) {
      *(undefined1 *)(iVar4 + 0x1cf5) = 0;
      *(undefined1 *)(iVar4 + 0x1cf4) = 0;
    }
    else {
      if (*(int *)(iVar4 + 0x30) == 0) {
        iVar5 = 0;
      }
      else {
        iVar5 = *(int *)(iVar4 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
      }
      pcVar6 = (char *)(**(code **)(*engine + 0xe0))(engine,iVar5,"cl_predictweapons");
      iVar5 = V_atoi(pcVar6);
      piVar3 = engine;
      *(bool *)(iVar4 + 0x1cf5) = iVar5 != 0;
      if (*(int *)(iVar4 + 0x30) == 0) {
        iVar5 = 0;
      }
      else {
        iVar5 = *(int *)(iVar4 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
      }
      pcVar6 = (char *)(**(code **)(*piVar3 + 0xe0))(piVar3,iVar5,"cl_lagcompensation");
      iVar5 = V_atoi(pcVar6);
      *(bool *)(iVar4 + 0x1cf4) = iVar5 != 0;
    }
                    /* WARNING: Could not recover jumptable at 0x006c6529. Too many branches */
                    /* WARNING: Treating indirect jump as call */
    (**(code **)(*g_pGameRules + 0x130))();
    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)