#Lobby management with additional data

1 messages · Page 1 of 1 (latest)

main plume
#

Hi, I'm trying to create a basic lobby / session system and display all the information needed on the UI while using UGS packages.
To make it simple I need to create a normal lobby but I need to add an additional information for the gamemode. I have seen that to create a lobby you can add SessionProperties in a dictionary, but those properties can only be checked when filtering a query with QuerySessionsAsync().
When I update the UI I want to display also the gamemode for that lobby, but the problem is that the query returns a List<ISessionInfo> and it seems like there is no way of retrieving the SessionProperties through the interface...
Does anyone know a way to add some data and then retrieve it without having to do multiple queries?

torpid herald
#

Yea, that's a known issue. But you can add multiple FilterOptions to your Session Query in order to get all the data you need

main plume
#

Hmm, that makes sense but since I don't really want to have problems with rate limits (even though I know they are pretty high), maybe the best solution as of now would be to go back to the old Lobbies package that uses the Lobby class as a return type from the query and the Properties added can be both read and written? Or there is a way to implement a "hybrid" solution?

torpid herald
#

Its still just one query with multiple filters. But you can also still use LobbyService.Instance if you really need to

main plume
#

I'm not really sure I got it right. Let's say the "additional data" I want to add is a gamemode. When I query for the lobbies I don't apply any filter (at least in this scenario) and when I display each lobby I want to also display a text with the gamemode. Are you saying that I should make as many queries as gamemodes I have (each with the single gamemode filter) and then display them together?

torpid herald
#

No, just one query with a filter for each game mode. Filter options is a list in the session query

main plume
#

Ok, I know that you can query with a list of filters, but my problem is slightly different...
Once I have done:


return result.Sessions;```
The return type is an IList<ISessionInfo>, then I want to call a method to update the UI of the lobbies available and I pass in the List as a parameter.
I can easily update the name of the lobby and the number of available slots, but not the "additional data" of the gamemode.
So my idea was to make a a query with just the gamemode filter, so that I know that the lobbies return are from a specified gamemode.
Now I can update my UI passing in the result of each different query and specifying the gamemode used in the filter.
If I were to filter all the gamemodes together I wouldn't be able to know which lobby has which gamemode because ISessionInfo is doesn't expose the "gamemode" data.
Please tell me if I managed to explain myself...
torpid herald
#

Right, I see now. Yea, if you want to display all the game modes at the same time you would need multiple queries. I would make tabs for each mode, that would help space out the queries to avoid the rate limit.

It might be easier to use the lobby service directly instead of using sessions