Queries for GetCustomRoomList

Hi there,

I'm trying to get a list of custom rooms that satisfy the following conditions:

- Any rooms with names NOT in a list rooms.
- Any room that is NOT full (ie. if maxplayers is 2 and there are 2 players in the room, I don't want the query to retrieve the room)

So far I have this to get rooms NOT in a list:
PhotonNetwork.GetCustomRoomList( typedLobby, "C4 NOT IN ( 'room1','room2','room3' )" );
also..I am getting this error so I'm not even sure if I'm doing this right:
GetGameList failed: OperationResponse 217: ReturnCode: -2 (Unknown operation code). Parameters: {}


Can someone help with this query and possibly show the right way to use this method and its callback?

Thank you.

Comments

  • caesarhernandez
    edited May 2019
    ADDED: Forgot to post the typedLobby definition with the code above:
    var typedLobby = new TypedLobby { Name = "mylobby", Type = LobbyType.SqlLobby };
  • Basically I'm trying to solve this problem:

    I don't want a user to join a room they've already joined and left. I'd like to use "JoinRandomRoom" but I don't want the player to rejoin a room they've already played in.

    I hope that makes sense.
  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @caesarhernandez,

    Calling JoinRandomRoom will not make you join a room you are already in.
    GetCustomRoomList does not return full, closed or invisible (unlisted) rooms. It only returns the rooms you can join.

    GetGameList failed: OperationResponse 217: ReturnCode: -2 (Unknown operation code). Parameters: {}
    This error means you are calling the method on the wrong server OR you calling this method on an outdated version (self-hosted Photon Server SDK) where the operation is not implemented.
  • Hi John,

    I think I didn't explain it correctly (or maybe you've told me the answer and I'm not understanding). My goal is to join a room, then leave the room after I've played in it, then NOT rejoin the same room once I'm back in the lobby.

    I basically want to traverse rooms that are available after I've played in them and NEVER play in them again (according to the room name). If there are no more rooms, only then do I want the player to create a room for others to join...etc.

    It seems that "JoinRandomRoom" will put me in the same room I was in after I "LeaveRoom" then call "JoinRandomRoom" from the lobby.

    I hope that makes sense.
  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @caesarhernandez,

    OK, I see.
    This is fine then:
    var typedLobby = new TypedLobby { Name = "mylobby", Type = LobbyType.SqlLobby };
    PhotonNetwork.GetCustomRoomList( typedLobby, "C4 NOT IN ( 'room1','room2','room3' )" );