JoinRandomRoom / knowing if rooms full or none available?

Hello!

Simple question:

As i know, with "PhotonNetwork.logLevel = PhotonLogLevel.Full" you get a DebugLog if "JoinRandomRoom" fails.
But that Log wont tell me if there are no rooms or just all of them are full.

I use some room properties to split people up, thats why checking the roomcount wont help me.

The only why i can think of is to receive the roomlist and check all rooms if they are full or none available. Would be a workround.

Thanks!

Comments

  • If you want client to react on JoinRandom fail, you should use OnPhotonRandomJoinFailed message handler. Log is for debug.
    When you get this message, you already have room list loaded in client, so you can simply iterate it. But keep in mind that in theory list can change after server denied JoinRandom and before you get the message.
    OnPhotonRandomJoinFailed has optional object[] parameter with ErrorCode as obj[0] and debug message as obj[1]. You could use ErrorCode for error check and that would be best solution but i'm not sure if codes are different for your cases.