question

Jason Crandall avatar image
Jason Crandall asked

Storing List of Join Codes on the Server

I am trying to find a way to implement join codes, which will be 6 digit alphanumerical string. I want to generate these codes when the server is started, and store them as a key-value pair with the ip and port somewhere on Playfab. This way, when a client enters the code, it will send a request with the code, and receive the information it needs in return to connect to that server.

The part I am stuck on is finding where to store this information. I have been looking into CloudScripts, but that seems more client focused. What is the best way to go about doing this?

multiplayer
10 |1200

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

Rick Chen avatar image
Rick Chen answered

A simple solution is to use the Shared Group Data. You can create a Shared Group for each join code and use the join code as id. Then you can store the ip, port and other data into the Shared Group Data, you can set the data permission to “Public” such that non-member accounts can access the data. After that, the Clients can use the GetSharedGroupData API and enter the join code to get the ip and port data.

10 |1200

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

Rick Chen avatar image
Rick Chen answered

You mentioned that your server will generate the join codes when it starts, could you describe how do the clients receive the join codes?

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.