Problem with PhotonNetwork.GetCustomRoomList

Options
Hello, I can't make it work for any reason. I'm sure I'm missing something but I can't figure it out:

- First time I call to FindPrivateRoom (calls to GetCustomRoomList) it works fine, no rooms are found and it creates the room with the roomCode.
- I think I'm creating the room with the CustomRoomProperties and CustomRoomPropertiesForLobby fine.
- Next call to GetCustomRoomList with de "roomCode" it fails and returns this error:

"GetGameList failed: Operation response 217. Return code -2 (SQL logic error or missing database
no such column: roomCode). Parameters: {}

I followed the example on https://doc.photonengine.com/en-us/pun/v2/lobby-and-matchmaking/matchmaking-and-lobby

The code is the next:
private TypedLobby _defaultLobby = new TypedLobby("myLobby", LobbyType.SqlLobby);
private static string ROOM_CODE = "roomCode";

public void CreateRoom(string strName, string strRoomCode)
        {
            RoomOptions roomOptions = new RoomOptions();
            roomOptions.MaxPlayers = this.maxPlayersPerRoom;
            roomOptions.CustomRoomProperties = new Hashtable { { ROOM_CODE, strRoomCode } };
            roomOptions.CustomRoomPropertiesForLobby = new string[]{ ROOM_CODE };
            PhotonNetwork.CreateRoom(strName, roomOptions, _defaultLobby);
        }

 public void FindPrivateRoom(string strRoomCode)
        {
            PhotonNetwork.GetCustomRoomList(_defaultLobby, ROOM_CODE + " = '" + strRoomCode + "'");
        }

public override void OnRoomListUpdate(List<RoomInfo> roomList)
        {            
                // create or join to password room
                foreach (RoomInfo info in roomList)
                {
                    // is a join, find an opened room and join
                    if (info.IsOpen)
                    {
                        Debug.Log("room already open")
                        return;
                    }
                }
               // no room found, create it
                CreateRoom(null, currentRoomName);
        }
Anyone can find what is happening?

Thank you!

Comments

  • kanowins
    Options
    I figured out what is happening. The problem was the field name "roomCode". I have changed this line and everything is working fine now.

    private static string ROOM_CODE = "C0";