question

tim@ninjatertle.com avatar image
tim@ninjatertle.com asked

SharedGroupData Limits

So I'm in the process of writing a reasonably complicated clan based system using cloud script, with features like ranks and permissions.

I'm basing it on SharedGroups however no members of the clan will actually be part of the group, this is because currently any member of the group can remove any other member of the group and that is a big nono. I need rank based permissions.

Instead I was considering storing members in a single SharedGroupData field, so that they'd be stored like (I'm using typescript):

    var members: string[] = ["characterId1", "characterId2"];
    server.UpdateSharedGroupData({
        SharedGroupId: clanNameId,
        Data: {
            "Members": JSON.stringify(members),
            "TotalMembers": 1,
            "Type": ClanType.Open
        },
        Permission: "Public"
    });

Now I've got it all working, however I'm worried I'll run into issues of size limitations when the clan gets larger. I was aiming for clans of 50 members. Could I get word on the limits per key? I can't see what I'm looking for on  https://playfab.com/limits/ - unless the title/data keys are the same as the sharedgroup keys in which case 10KB would likely be fine. (I believe 1KB would be too small).

 

Ideally I'd love playfab to add a API feature that simply disables the client side shared group API, then I could utilize it to it's full extend within cloud scripts. I need to launch in 2-3months so I can't really wait around for features

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

Could you describe more fully what you mean concerning an "API feature that simply disables the client side shared group API"? As far as I know, what we have right now meets the specified need - that you can create a Shared Group Data ID which is write-able by the server via Cloud Script, while the client cannot write to it in any way.

In answer to your question, Shared Group Data is limited to 100 Keys and yes, those Keys are currently limited to 10KB each. We're actually looking into some possible updates to the player data systems to try to make this simpler all around, so any feedback you have on usage scenarios would be good to have.

4 comments
10 |1200

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

chesstar avatar image chesstar commented ·

Hi,Brendan,I have a question about SGD.Is there a limmit at SGD count?How many shared group data tha player can created?

0 Likes 0 ·
brendan avatar image brendan chesstar commented ·

In general, I'd target having 10 or fewer Shared Group Data objects per player. But it's really the implementation that's usually more important. Can you describe what it is you want to try to use it for? Describing it from the top-down, by explaining the gameplay feature itself, would be the best way to start.

0 Likes 0 ·
chesstar avatar image chesstar brendan commented ·

I'd like to storage some informations of team battle.When the battle finished,the player can read all informations to reward.So can you give me some suggestion?And if there is a limmit of every player shared group data count,could I take some operation to delete it?

0 Likes 0 ·
Show more comments
tim@ninjatertle.com avatar image
tim@ninjatertle.com answered

Maybe I understand it wrong but I was under the assumption that if I create a SharedGroup via the server then add members to the shared group, I thought the members could changed the share group data themselves and/or kick/invite members? (I will thoroughly check this myself now actually)

If this is not the case and shared groups created on server act different to shared groups created by users then that's fantastic and I can use that.

Good to get confirmed data about keys sizes anyway.


Thanks

-edit-

after some tests unfortunately it appears I was correct. Even if the group was created by the server, once the server adds any members to the group they can add/remove members and change group properties. I can't have that.

for me to use shared groups like that I need to be able to disable

client.AddSharedGroupMembers
client.RemoveSharedGroupMembers
client.UpdateSharedGroupData

otherwise it's too open too abuse

As keys are large enough to do what I was currently doing (using empty shared groups on server, with a key storing all members) I'll stick with that solution.

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 - for most uses of Shared Group Data, I would not recommend adding players to the group directly, as that gives the client read/write to the data (meaning a hacked client could write whatever it wants). Instead, I would use Cloud Script to read/write the data, and keep info on the group ID locally.

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.