CPlayerResource::UpdatePlayerData
0x007d63f0 · 1000 bytes · __thiscall
_ZN15CPlayerResource16UpdatePlayerDataEv
Decompiled
undefined (1 param)
/* CPlayerResource::UpdatePlayerData() */
void __thiscall CPlayerResource::UpdatePlayerData(CPlayerResource *this)
{
CBaseEdict *pCVar1;
uint uVar2;
CBaseEntity *this_00;
int iVar3;
int iVar4;
CPlayerResource *__s1;
int local_30;
int local_24;
uint local_20 [4];
local_30 = 1;
__s1 = this + 0x654;
if (0 < *(int *)(gpGlobals + 0x14)) {
do {
this_00 = (CBaseEntity *)UTIL_PlayerByIndex(local_30);
if ((this_00 == (CBaseEntity *)0x0) || (*(int *)(this_00 + 0x1f6c) == 2)) {
local_20[0] = 0;
iVar3 = memcmp(__s1,local_20,4);
if (iVar3 != 0) {
if (this[0x6c] == (CPlayerResource)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar3 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar3 + 2) = 0;
}
}
else {
this[0x70] = (CPlayerResource)((byte)this[0x70] | 1);
}
*(undefined4 *)__s1 = 0;
}
}
else {
uVar2 = *(uint *)(this_00 + 0x1f60);
local_20[0] = uVar2;
iVar3 = memcmp(__s1 + -0x84,local_20,4);
if (iVar3 != 0) {
if (this[0x6c] == (CPlayerResource)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar3 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar3 + 2) = 0;
}
}
else {
this[0x70] = (CPlayerResource)((byte)this[0x70] | 1);
}
*(uint *)(__s1 + -0x84) = uVar2;
}
local_20[0] = 1;
iVar3 = memcmp(__s1,local_20,4);
if (iVar3 != 0) {
if (this[0x6c] == (CPlayerResource)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar3 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar3 + 2) = 0;
}
}
else {
this[0x70] = (CPlayerResource)((byte)this[0x70] | 1);
}
*(undefined4 *)__s1 = 1;
}
uVar2 = CBaseEntity::GetTeamNumber(this_00);
local_20[0] = uVar2;
iVar3 = memcmp(__s1 + 0x84,local_20,4);
if (iVar3 != 0) {
if (this[0x6c] == (CPlayerResource)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar3 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar3 + 2) = 0;
}
}
else {
this[0x70] = (CPlayerResource)((byte)this[0x70] | 1);
}
*(uint *)(__s1 + 0x84) = uVar2;
}
uVar2 = (**(code **)(*(int *)this_00 + 300))(this_00);
local_20[0] = uVar2 & 0xff;
iVar3 = memcmp(__s1 + 0x108,local_20,4);
if (iVar3 != 0) {
if (this[0x6c] == (CPlayerResource)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar3 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar3 + 2) = 0;
}
}
else {
this[0x70] = (CPlayerResource)((byte)this[0x70] | 1);
}
*(uint *)(__s1 + 0x108) = uVar2 & 0xff;
}
uVar2 = 0;
if (-1 < *(int *)(this_00 + 0x100)) {
uVar2 = *(uint *)(this_00 + 0x100);
}
local_20[0] = uVar2;
iVar3 = memcmp(__s1 + 0x18c,local_20,4);
if (iVar3 != 0) {
if (this[0x6c] == (CPlayerResource)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar3 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar3 + 2) = 0;
}
}
else {
this[0x70] = (CPlayerResource)((byte)this[0x70] | 1);
}
*(uint *)(__s1 + 0x18c) = uVar2;
}
if (*(int *)(this + 0x860) == (*(int *)(this + 0x860) / 0x14) * 0x14) {
UTIL_GetPlayerConnectionInfo(local_30,&local_24,(int *)local_20);
iVar3 = (int)((float)*(int *)(this + (int)(__s1 + (-0x210 - (int)this))) * 0.8 +
(float)local_24 * 0.2);
local_24 = iVar3;
iVar4 = memcmp(__s1 + -0x210,&local_24,4);
if (iVar4 != 0) {
if (this[0x6c] == (CPlayerResource)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar3 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar3 + 2) = 0;
iVar3 = local_24;
}
}
else {
this[0x70] = (CPlayerResource)((byte)this[0x70] | 1);
}
*(int *)(this + (int)(__s1 + (-0x210 - (int)this))) = iVar3;
}
}
}
local_30 = local_30 + 1;
__s1 = __s1 + 4;
} while (local_30 <= *(int *)(gpGlobals + 0x14));
}
return;
}
SourceMod gamedata
paste intoaddons/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.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.