question

justas.antanauskas@gmail.com avatar image
justas.antanauskas@gmail.com asked

(SOLVED) Server. AddSharedGroupMembers. Service Unavailable

Hi, im trying to make asynchronous matchmaker using shared groups, but im failing to do it on cloud script, because im getting exceptions. It seems its not working here too.
https://api.playfab.com/Documentation/Server/method/AddSharedGroupMembers
when i try to add someone to existing group i get this:

 "code": 503,
 "status": "Service Unavailable",
 "error": "Connection error",
 "errorCode": 2,
 "errorMessage": "",
 "CallBackTimeMS": 493

Edit:
Nevermind i found out, i need to add user as string array like this ["5EC9785CE4829D3D"]. Now i need to figure out how to handle exceptions inside cloud script.

10 |1200

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

brendan avatar image
brendan answered

We would definitely recommend use of Try/Catch, to catch the errors from exceptions and log the info out about them. We'll have more debugging options available later this year.

In the meantime, two items on the use of Shared Group Data, given your desired goal:

1. You really shouldn't use AddSharedGroupMembers for any data which would cause a problem if a hacked client modified it, as the Add... call gives the client read/write access to the data.

2. Bear in mind that Shared Group Data cannot be used the way Title Data can - with all users in the title accessing the same data. You'll need to subdivide your users into logical groups of no more than 100 for what it looks like you're describing to work. If you'd like to talk through the design in more detail, please do let us know.

10 |1200

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

justas.antanauskas@gmail.com avatar image
justas.antanauskas@gmail.com answered

Thanks for the reply. I'm trying to make a somewhat global asynchronous matchmaker that could encompass big population of players. I would use shared data only to find added members, there would be no modifications of group data itself, except for adding/removing members. Would it reduce the stress on servers and maybe i could use >100 users for it? What is maximum for it to be in a reasonable range? Is there a limit to members count in the group? Right now I'm mostly experimenting with it and I expect it may not reach my needs so I would need to fragment into smaller groups as you say.

10 |1200

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

brendan avatar image
brendan answered

Thanks, that's what I figured. Shared Group Data really cannot be used this way. The short explanation is that Shared Group Data, like user data, was designed to be updated and read by clients at any time, so it operates the same way User Data does - having one entry, so that there aren't sync issues. By contrast, Title Data can only be read by users (adding a player is an update), so it can effectively be sharded and cached across many servers safely. If high volumes of players were to access a single-source piece of data at the same time, the calls would backlog as it's not physically possible for the single source to serve all the requests simultaneously.

We'll be providing an async matchmaker later this year. For now, I would recommend using Photon Turnbased to enable async match. Here's a fairly detailed thread where were discussed this: https://community.playfab.com/hc/en-us/community/posts/207129407-Persistent-turn-based-games-

10 |1200

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

justas.antanauskas@gmail.com avatar image
justas.antanauskas@gmail.com answered

From what i understand, if both players leave the lobby, Photon Turnbased rooms exists for 1 hour. It won't work with non-active population.

Here is how my game will work: a player could post a challenge of their game publicly, he plays it alone and his actions are recorded. He could leave the game ant won't be active for a long time. Other player, rather than making his own challenge, could get matched up with the first player to complete his challenge and that game will be complete for both players even if first player wasn't active for a long time. So yeah, i think asynchronous matchmaking using shared group will work for small inactive population and when population gets big enough, Photon Turnbased matchmaker will have to take over (until you guys finish your asynchronous matchmaker).

10 |1200

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

brendan avatar image
brendan answered

Correct - the TTL for Lobbies in Photon is up to 65 minutes. If your game design + population is such that a player could ask for a match and not get one for an hour, I would actually recommend (way before the 60 minute mark) that you provide the player with an AI opponent. There's little chance, if multiplayer is a key part of the gameplay, that a player will continue to stick with the game if they can't actually find anyone to play with. An AI opponent can fill that gap nicely.

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.