View Full Version : Server Plugin and IP Addresses
teknogrebo
02-04-2005, 10:17
I apologise if I'm being dense here, but is there any way of finding out a players IP address other than to record it from what is passed into ClientConnect()?
there might be something in the playerinfomanager (check the SDK) but it would probably be just as easy to add a string to your player class and set it when its passed through ClientConnect. (if you have a player class...)
teknogrebo
02-04-2005, 10:36
There isn't anything in the playerinfo manager. You can just get a player info from the edict_t that is passed in at the same time. Unfortunately, there is no IP address info in the playerinfo class, and also if you try and retrieve a playerinfo from the edict at this point then you get back a null pointer. Therefore, the only thing to do really is keep a record of entity pointers and matching IP addresses yourself, then match up the entity and playerinfo later on, which is all a lot of unneccesary storage IMHO. I was hoping there was a nicer way of doing it than that!
BAILOPAN
02-04-2005, 10:47
GetAddress() from INetChannelInfo (which you can get from IVEngineServer) will work I think
teknogrebo
02-04-2005, 11:00
That worked a treat. Thanks for the info. They don't half make you jump through hoops for some information :)
vBulletin® v3.8.7, Copyright ©2000-2024, vBulletin Solutions, Inc.