How do I reconnect and get the objects back?

0 favourites
  • 2 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • Speaking of multiplayer.

    Let's assume that the host is online 24 hours a day, if the player leaves he doesn't delete the object...

    How do I get back into the game and everything that had my peerid becomes mine again?

    I know that the peerid changes with each reconnection... Should I then have a peerALIAS variable and relog with the same alias as before?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think I managed to solve it and I share the tip here for anyone looking for the same thing.

    We know that peerid always changes in each connection, so I created a synchronized numeric variable and asked the player for a password that will be the identification of that object.

    Then we have:

    Player > peerid = c4g8

    Owner= 9876

    So everything that belongs to the peer will be named with this password "9876"...

    On the client side, it is now easier when he connects everything that has this password to the map and copies his peerid. He now has possession of the objects.

    My game in progress. Multiplayer online strategy game.

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