So what i need to do is getting room informations without running a for loop and yes i do know name of the rooms. I am hosting those rooms at my own servers.
The reason why i dont want to use a for loop is i was using a very simple for loop that i found at Photon documents and somehow that for loop is not working. Also if there is anyway to get room information with specifying the room name that would be much more stable for my situation.
If you want to do matchmaking, you should have a closer look at the server side Random Matchmaking.
It can be used with your own filters and you can probably solve your situation without even getting the room list to the client.
In doubt, explain what you want, not what you want to avoid.
Thanks for the reply,
The reason I wanted to avoid for loop is i am not very familiar with Photon API so i dont know what type of loop i am supposed to run.
I found an example from your documents âhttp://doc-api.exitgames.com/en/onpremise/current/pun/doc/general.htmlâ but it seems to be not working. If there is any way to make it run, that could solve my issue from all aspects.
At the meantime what i am trying to do until i find a way to fix that for loop issue getting count of players number connected to that room. I know roomâs name, their ips and all that information since im hosting rooms at my own servers as a master client.
But, as i said;
If there is any way to fix that foreach loop that could solve my issue from all aspects and that could even give me more possibilities to create a better matchmaking service.
You have the IP addresses listed? Why that? Photon gives you the IP when the client wants to join a particular room.
I still donât know what the problem is. The for loop does not work. Which one? With which values?
Check out this post, if you want to use Photonâs lobby:
http://forum.photonengine.com/discussion/6426/
Okay, sorry for the misunderstanding.
I have the ip adresses of the master clients of those rooms because i am the only one who is able to create a room and i host my rooms in my own dedicated servers to make it run 24/7. What i mean by i have the ip adresses is that; I have every single information related to the master clients of the rooms if i need it inorder to get room infos. I am not telling these just to tell people that i have got dedicated servers⌠What im trying to say is;
I just need answer for this question;
How can i get the room information of a specific room such as connected player amount? I just need to get connected player amount of a specific room.
Oh btw here is the link of the broken for loop: http://doc-api.exitgames.com/en/onpremise/current/pun/doc/general.html there is a foreach loop to show rooms as a list, that script example is not working.
As long as a client is in a Lobby in Photon, you get the list of rooms of that lobby. You can loop through this list with:
foreach (RoomInfo roomInfo in PhotonNetwork.GetRoomList()) {}
The list wonât be set if you are in a room or not in a lobby. Find the PhotonServerSettings object in your project and set âAutoJoinLobbyâ.
Check out the Worker Demo for a showcase.
I donât understand where you stuck and I feel like this should be enough info and demo code to implement what you need.
Let me know where youâre stuck.
you gotta delete these links i swear every one is dead lol
From a four year old post itâs hardly surprising 
1 Like
That is true⌠But you know If I ran a company I wouldnt want to have invalid information anywhere. Guess thats just my 2 cents, glad you had to throw yours in too.