예제 #1
0
    public void updateLeaderboardValue(string value)
    {
        Debug.Log("start updating leaderboard with value " + value);
        Dictionary <string, string> updateDic = new Dictionary <string, string>();

        updateDic.Add(PlayFabId, value);


        UpdateSharedGroupDataRequest _sharedGroupInvite = new UpdateSharedGroupDataRequest()
        {
            SharedGroupId = PlayerPrefs.GetString("last_saved_leaderboard"),
            Data          = updateDic
        };



        PlayFabClientAPI.UpdateSharedGroupData(_sharedGroupInvite, (result) => {
            Debug.Log("update leaderboard succes!");
        },
                                               (error) => {
            Debug.Log("error by updating leaderboard");
            Debug.Log(error.ErrorMessage);
            Debug.Log(error.ErrorDetails);
        });
    }
        public static async Task <TicTacToeSharedGroupData> UpdateAsync(PlayFabAuthenticationContext context, TicTacToeSharedGroupData data)
        {
            var request = new UpdateSharedGroupDataRequest
            {
                AuthenticationContext = context,
                Data          = ConvertSharedGroupDataToStringDictionary(data, Constants.SHARED_GROUP_DATA_DICTIONARY_ENTRY_NAME),
                SharedGroupId = data.SharedGroupId
            };

            await GetPlayFabServerInstanceAPI().UpdateSharedGroupDataAsync(request);

            return(data);
        }