CTerrorPlayer::ChangeName
0x009995c0 · 474 bytes · __thiscall
_ZN13CTerrorPlayer10ChangeNameEPKc
Decompiled
undefined (2 params)
/* CTerrorPlayer::ChangeName(char const*) */
void __thiscall CTerrorPlayer::ChangeName(CTerrorPlayer *this,char *param_1)
{
code *pcVar1;
char cVar2;
char *pcVar3;
int *piVar4;
undefined4 uVar5;
longdouble lVar6;
undefined **local_3c [11];
pcVar3 = (char *)(**(code **)(*(int *)this + 0xb8))(this);
cVar2 = (**(code **)(*(int *)this + 0x778))(this);
if (cVar2 == '\0') {
CRecipientFilter::CRecipientFilter((CRecipientFilter *)local_3c);
local_3c[0] = &PTR__CBroadcastRecipientFilter_00c09928;
/* try { // try from 00999602 to 00999606 has its CatchHandler @ 009997b5 */
CRecipientFilter::AddAllPlayers((CRecipientFilter *)local_3c);
local_3c[0] = &PTR__CReliableBroadcastRecipientFilter_00c157a8;
/* try { // try from 00999611 to 00999615 has its CatchHandler @ 009997b3 */
CRecipientFilter::MakeReliable((CRecipientFilter *)local_3c);
/* try { // try from 0099964b to 009996f1 has its CatchHandler @ 0099979a */
UTIL_SayText2Filter((IRecipientFilter *)local_3c,(CBasePlayer *)this,false,
"#Cstrike_Name_Change",pcVar3,param_1,(char *)0x0,(char *)0x0);
piVar4 = (int *)(**(code **)(*gameeventmanager + 0x1c))
(gameeventmanager,"player_changename",0,0);
if (piVar4 != (int *)0x0) {
pcVar1 = *(code **)(*piVar4 + 0x30);
uVar5 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(this + 0x30));
(*pcVar1)(piVar4,"userid",uVar5);
(**(code **)(*piVar4 + 0x3c))(piVar4,"oldname",pcVar3);
(**(code **)(*piVar4 + 0x3c))(piVar4,"newname",param_1);
(**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar4,0);
}
local_3c[0] = &PTR__CBroadcastRecipientFilter_00c09928;
CRecipientFilter::~CRecipientFilter((CRecipientFilter *)local_3c);
}
CBasePlayer::SetPlayerName((CBasePlayer *)this,param_1);
lVar6 = (longdouble)CountdownTimer::Now();
if ((float)lVar6 + 10.0 != *(float *)(this + 0x2b7c)) {
(**(code **)(*(int *)(this + 0x2b74) + 4))(this + 0x2b74,this + 0x2b7c);
*(float *)(this + 0x2b7c) = (float)lVar6 + 10.0;
}
if (*(float *)(this + 0x2b78) != 10.0) {
(**(code **)(*(int *)(this + 0x2b74) + 4))(this + 0x2b74,this + 0x2b78);
*(undefined4 *)(this + 0x2b78) = 0x41200000;
}
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.