How do I swap hosts (multiplayer)?

0 favourites
  • 4 posts
From the Asset Store
Full game Construct 2 capx code source to post on Google Play
  • Hi!

    I've been fidling with the multiplayer object for a few days now and one problem I have is that when the host leaves, if I try to make a peer become the new host, there seems to be an error sending messages from this new host to any new peer that joins its room.

    I made a simple c3p project ( with a button that sends a message form host to peers and from peers to the host, if you wish to reproduce this behaviour, follow these steps:

    1: join as a host

    2: join as a peer (at this stage, messages come and go both ways)

    3: leave as the host (peer now becomes host)

    4: rejoin as a new peer (at this moment, the new peer can send messages to the new host, but the host messages won't reach the peer)

    Can someone help me with this, please?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Step 3: "leave as the host (peer now becomes host)" does not happen automatically, and is probably the source of any issues you are having. How are you handling this step currently?

  • Sorry, I forgot to answer this post x.x

    Basically, when the host leaves (on kicked) the peer joins a new room as the new host.

    Apparently it works, the peer joins the room as a host and new peers can connect to it, and send messages to the host, but messages broadcasted form this new host won't reach the peers :(

  • Are you using peer and host groups for events?

    Upon getting kicked, all peers will try to reconnect, the first one that manages to do so will be the new host, and will need to enable and disable it's peer/host event groups as such. Otherwise, it will remain using peer events even though it is the host now.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)