question

tobias-nerg avatar image
tobias-nerg asked

Best solution for a key/value storage for a title

Hello!

I Am currently implementing multiplayer with PlayFab Party and players should be able to join a specific Game based on the networkId provided by party.

The problem is that the networkId is very long, and certain rich presence services only allows a maximum of 128 characters to provide your game credentials so other can join you.

I'm looking into a solution where a client can execute a cloudscript that takes the networkId as input, and gives back a ~9 character gameId which can be used by players to join the game.

This "Map" of course needs to be:

* Persistant, gameId <> networkId pairs should be alive as long as the network exists.

* Scaleable

* Maintainable, remove networkIds that has existed for more than x amount of time.

When scrummimg through the Playfab Universe most data seems to either be tied to Players, or the Title, where title data is not meant to be updated regurarily.

This data wouldn't make sense to tie to a player either, since then the one joining would need to know the PlayerId rather than the GameId.

My question is:

Have I overlooked any service that fits the criteria above? Or would it be better to use some other service like Azure Tables to keep track of this "living map"?

10 |1200

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

1 Answer

·
Sarah Zhang avatar image
Sarah Zhang answered

According to your description, you need a global data storage that supports being updated and retrieved in real-time, is it right? If so, as you said, PlayFab doesn’t provide built-in supports for such data storage, you can consider implementing such features using PlayFab CloudScript using Azure Functions with Azure Cosmos DB together. You can check the documentation - PlayFab CloudScript using Azure Functions Quickstart Guide - PlayFab | Microsoft Docs to integrate Azure functions with PlayFab can check the documentation - Serverless database computing with Azure Cosmos DB and Azure Functions | Microsoft Docs to learn about how to integrate Cosmos DB with Azure Functions.

Besides, if you need to use PlayFab data storage to store the NetworkId within a player group, the threads below discussed the workaround that storing the NetworkIds as keys in the PlayFab Shared Groups. You can check these for reference.

Share NetworkId to an other player with Unity Party Plugin - Playfab Community

How to invite friends in to Party in Unity? - Playfab Community

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.