question

Ozan Yilmaz avatar image
Ozan Yilmaz asked

Deleting player causes GameManager to behave weirdly in Shared Group Data [Possible Bug]

Hello,

I have found that if I delete a player from the game, every shared group that the player was in behaves weird in Shared Group Data. Here's the steps to reproduce it:

- First I create a shared group, add some members and create new data in the group by using the code below:

handlers.TestFunc = function(args, context) {
    // Create a group
    var createGroup = {
        "SharedGroupId": "MyCrew3"
    };
    server.CreateSharedGroup(createGroup);
    
    // Add some members to the group
    var addMembers = {
        "PlayFabIds": ["107C16C4849CBDB0", "563708E09EAA2411", "422090C61E0E393C"],
        "SharedGroupId": "MyCrew3"
    };
    server.AddSharedGroupMembers(addMembers);
    
    // Add a new data to the group
    var updateGroupData = {
        "SharedGroupId": "MyCrew3",
        "Data": {
            "TestKey": 1
        },
        "Permission": "Private"
    };
    server.UpdateSharedGroupData(updateGroupData);
    
    return 1;
};

In GameManager, everything looks normal.

- I delete a player who is in the group by using the code below.

handlers.TestFunc2 = function(args, context) {
    // Delete player
    var deletePlayer = {
        "PlayFabId": "563708E09EAA2411"
    };
    server.DeletePlayer(deletePlayer);
    
    return 1;
};

I refresh the page and search the group again, and GameManager behaves weirdly. It doesn't show any members and the Members section changes. It now shows Owner column. Also, the Data section looks weird too. Here's the result:

I use the code down below to get the shared group data in order to see if the player is still in the group

handlers.TestFunc3 = function(args, context) {
    // Get group data
    var getGroup = {
        "SharedGroupId": "MyCrew3",
        "GetMembers": true,
        "Keys": ["TestKey"]
    };
    var result = server.GetSharedGroupData(getGroup);
    
    return { "Members": result.Members, "TestKey": result.Data["TestKey"].Value };
}

It shows that the player is still in the group. I think, that causes the problem.

(I reached the attachment limit, so here's the screenshot of the result: https://i.ibb.co/tJpRGKL/03.jpg )

- I use the code down below to delete the player from the shared group to see if it will work normally again.

handlers.TestFunc4 = function(args, context) {
    var removePlayer = {
        "PlayFabIds": ["563708E09EAA2411"],
        "SharedGroupId": "MyCrew3"
    };
    
    server.RemoveSharedGroupMembers(removePlayer);
    
    return 1;
}

I refresh the page and search the group, and everything turns back to normal.

(Screenshot link: https://i.ibb.co/18ymYDJ/04.jpg )

So, this means that if I want to delete a player, I need to delete the player from all the shared groups that they were in as well. In my case, this never happens to me if I setup everything correctly, but a fix would be great too, at least a warning message showing that a member was deleted.

01.jpg (135.6 KiB)
02.jpg (126.2 KiB)
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

·
Citrus Yan avatar image
Citrus Yan answered

Thanks for your feedback on this, we are currently investigating this issue, for now, please use APIs as a workaround instead.

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.