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.

AppGameKit Classic Chat / Can I avoid forcing game hosts to setup port-forwarding?

Author
Message
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 27th Nov 2017 13:14
Hi there I am making an online game where players can host a game, as it is now hosters have to setup port forwarding in their routers. Is this the only way for AppGameKit app to host online games?
13/0
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 27th Nov 2017 15:15 Edited at: 27th Nov 2017 15:17
I have read about NatPunchThrough.
I wanted to try it in AppGameKit a long time ago for a Multilayer Game of mine, but never did it.

Basicaly you need a Server which tells the client's to connect to one port at the same time and don't stop if the first try fails repeat it one more in case the first try opened the right internal ports.
Just google it there good explanations out there now.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 27th Nov 2017 16:20
often this way from device to web is open. from web to device is closed.
if you have enough bandwidth at home you can setup a own server app at pc or raspberry pi.
AGK (Steam) V2017.09.25 : Windows 10 Pro 64 Bit : AMD (17.11.2) Radeon R7 265 : Mac mini OS High Sierra (10.13)
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 27th Nov 2017 20:11 Edited at: 27th Nov 2017 20:17
@janbo, thanks, I will read more about that EDIT: I just had a quick glance at the link, it seems to be what I need and most systems are already in place to do what was described in that link.

@Markus, the lobby server is not a problem (once I get my app to run on my server), but hosting every game on my own network is not an option. The plan was to have a lobby server, then game hosters would list their game on this lobby server.
13/0
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 28th Nov 2017 08:51
i read the blog entry from 2014 but i can't believe that this NAT Punch-through work with tcp.
AGK (Steam) V2017.09.25 : Windows 10 Pro 64 Bit : AMD (17.11.2) Radeon R7 265 : Mac mini OS High Sierra (10.13)
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 28th Nov 2017 13:52
Now the lobby server detects what IP address clients and hosts connect from when a client joins a game host, a message is sent to lobby server so that the lobby server can tell the game host to "punch through" to the clients IP address. The clients IP address is received well at the host and the client knows what host IP to connect to. I tried using JoinNetwork() and ConnectSocket() from game host to clients IP and port, but no luck. I use fixed ports for the game host, so hoster will be listening at these ports that it's trying to punch through for the client. Is it a port problem (like cannot be hosting on a port and then use any of the aforementioned commands to punch through). Is there any other way to punch?
13/0
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 28th Nov 2017 16:29
@Markus, I couldn't get it to work in a simple way.

I can convert to tier 2 and use some plugin for TCP punch through, if I can find one.
13/0
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 28th Nov 2017 17:56 Edited at: 28th Nov 2017 18:00
There is TCP hole punshing
Its probably because we cant just send a SYN without the ACK part of the TCP handshake as the AppGameKit commands create a full connection...not sure if we can punch the hole with third party stuff and then let AppGameKit go through the hole
Maybe using sockets ?
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 28th Nov 2017 18:14
the docu said about GetDeviceIPv6
"Returns the IPv6 address of the current device, this can be used by other devices to connect to this device. "
maybe is this your solution
AGK (Steam) V2017.09.25 : Windows 10 Pro 64 Bit : AMD (17.11.2) Radeon R7 265 : Mac mini OS High Sierra (10.13)
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 28th Nov 2017 22:49
haha... thats true if the clients have IPv6 which is likely then you are set.
I have IPv4 still.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 28th Nov 2017 23:11 Edited at: 28th Nov 2017 23:14
Quote: "I have IPv4 still."

windows support this ip6 for a long time and at android 4.x+ i see also a ip6 in status.
my fritzbox router also support ip6.

but i think the problem is the same, you can not connect from outside to a device if a router/firewall is between.
the agk docu is half-truth.
AGK (Steam) V2017.09.25 : Windows 10 Pro 64 Bit : AMD (17.11.2) Radeon R7 265 : Mac mini OS High Sierra (10.13)
MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 6th Dec 2017 23:45 Edited at: 6th Dec 2017 23:50
Or you can host all the games on a 24/24 Linux server box with full Appgamekit multiplayer commands compatiblity :p

https://forum.thegamecreators.com/thread/219676

All your clients will connecting to the same server with no need to open local router ports (and you can isolate your players in different "channels" on one server instance).

You have Linux box for very little prices (5 euros / month).

Login to post a reply

Server time is: 2024-11-24 06:53:55
Your offset time is: 2024-11-24 06:53:55