Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Get Public IP via Socket: BINGO!

Author
Message
Cescano
9
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 23rd Sep 2015 07:51
After hours and hours of testing, I found the way to get your Public IP address from a php script located in your server, which echoes your IP, finally I am close to release my game!

dbpro code:



Inside the GetIP.php script:



I have edited some variables and functions name from italian to english, so that everyone will understand better the code, I hope I didn't make any mistake by doing this.
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 23rd Sep 2015 21:59
nice

it looks like that is using the matrix1 socket commands?

Cescano
9
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 23rd Sep 2015 23:59
yes
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 24th Sep 2015 10:13 Edited at: 24th Sep 2015 10:15
have you tried the updated/optimized php script?
Cescano
9
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 24th Sep 2015 19:05
The code I am using is working perfectly, which could be the problem of my code? I don't understand which could be the potential bug that is said in that page.
Also, even if someone try to do something about his own IP, in the worst case that multiplayer game will just not start, there is no reason of doing that.

Login to post a reply

Server time is: 2024-04-26 13:43:42
Your offset time is: 2024-04-26 13:43:42