Page 1 of 1

IP Address?

Posted: Mon Nov 22, 2004 10:52 pm
by GBeebe
Is there a way (In PB native code) to determin the IP address on a server?

Not everyone knows how to look for thier IP address in windows, And I certainly don't know how to find it in linux. So I thought that it would be easier to display it to the player who is hosting a game so that he/she can tell everyone else on a LAN...

Or better yet, has anyone figured out how to search a LAN for existing game servers (like every other LAN game does)?

Posted: Tue Nov 23, 2004 12:17 am
by Kale

Code: Select all

InitNetwork() : ExamineIPAddresses()
IPAddress.s = IPString(NextIPAddress())
Debug IPAddress

Posted: Tue Nov 23, 2004 10:12 pm
by plouf
just tell them to look at http://www.whatismyip.com/

or make a simple parser to retriecve data from this page
so you can retrieve ip from router if the are behind NAT

Posted: Wed Nov 24, 2004 12:31 am
by olejr
Games on a LAN uses UDP broadcast to find servers.....

Posted: Wed Nov 24, 2004 10:48 am
by jrw
plouf wrote:just tell them to look at http://www.whatismyip.com/

or make a simple parser to retriecve data from this page
so you can retrieve ip from router if the are behind NAT
It's amazing that someone has made a website to display someone's real ip address, yet his code is actually incorrect :lol:

For a large majority of people his script will show the ip address of the proxy server they are using. He should display the HTTP_X_FORWARDED_FOR var and not REMOTE_ADDR

Something like http://www.auditmypc.com/myinfo.asp will display your real ip address even if you're using a proxy server.