Schema of a Unique Rooms App

Hi everyone,

I am trying to develop a game application in which each player can join a room via a unique code.

My question is first of all to know if this is possible and if so, how to build the process. I started by generating a series of random numbers as soon as a nickname was created by one of the players and storing it in a backend part via Rest API.
Then, the players enter the generated number and I use a formula to display only the players with this room code to then validate and create the team.

I have not yet found which formula exactly to define but I would like your opinion to know if I am on the wrong track to achieve my goal.

I will try to give more information if I have not been clear enough.
Thanks for your help !

1 Like

GENERATE_UUID() gives unique numbers. The team leader can sign up and choose to create a team, enter a public name for the team, and generate the private code to send to the team members. The members can sign up and choose to join a team with the code. They don’t have to enter the name of the team, the code will identify it. The leader could regenerate the code, if it was leaked.

teams: [{
id: "71dae703-d2b3-416a-8e13-40aecf2875a3",
name: "Team Red",
joincode: "00dd16c5-bcb6-4b90-853e-9137770c679c",
captain: "a3b19114-eaf2-44e5-949b-eb5b0022abbe",
id: "6fc0e33a-6792-4aaa-a5d8-2982e1c384d8",
name: "Team Bronze",
joincode: "8861d7ad-e40a-4455-84fc-aefa9cc19d61",
captain: "091046e0-f837-4972-935d-697b94a8f443",
players: [{
id: "a3b19114-eaf2-44e5-949b-eb5b0022abbe",
name: "Zak",
team: "71dae703-d2b3-416a-8e13-40aecf2875a3",
id: "5f7b9106-6d75-43dd-922b-9f326a25cc5a",
name: "Pip",
team: "71dae703-d2b3-416a-8e13-40aecf2875a3",
id: "091046e0-f837-4972-935d-697b94a8f443",
name: "Sed",
team: "6fc0e33a-6792-4aaa-a5d8-2982e1c384d8",