Construct2 chatroom example not working fine

Discussion and feedback on Construct 2

Post » Wed Oct 19, 2016 7:06 am

Message: pikazho can only post plain text URLS until they have 500 rep. 3 URLS modified. Why?
Hi
I open construct2 chatroom example from File->New menu -> example: Multiplayer -chatroom

1- I just changed the Game_NAME,INSTANCE_NAME and ROOM_NAME.
2- I export project as html5
3- upload it to my host: http://shikpoosh24.ir/tmp/chat3/

First scenario works fine:
I have a mobile and a laptop.
1- I turn on my mobile wifi and laptop wifi and connect both of them to my adsl modem
2- I connect to chatroom with my mobile and it will be host
3- I connect to chatroom with my laptop, it will be peer and every thing just work as expected.

Second scenario doesnt works:
I have a mobile and a laptop.
1- I turn on my mobile 4G data and connect to chatroom, my mobile will be host
and this is the screenshot:
http://shikpoosh24.ir/tmp/a.png
2 - I connect to chatroom with my laptop over wifi and this is my laptop screen shot:
http://shikpoosh24.ir/tmp/b.png
as you see in above screenshot my laptop join the chatroom as peer but automatically kicked after about 20 seconds and could not connect to the host.

every time both of my device are in same network chatroom works but when I try to connect them to chatroom via different network it doesnt work.

anybody can help?
thanks you that take time and read my question
B
8
S
2
Posts: 16
Reputation: 530

Post » Wed Oct 19, 2016 9:43 am

Cell data (e.g. 4G) sometimes uses NAT which blocks peer-to-peer connections. It's a problem with how the carrier has implemented 4G. The multiplayer tutorial covers the subject in the first part.
Scirra Founder
B
387
S
230
G
87
Posts: 24,248
Reputation: 192,228

Post » Wed Oct 19, 2016 10:21 am

Ashley wrote:Cell data (e.g. 4G) sometimes uses NAT which blocks peer-to-peer connections. It's a problem with how the carrier has implemented 4G. The multiplayer tutorial covers the subject in the first part.


Thanks for your answer but this is a big problem, in this case many players that uses 3G or 4G (over NAT) cant join multiplayer game.

in manual it says:
"There are several other variants of NAT, including large scale NAT applied to entire regions, ISPs, or mobile networks, and some are more restrictive than others. Unfortunately this means in some cases connections are not possible, particularly if both the host and the joining peer are behind highly restrictive NAT. However with common setups players can usually connect to each other, and generally the closer they are geographically the more likely the connection is to work and provide good quality service."

what does it mean by saying "However with common setups players can usually connect to each other"??
is there something I can do to increase connecting chance via NAT (like mobiles connect via 4G that uses NAT)?
what is the solution? is there any way? if yes please help with with giving a refrence link, etc

thank you very much
B
8
S
2
Posts: 16
Reputation: 530

Post » Wed Oct 19, 2016 10:55 am

pikazho wrote:is there something I can do to increase connecting chance via NAT (like mobiles connect via 4G that uses NAT)?
what is the solution? is there any way? if yes please help with with giving a refrence link, etc

You could get a custom ICE server to work and use the action* that is included in the multiplayer plugin.
It doesn't guarantee a 100% success rate I think but it will improve the connectivity of some NATs.

However this is pretty advanced stuff and you might have to spend some money in order to host a server.
You could also try some of THESE free ones but they might not work**, just add the info when using the action.
Code: Select all
Some free public STUN's that are already in use, so >don't< add these ones again:
{ "urls": "stun:stun.l.google.com:19302" },
{ "urls": "stun:stun1.l.google.com:19302" },
{ "urls": "stun:stun2.l.google.com:19302" },
{ "urls": "stun:stun3.l.google.com:19302" },
{ "urls": "stun:stun4.l.google.com:19302" },
{ "urls": "stun:23.21.150.121" }



*
Ashley wrote:> Add ICE server
Add a custom Interactive Connectivity Establishment (ICE) server used by WebRTC to establish connections between peers. There are a couple of built-in public STUN servers used, but you can also provide your own TURN servers to enable connectivity through certain kinds of NAT. A username and credential can also be optionally provided if the server requires them.


** You can use THIS to test them out.
ImageImageImageImage
B
56
S
20
G
76
Posts: 634
Reputation: 43,357

Post » Wed Oct 19, 2016 5:16 pm

Yeah, this is more to do with the architecture of the Internet rather than anything to do with C2.
Scirra Founder
B
387
S
230
G
87
Posts: 24,248
Reputation: 192,228


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 3 guests