CCSPlayer::ChangeName
0x006518b0 · 524 bytes · __thiscall
_ZN9CCSPlayer10ChangeNameEPKc
Decompiled
undefined (2 params)
/* CCSPlayer::ChangeName(char const*) */
void __thiscall CCSPlayer::ChangeName(CCSPlayer *this,char *param_1)
{
code *pcVar1;
int iVar2;
int iVar3;
char cVar4;
char *pcVar5;
int *piVar6;
undefined4 uVar7;
int in_GS_OFFSET;
undefined **local_60 [8];
char local_40 [32];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
V_strncpy(local_40,param_1,0x20);
pcVar5 = (char *)(**(code **)(*(int *)this + 0xb8))(this);
cVar4 = (**(code **)(*(int *)this + 0x778))(this);
if (cVar4 == '\0') {
CRecipientFilter::CRecipientFilter((CRecipientFilter *)local_60);
local_60[0] = &PTR__CBroadcastRecipientFilter_00c09928;
/* try { // try from 0065191d to 00651921 has its CatchHandler @ 00651abc */
CRecipientFilter::AddAllPlayers((CRecipientFilter *)local_60);
local_60[0] = &PTR__CReliableBroadcastRecipientFilter_00c157a8;
/* try { // try from 0065192f to 00651933 has its CatchHandler @ 00651adc */
CRecipientFilter::MakeReliable((CRecipientFilter *)local_60);
/* try { // try from 00651969 to 00651a0c has its CatchHandler @ 00651ad1 */
UTIL_SayText2Filter((IRecipientFilter *)local_60,(CBasePlayer *)this,false,
"#Cstrike_Name_Change",pcVar5,local_40,(char *)0x0,(char *)0x0);
piVar6 = (int *)(**(code **)(*gameeventmanager + 0x1c))
(gameeventmanager,"player_changename",0,0);
if (piVar6 != (int *)0x0) {
pcVar1 = *(code **)(*piVar6 + 0x30);
uVar7 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(this + 0x30));
(*pcVar1)(piVar6,"userid",uVar7);
(**(code **)(*piVar6 + 0x3c))(piVar6,"oldname",pcVar5);
(**(code **)(*piVar6 + 0x3c))(piVar6,"newname",local_40);
(**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar6,0);
}
local_60[0] = &PTR__CBroadcastRecipientFilter_00c09928;
CRecipientFilter::~CRecipientFilter((CRecipientFilter *)local_60);
}
CBasePlayer::SetPlayerName((CBasePlayer *)this,local_40);
(**(code **)(*engine + 0x9c))(engine,*(undefined4 *)(this + 0x30),"name \"%s\"",local_40);
iVar3 = gpGlobals;
*(undefined4 *)(this + 0x2424) = *(undefined4 *)(this + 0x2420);
*(undefined4 *)(this + 0x2420) = *(undefined4 *)(this + 0x241c);
*(undefined4 *)(this + 0x241c) = *(undefined4 *)(this + 0x2418);
*(undefined4 *)(this + 0x2418) = *(undefined4 *)(this + 0x2414);
iVar2 = *(int *)(in_GS_OFFSET + 0x14);
*(undefined4 *)(this + 0x2414) = *(undefined4 *)(iVar3 + 0xc);
if (local_20 == iVar2) {
return;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.