0 Favourites

Construct2 chatroom example not working fine

  • 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: 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:

    shikpoosh24.ir/tmp/a.png

    2 - I connect to chatroom with my laptop over wifi and this is my laptop screen shot:

    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

  • 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.

  • 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

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • 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.

    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" }[/code:17zak9p5]
    
    *
    

    > 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.

  • Yeah, this is more to do with the architecture of the Internet rather than anything to do with C2.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread sticky
4,517 857,196
Tinimations's avatar
Tinimations
Unread sticky
1,586 437,226
matriax's avatar
matriax
Unread hot topic
1,068 148,617
Reflextions's avatar
Reflextions