How can I know the server IP which the client connected
There are multiple IP in my server ,such as IP1,IP2 and IP3. When a client connect, They maybe use command 'connect IP3:port',or maybe ''connect IP1:port'. I can know the client IP by 'get_user_ip()' in function 'client_connect()'. But I want to know which server IP they choose. IP1 or IP2, so how can I get it?
|
Umm, not exactly sure.
You can try this if I get it correctly: Code:
|
Quote:
Code:
|
My mistake. Wrote that off the top of my head after not doing any coding for 2 weeks.
|
Two Weeks?!?!? That is a really long time to forget such a basic function doncha think?
Now if it had been 2 years there might be some room for that. |
He always has excuses. :lol:
|
It doesn't work
Thx!
But it doesn't work. When Server Start, it display "Server IP Address IP1:27015". I don't bind the IP, it select one IP such as IP1. You can 'connect IP2:27015' Or 'connect IP3:27015' ,I can enter the Server with all IP1,IP2,IP3. But get_cvar_string("net_address" , szServerIP , 18) always return the IP: IP1, which the "DISPLAY IP" when the server start . it's IP1. I want to get IP such as: Client CMD 'connect IP2:27015' , it should return IP2 Client CMD 'connect IP3:27015' , it should return IP3 Client CMD 'connect IP1:27015' , it should return IP1 it seems no way can reach it |
there is no way to get the information you want, The only way I know of having more than one IP for server is the have fake servers redirect to one server. If thats the case you can check the logs of the fake servers to see who connected to it.
|
| All times are GMT -4. The time now is 16:36. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.