question

Dominic Moret avatar image
Dominic Moret asked

Where to save a list of all running matches

I'm trying to implement my custom matchmaking/lobbying with Cloud Script.

The reason why I'm not using to available matchmaking is because I want that the first player who wants to play already starts a new match (with RequestMultiplayerServer) and enters the level until enough players are in the lobby. Than the actual match starts. If I use matchmaking, I can only start the game when 2 players have matched.

If there is another way to make this work with the inbuilt matchmaking, please let me know.

If not, I want to save a list containing every active match/server (and some corresponding data, like the game mode (FFA, CTF), which map, max. allowed players etc.

My question is, where can I save this list? In Title data? I read that updating this shouldn't happen too often.

I think this is not possible with the ListMultiplayerServers function, or can I store custom data through the RequestMultiplayerServer function

Thanks for your help

Title DatadataMatchmaking
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Citrus Yan avatar image
Citrus Yan answered

Correct, you cannot store some custom data that is available for ListMultiplayerServers , or even GetMultiplayerServerDetails, via the RequestMultiplayerServer API. For your case, you’d need an external data table, such as Redis, to manage the status of all running matches(servers).

4 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Dominic Moret avatar image Dominic Moret commented ·

Would it be bad practice to just create a custom player and save the data in the player data and access it through CloudScript?

Too bad that such a basic feature isn't available.

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan Dominic Moret commented ·

That's definitely not recommended. Here is a workaround: since you can get ConnectedPlayers in MultiplayerServerSummary from ListMultiplayerServers, just save the data in those connected players (in player data, or entity objects) and access it later.

1 Like 1 ·
Dominic Moret avatar image Dominic Moret Citrus Yan commented ·

Would this work even if two players start the game (almost) at the same time? Or does it take some time after ReqiestMultiplayerServer until ListMultiplayerServers returns the newly requested server?

0 Likes 0 ·
Show more comments
laggyluk avatar image
laggyluk answered

What I did for time being is that first player starts the matchmaking and if it times out then he requests server allocation, not ideal but gotta work with something.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.