Page 1 of 1

GetClientIP() returns 0.0.0.0

Posted: Wed Feb 16, 2011 11:32 pm
by AndyMK
IPString(GetClientIP(ClientID)) returns 0.0.0.0 when a client disconnects from a server. The ClientID is ok. Is the IP address deleted for that ClientID when the client disconnects? If i need to know the IP of a client that just disconnected, must i store it somewhere when it connected?

Re: GetClientIP() returns 0.0.0.0

Posted: Thu Feb 17, 2011 1:29 am
by IdeasVacuum
Well, I am not an expert by any means but if the Client is disconnected, how can the Server get the Client's IP Address? it's 'not there' is it?

If i need to know the IP of a client that just disconnected, must i store it somewhere when it connected?

Sounds logical.

Re: GetClientIP() returns 0.0.0.0

Posted: Fri Feb 18, 2011 10:54 am
by AndyMK
Don't you find it strange that the ClientID is returned but not the IP? Since the IP is obtained from the ClientID, i just find it odd but thanks for the reply, i'll store it on connection.

Re: GetClientIP() returns 0.0.0.0

Posted: Fri Feb 18, 2011 11:56 am
by eesau
AndyMK wrote:Don't you find it strange that the ClientID is returned but not the IP? Since the IP is obtained from the ClientID, i just find it odd but thanks for the reply, i'll store it on connection.
Can you have multiple connections per IP? If yes, it makes much more sense to return the clientID and not the IP.

Disclaimer: I haven't used PB's networking library at all, so I really don't know.

Re: GetClientIP() returns 0.0.0.0

Posted: Fri Feb 18, 2011 8:14 pm
by Suirad
You would be better off using the clientid as an identifyer for the client than the ip because it will always be shown whenever an event occurs by that client.