Ejemplo n.º 1
0
        public static void UpdateInternalUserPublisherData(string playFabId, string userPublisherDataKey, string userPublisherDataValue)
        {
            if (string.IsNullOrEmpty(userPublisherDataValue))
            {
                userPublisherDataValue = null; // Ensure that this field is removed
            }
            var updateInternalRequest = new ServerModels.UpdateUserInternalDataRequest();

            updateInternalRequest.PlayFabId = playFabId;
            updateInternalRequest.Data      = new Dictionary <string, string>();
            updateInternalRequest.Data[userPublisherDataKey] = userPublisherDataValue; // Multiple keys accepted, unlike this example, best-use-case modifies all keys at once when possible.

            PlayFabServerAPI.UpdateUserPublisherInternalData(updateInternalRequest, UpdateInternalUserPublisherDataCallback, PfSharedControllerEx.FailCallback("UpdateUserPublisherInternalData"));
        }
Ejemplo n.º 2
0
        public void UpdateUserInternalData()
        {
            var updateRequest = new ServerModels.UpdateUserInternalDataRequest()
            {
                PlayFabId = PfSharedModelEx.globalClientUser.playFabId,
                Data = new Dictionary<string, string>()
        {
            {"Class", "Fighter"},
            {"Race", "Human"},
        },
            };

            PlayFabServerAPI.UpdateUserInternalData(updateRequest,
                (result) =>
                {
                    Debug.Log("Set internal user data successful");
                },
                (error) =>
                {
                    Debug.Log("Got error updating internal user data:");
                    Debug.Log(error.ErrorMessage);
                }
            );
        }
Ejemplo n.º 3
0
        public static Action UpdateInternalUserPublisherData(string playFabId, string userPublisherDataKey, string userPublisherDataValue)
        {
            if (string.IsNullOrEmpty(userPublisherDataValue))
                userPublisherDataValue = null; // Ensure that this field is removed

            Action output = () =>
            {
                var updateInternalRequest = new ServerModels.UpdateUserInternalDataRequest();
                updateInternalRequest.PlayFabId = playFabId;
                updateInternalRequest.Data[userPublisherDataKey] = userPublisherDataValue; // Multiple keys accepted, unlike this example, best-use-case modifies all keys at once when possible.

                PlayFabServerAPI.UpdateUserPublisherInternalData(updateInternalRequest, UpdateInternalUserPublisherDataCallback, PfSharedControllerEx.FailCallback("UpdateUserPublisherInternalData"));
            };
            return output;
        }