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 / Muliplayer Network Connections

Author
Message
Thaizer
3
Years of Service
User Offline
Joined: 2nd Sep 2020
Location:
Posted: 2nd Sep 2020 13:28 Edited at: 2nd Sep 2020 13:46
I developed my multiplayer turn based card game and it works fine on the LAN with these two host and join commands:
Networkid = HostNetwork("NetName","Player 1",Hostport)
Networkid = JoinNetwork("NetName", ConnectPlayer$)

Where:
Hostport = 48230

Then I try and make it work over the internet
and so use the same host command
but this join command Networkid=JoinNetwork(HostIP$,Hostport,ConnectPlayer$)

Where:
HostIP$ = "14.207.10.41"

And the clients just wont connect.

I've read through all the tutorials I can find, but cant make any progress.
Bear in mind I'm a networking noobie so dont really know how to unblock that particular port, so if thats whats doing it please point me in the right direction, and be gentle.

MOD Edit: Please review the AUP re: your original Network Names...
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 2nd Sep 2020 17:02
You will need to allow incoming connections for the port in your router config panel, by default most routers block incoming connections of this kind, login to your routers config and look for "port forward",

Please bear in mind this will poke a massive hole in your PC security, do it at your own risk!
Scribble
7
Years of Service
User Offline
Joined: 2nd Apr 2017
Location:
Posted: 2nd Sep 2020 17:24 Edited at: 2nd Sep 2020 17:29
There are several problems that are most likely preventing your game to connect over the internet:

1) Your port is not forwarded/open. You had to port forward the port in the router. Your IP address also had to be static I think.

2) Even if you have port-forwarded your router port, your internet company/ISP may use multiple NAT in their own network, for your internet connection subscription. This means, the port must be open on those multiple NAT, which your ISP wont probably do for you. So, you will not be able to connect the client even if you have port-forwarded your server. You will have to subscribe to a kind of internet connection that have static IP/configured for servers in this case.

3) Firewalls not open. You had to specify your server app as an exception/rules to the firewall. You also must specify the type of connection your app is using (TCP/UDP).

4) If you're using hosting servicea to host the server, the ports and connection type of your app also must be declared in some hostings console so they will be opened, such as Amazon AWS. You also must use appropriate IP address for those server, because some hostings will let you have 'elastic IP', and some will change the server IP everytime the server is restarted.
Thaizer
3
Years of Service
User Offline
Joined: 2nd Sep 2020
Location:
Posted: 3rd Sep 2020 07:51
Thanks for the suggestions. I will start with trying to unblock the port on my router and go from there.

One more question, which I'm guessing is pretty stupid. Do I only have to unblock the port on the router of whichever device is being used as the host, or do I have to do it on all routers being used by client devices as well?

Thanks again for the help.

Login to post a reply

Server time is: 2024-04-19 11:26:02
Your offset time is: 2024-04-19 11:26:02