Getting player count before connecting
Is it possible to poll all connected rooms and see how many players are in each so I can Connect a new player joining to a room that is not "full" (eg below a threshold I set)? I saw there is a Lobby API in testing last year, as well as a Rooms API in beta?
5 Replies
Hi @khoi. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Based on the knowledge sources provided, there isn't currently a built-in way to poll all connected rooms and see how many players are in each before connecting. This is specifically addressed in the Architecture Common Questions section:
How do I get a list of all rooms and how many players are in them? This is something we're working on, but for the time being, it's something you'll need to manage yourself.Architecture Common Questions While there is mention of a Matcher class in the documentation that handles room connections, it doesn't provide public methods for querying room occupancy before connecting. You would need to implement your own solution to track room occupancy. One approach could be to use a separate system (like a database or web service) where your application reports the number of players in each room. New players could query this system before deciding which room to join. If you're using Normcore Private, you might have additional options available, as it offers more customization and metrics capabilities:
Get metrics about usage (Want to charge users when they are on your app? Track usage with the Normcore Private metrics API.)Normcore Private The documentation does mention that they're working on this feature, so it may become available in a future update. If this functionality is critical for your application, you might want to reach out to Normal directly at help@normalvr.com as suggested in the Room Server Options documentation. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
<@412870643533479936> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
bummer
We’ve got a lobby API that’s in alpha that solves this, but we’re slowly getting the API perfect before it ships
alright we'll write to our db for now