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 / Multisync not connecting outside LAN/WLAN

Author
Message
Cescano
10
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 21st Sep 2015 04:50
When I try my game with 2 pcs on the same network, everything works properly, testing my game with a friend (which uses a different router as he is in his home) we got a TIMED OUT error with Multisync.

The IPs are set correctly, the client is set to join the IP of the hosting player (router's IP, not LAN IP).
It also attempts to connect to the LAN IP of the hosting player if the WAN connection fails (so that even LAN games work),but neither than works (and probably shouldn't)

We both opened port 27015 in our routers (which is the port I have set for the multisync connection), but we both got the timed out error (we tried both being host or clients).

What could be the error? is there something else to set?
Cescano
10
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 21st Sep 2015 20:02
I have been able to fix it by opening the port also on the Windows Firewall on my pc.

Now there is another little problem, if I host the game, no problem, if he hosts the game, somehow instead of his router's Ip, the php server assign him my router's IP, so when I try to connect when he host a game, the game try to connect to my own router.
This is weird, I didn't find anything that could cause this, the php code seems to be fine, and there is not an array problem because even if we restart the game (so that the arrays are 100% cleared), he still get my router's Ip when he requests his own router's Ip from the php server.
I have also tried to restart the server and start again the php code, but he has still assigned my router's IP.
Cescano
10
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 21st Sep 2015 23:56
For some reason the "return IP" function in my php code returns my IP even if HE requests it, this is weird, the variable used is not global
Cescano
10
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 22nd Sep 2015 01:59
Does anyone knows how to get the router's IP? from dbpro commands or server side using a php code?
Ortu
DBPro Master
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 22nd Sep 2015 03:17
can you post the php code you are using? are you using REMOTE_ADDR ?

I've got some code for dbpro to get the public IP, i will dig it up when i get home.

Cescano
10
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 22nd Sep 2015 04:00
this is where the client request his own IP:



these 2 are the functions to retrieve the IP:



The problem is, doing this, it will retrieve the IP of the PC that opened the php file calling it from the browser for example or from the server using the get command.
So this is not the IP of the player who wants to host a game, which should request it via socket.
I can't find any way to request it via socket, the way these functions return the IP is the same way that whatismyip.com for example use, so based from which client connected via http to the server, not via socket.
Cescano
10
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 22nd Sep 2015 07:36 Edited at: 22nd Sep 2015 07:40
I am attempting another idea, using a second script just to retrieve the public IP, the code is this one:



The problem is that I get an error code 12045, I get the same error even trying the GetIP.php script on local with xampp.

It also pops up a Window saying there is something missing in the urlmon.dll? ordinal 297 is missing (the dll is in the same folder as the exe).

EDIT:

Even trying to delete the urlmon.dll on the folder I got the same error code but without the dll popup error
Cescano
10
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 22nd Sep 2015 16:09
This is getting frustrating, I am almost ready to release my game, but I am stuck in a simple thing like this.
Using php there is no way to get the public IP via socket, using http I am getting this 12045 error.
I have read in the forum that the http request data command could be bugged? Is there something that is not bugged in dbpro?
Seriously, that guy who was talking like a mad saying stop getting mad with dbpro wasn't that wrong...

WHY is that hard to find your own damn public IP?
Almost 15 years of dbpro and nobody have taken care about this?
Ortu
DBPro Master
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 22nd Sep 2015 22:45
tgc hosts a utility to get the public ip, or at least did a few years ago, try this



Cescano
10
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 22nd Sep 2015 23:40 Edited at: 22nd Sep 2015 23:44
If I compile it, I get a error 12037.

And trying to port 80 it says bad request
Ortu
DBPro Master
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 23rd Sep 2015 00:48
yeah looks like they no longer host that page

Login to post a reply

Server time is: 2025-08-08 17:25:36
Your offset time is: 2025-08-08 17:25:36