PDA

View Full Version : Getting a player's edict in the NetworkIDValidated function


Geesu
05-22-2005, 18:01
That function gives us the player's steamid and they're name, how can I get a pointer to the edict_t from this?

Thanks,
Josh

BeetleFart
05-22-2005, 18:12
That function gives us the player's steamid and they're name, how can I get a pointer to the edict_t from this?

Thanks,
Josh

I cheat at it...i save there name in
client connect with
const char * name=engine->GetClientConVarValue( index,"name");
and then i iterate thru the names to find it and use that to get there index.

Geesu
05-22-2005, 18:32
yea thats what I thought about doing :P

Was thinking about just looping through all the edicts and getting their names, I guess that would be more work though

XAD
05-23-2005, 03:18
yea thats what I thought about doing :P

Was thinking about just looping through all the edicts and getting their names, I guess that would be more work though
Be carefull though... I think I recall Alfred saying the name can be changed by client after connect and before authorization (this was on a question that "we", coders, also wanted an index or userid to sent as a parm).

/X

BAILOPAN
05-23-2005, 05:59
It's a useless callback... don't rely on it.

XAD
05-23-2005, 07:36
It's a useless callback... don't rely on it.
Well not totally... you should be able to use it as a trigger...

Connect -> flag slot not authed
Auth -> loop through all connected not authed players to see if they got a SteamID, if yes then do your auth-stuff and flag slot as authed

/X

BAILOPAN
05-23-2005, 18:14
You can achieve the same thing more accurately the way amxmodx does it (GameFrame counter)... as I think Alfred said, there's no guarantee when they'll auth (either before you get the edict or after).

It's best not to use it for portability, portability to SourceMM I mean ;]

Geesu
06-17-2005, 21:58
For some reason the name thing didn't always work, I tried the checking in GameFrame thing and it works great, thanks for the idea BAIL.

Sometimes the player would be kicked and sometimes the player woudln't.. it was so weird, almost like the name passed in ClientConnect wasn't always right :/