What happens when I add a list of expected users counting more than the Max Player Per Room option?

Options
RoomOptions newRoomOptions = new RoomOptions();
newRoomOptions.PublishUserId = true;
newRoomOptions.MaxPlayers = maxPlayersPerRoom;
PhotonNetwork.CreateRoom(gameRoomName, newRoomOptions, TypedLobby.Default, friendIDs);

what if friendIDs.length is greater than maxPlayersPerRoom? Do user get to create the room or an error is formed?

Best Answer

  • JohnTube
    JohnTube ✭✭✭✭✭
    Answer ✓
    Options
    Hi @CreativeMango,

    Thank you for choosing Photon!

    Well doesn't hurt to test/try it.

    The room creation will fail and you will get an error response.
    If you implement the OnCreateRoomFailed callback you will get an error code: InvalidOperation = -2 and error message: "Reserved slots count is bigger then max player value".

Answers

  • JohnTube
    JohnTube ✭✭✭✭✭
    Answer ✓
    Options
    Hi @CreativeMango,

    Thank you for choosing Photon!

    Well doesn't hurt to test/try it.

    The room creation will fail and you will get an error response.
    If you implement the OnCreateRoomFailed callback you will get an error code: InvalidOperation = -2 and error message: "Reserved slots count is bigger then max player value".
  • CreativeMango
    edited April 2020
    Options
    Thanks a lot. Tested it with Facebook on editor but somehow that didn't work. Later I found that it's due to Facebook SDK. I did a lot of study regarding this but found the reason afterward. Sorry for being too much eager to know :blush:
    Thought of a solution for this though. Will test if.
    Thank you very much :smile:
  • by the way, really becoming a fan of Photon :smiley:
    !st tried with playfab, but now integrated with firebase features and facebook. works like a charm :smiley: