Is it possible to make a peer become host ?

Get help using Construct 2

Post » Mon Aug 08, 2016 6:32 pm

Hi. The idea is to prevent a game to be ended when the host leaves. Then a random peer becomes host, so the game can continue.
Is it possible ?
B
12
S
7
G
7
Posts: 450
Reputation: 4,276

Post » Mon Aug 08, 2016 7:05 pm

I don't think so, once the host leaves, everyone is kicked.

You could prevent this by making sure the host isn't a player and so never leaves.

Or you could disguise that it happened by setting a peer as host and autorejoining a new game kinda like this user's response :
viewtopic.php?f=147&t=153211&p=966155&hilit=peer+becomes+host#p966155
B
47
S
17
G
81
Posts: 2,223
Reputation: 48,093

Post » Mon Aug 08, 2016 8:35 pm

Thank you. :)
B
12
S
7
G
7
Posts: 450
Reputation: 4,276

Post » Mon Aug 08, 2016 8:51 pm

How can you make 100% sure you'll be the host on a multiplayer application ?
B
12
S
7
G
7
Posts: 450
Reputation: 4,276

Post » Mon Aug 08, 2016 9:28 pm

Join an empty room.
B
47
S
17
G
81
Posts: 2,223
Reputation: 48,093

Post » Mon Aug 08, 2016 10:07 pm

Thank you ! :)
B
12
S
7
G
7
Posts: 450
Reputation: 4,276

Post » Tue Aug 09, 2016 3:51 am

While technically it is possible as described above, it makes more sense to me to design a system around a dedicated host "server" that doesn't participate in the game if you need persistence when people connect and disconnect rather than try to create a system that can migrate hosts - you will run into a lot of frustrating design walls if you work that way.

The biggest one is upon a sudden host disconnect, even if you managed to get everyone to rejoin, much of the data that the host was responsible for will not be recoverable, and it will be far from a seamless transition. If you can create a system where the host manually hands off the host role, the transition will be much more controlled and easier to work with.
Mistakes were made.
B
53
S
27
G
114
Posts: 1,695
Reputation: 64,438


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 4 guests