Android device connecting to a separate private room in which no one can join

Options
Sometimes my device is creating a separate room even though rooms are available and the room which it creates seems to be private and no one else can join it. It stays like that for next 3-4 hours and whenever I try next day, it starts working fine. Could you please help ?

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @Gaurav Shekhar,

    I'm assuming you're using a Realtime AppID with PUN, trying to join random rooms but if that fails you create a new one. The issue you're describing is that sometimes you create rooms no other player can join. And according to you this random matchmaking issue persists for few hours.

    Please verify if the above summary is correct and provide the following information:
    - Region to which you're connected.
    - LobbyType you use when creating rooms.
    - RoomOptions you use when creating rooms.
    - The code you use to join random rooms.
  • 1 -- Connecting to best available region - Asia
    2 -- Default Lobby type
    3 -- Custom Room Property for Gamemode : FFA & 2vs2

    4 --
    // For Joining to a random room
    ExitGames.Client.Photon.Hashtable expectedCustomRoomProperties = new ExitGames.Client.Photon.Hashtable() { { RoomProperty.GAMEMODE, GameModes.TwoVsTwo.ToString() } };

    PhotonNetwork.JoinRandomRoom(expectedCustomRoomProperties, MultiplayerConstants.TWO_VS_TWO_MAX_PLAYERS);

    void OnPhotonRandomJoinFailed()
    {
    Debug.LogError ("OnPhotonRandomJoinFailed...... So Creating new room");
    // Room properties that we want to be visible to the lobby which will be ultimately used in the matchmaking system.
    string[] roomPropsInLobby = { RoomProperty.GAMEMODE, RoomProperty.PLAYER_RATING };

    ExitGames.Client.Photon.Hashtable customRoomProperties = null;

    // Add the game mode to the room property for match-making.
    switch(CurrentGameModeBeingPlayed)
    {
    case GameModes.TwoVsTwo:
    customRoomProperties = new ExitGames.Client.Photon.Hashtable() { { RoomProperty.GAMEMODE, GameModes.TwoVsTwo.ToString() } };
    maxAllowedPlayers = MultiplayerConstants.TWO_VS_TWO_MAX_PLAYERS;
    break;
    case GameModes.FFA:
    customRoomProperties = new ExitGames.Client.Photon.Hashtable() { { RoomProperty.GAMEMODE, GameModes.FFA.ToString() } };
    maxAllowedPlayers = MultiplayerConstants.FFA_MAX_PLAYERS;
    break;
    }

    PhotonNetwork.CreateRoom("", true, true, 4, customRoomProperties, roomPropsInLobby);
    }