Raised This Month: $ Target: $400
 0% 

How can I know the server IP which the client connected


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sunpiny
New Member
Join Date: Feb 2006
Old 03-19-2006 , 18:59   How can I know the server IP which the client connected
Reply With Quote #1

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?
sunpiny is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 03-19-2006 , 20:30  
Reply With Quote #2

Umm, not exactly sure.

You can try this if I get it correctly:

Code:
new szServerIP[19] get_cvar_string(szServerIP,18,"net_address")
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 03-19-2006 , 20:37  
Reply With Quote #3

Quote:
Originally Posted by Hawk552
Umm, not exactly sure.

You can try this if I get it correctly:

Code:
new szServerIP[19] get_cvar_string(szServerIP,18,"net_address")
Code:
new szServerIP[19]; get_cvar_string("net_address" , szServerIP , 18);
*
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 03-19-2006 , 20:39  
Reply With Quote #4

My mistake. Wrote that off the top of my head after not doing any coding for 2 weeks.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 03-19-2006 , 21:38  
Reply With Quote #5

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.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 03-19-2006 , 22:00  
Reply With Quote #6

He always has excuses.
Brad is offline
sunpiny
New Member
Join Date: Feb 2006
Old 03-19-2006 , 22:42   It doesn't work
Reply With Quote #7

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 , 1 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
sunpiny is offline
jtp10181
Veteran Member
Join Date: May 2004
Location: Madison, WI
Old 03-19-2006 , 22:45  
Reply With Quote #8

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.
__________________
jtp10181 is offline
Send a message via ICQ to jtp10181 Send a message via AIM to jtp10181 Send a message via MSN to jtp10181 Send a message via Yahoo to jtp10181
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:36.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode