Heres what i am trying to do. I am creating a room in Unity Photon by passing in room optiosn and sqllobby. That does work but when i try to call GetRoomList, its empty. Is there no way of getting the list of rooms?
http://forum.exitgames.com/viewtopic.php?f=17&t=4829
What I wanted to do was something like this, so that i would be able to show how many players were in a room with that gametype. But apparently getroomList does not work with the sqllobby type.
{
if(playersOnlineText)
{
int playersInRoom = 0;
RoomInfo[] roomInfo = PhotonNetwork.GetRoomList();
int roomCount = 0;
if(playersOnlineText)
{
playersOnlineText.text = "Connected to Photon";
}
for(int i=0; i<roomInfo.Length; i++)
{
if(roomInfo[i].open)
{
ExitGames.Client.Photon.Hashtable h = roomInfo[i].customProperties;
int gameType = (int)h["C1"];
if(gameType==Constants.getGameType())
{
roomCount++;
}
}
if(playersOnlineText)
{
playersOnlineText.text = "Players in Room:" + roomCount;
}
}
}
Okay I solved it turns out all i had to do was set the autoJoinLobby to false
PhotonNetwork.autoJoinLobby=false;
And then add
voidOnConnectedToMaster()
{
Debug.Log (“onConnectedToMaster”);
TypedLobbysqlLobby = newTypedLobby(“MyLobby”, LobbyType.SqlLobby);
PhotonNetwork.JoinLobby(sqlLobby);
}