mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-02-09 05:24:17 +00:00
Workaround getting others player uid
This commit is contained in:
parent
6c31780cca
commit
6382679d86
@ -686,6 +686,19 @@ void ClientUserInfoChanged( edict_t *pEntity, char *infobuffer )
|
||||
if ( !pEntity->pvPrivateData )
|
||||
return;
|
||||
|
||||
|
||||
// prevent keeping other's uid on saverestore
|
||||
CBasePlayer *pPlayer = GetClassPtr((CBasePlayer *)&pEntity->v);
|
||||
const char *uid = GETPLAYERAUTHID( pPlayer->edict() );
|
||||
if( !uid || strstr(uid, "PENDING") )
|
||||
uid = g_engfuncs.pfnInfoKeyValue( g_engfuncs.pfnGetInfoKeyBuffer( pPlayer->edict() ), "ip" );
|
||||
|
||||
if( strncmp( uid ,pPlayer->gravgunmod_data.uid, 32 ) )
|
||||
pEntity->v.netname = pEntity->v.frags = 0;
|
||||
|
||||
strncpy( pPlayer->gravgunmod_data.uid, uid, 32 );
|
||||
pPlayer->gravgunmod_data.uid[32] = 0;
|
||||
|
||||
// msg everyone if someone changes their name, and it isn't the first time (changing no name to current name)
|
||||
if( pEntity->v.netname && ( STRING( pEntity->v.netname ) )[0] != 0 && !FStrEq( STRING( pEntity->v.netname ), g_engfuncs.pfnInfoKeyValue( infobuffer, "name" ) ) )
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user