question

appgame avatar image
appgame asked

Will not Update User Data: server.UpdateUserData({});

Hello,

Will not Update User Data: server.UpdateUserData({});

Attempting to fill ID10 value for LiveGame.


var getMatchResult = multiplayer.GetMatch({});
GetMatch->JSON.stringify(getMatchResult); 


var F = server.GetUserData({ PlayFabId: args.PlayFabId });
F.Data["ID10"] = JSON.stringify(getMatchResult);
GameData = F;


var Update = server.UpdateUserData({
    "PlayFabId": args.PlayFabId,
    "Data": GameData,
    "Permission": "Public"
});
1 comment
10 |1200

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

appgame avatar image appgame commented ·

Hello

  • Missing .Data
    varUpdate= server.UpdateUserData({
    	"PlayFabId": args.PlayFabId,
    					/** "Data": GameData, **/
    	"Data":GameData.Data,
    	"Permission":"Public"
    });
    <br>
    • Data key/value pairs
    DataVersion (#11) & PlayFabId (#12) are both PlayFab's Key/Value and are counted against the max limit of 10.
    
    • Real Limit is 8 if not to Delete (#11) & (#12) before UpdateUserData request.
    The number of player data key/value pairs which may be updated in a single request is limited to 10

    0 Likes 0 ·
    datawrite3.png (68.8 KiB)

    1 Answer

    ·
    appgame avatar image
    appgame answered
    Hello
    
    Obviously thought UpdateUserData() would OVER-WRITE all key/value pairs.
    
    
    "Good to know" its NOT SAME as server.SetFriendTags().
    
    
    
    /** Single Key/Value UpdateUserData() request **/
    
    
    if( args.WriteData != undefined ){
      EditedData[args.SavedID] = args.WriteData;
      UpDate = 1;
    }
    
    var Update = server.UpdateUserData({
        "PlayFabId": args.PlayFabId,
        "Data": EditedData,
        "Permission": "Public"
    });
    
    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.