How to move player to another room that created room at the same time!

Hello, I'm using joinRandomRoom to connect to existing rooms, the problem is if two people click play at the same time it creates two rooms because there is no time to create one room and the other connect to it! Then I thought about the possibility that when two players click play they can create two rooms at the same time, but one of them leaves the room and connects to another that there is vacant space! How can I do this?

Comments

  • This is a know problem and there is no good workaround for this, sadly.
    However, this is only affecting development-time and (very) low CCU counts.

    During development, we know that more often than not, two instances of a client get started at the same time and run into this.
    In reality it's very unlikely that the only 2 CCUs you got will create a room at the same time. Unless you have basically no players, someone else will play and join either room (and then another joining the remaining room).
  • You could work on this problem in the next update, I would be pretty grateful! :smile::wink:
  • We probably won't, to be honest. It would be quite some effort to fix and it's only happening in cases with really low CCUs. That's not really anyone's target for a game/project, is it?
  • Makes sense, but for indie games it would be a problem. But I will not give up Photon because of this, I love the ease of Photon <3
  • We hope that indie games become as successful as games of big studios. With the quality of today's indies .. totally doable!
    As long as your game has low CCUs, keep in mind that you can reduce the choice of available regions in the Dashboard "Regions Whitelist". Using all Photon Cloud regions will split your community and that is maybe even a worse problem than (only) two players looking for a game at exactly the same time of day.

    Thanks for not giving up on us! We try to keep things easy :)