How to make a Global Lobby System using MemoryStores

:hibiscus: Hello, I’m working on a Lobby system and I recently discovered Memory Stores. I’ll explain how my game works.

  1. A player makes a game and configures it
  2. The game info is stored permanently on a Datastore
  3. The game can be later opened by its creator allowing people to join (Lobby system)
  4. The lobby creator starts the game and people who joined can start playing
  5. The lobby can be removed from the memory store as the game no longer accepts more players
  6. Once the game is finished the game can also be removed from the Datastore

I already did the first two steps, but I have no clue on how to make the lobby system (It needs to be stored in a Memory Store globally along every server) until the game starts. I need to use memory stores because the lobby has to be visible to every server.

:heart: Thanks for helping me!

2 Likes

:grey_question: For anyone wondering: its very easy, even if it looks hard :joy:

So, as described inside of MemoryStores documentation you should be using Sorted Maps.

They work like a datastore but Data can be readen faster, more times and isn’t fully permanent (so it’s perfect for a temporary lobby system!).

Here you go, if someone wants me to explain how I achieved it thought code reply to this response. Have a great day! :happy2:

1 Like

Can you help me out? I’m trying to make a lobby system so getting a point of reference would be helpful.

1 Like

Sure, feel free to ask me anything!

So I understand it somewhat now, but I would just like to see how another person would do it. Mainly because of performance and restrictions

Like updating the player count in the server data and stuff

Will send you an example once I finish it :+1:t2:

Just letting you know that I’m almost done and I will send you an example in some time! :heart:

I would like an example too of how it would work since I am also currently working on a cross-server matchmaking system. :slight_smile:

1 Like

:happy1: Working on it! School is slowing me down tho…

1 Like

I actually managed to get it working

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.