예제 #1
0
        public static void SetTitleInternalData(string titleDataKey, string titleDataValue)
        {
            if (string.IsNullOrEmpty(titleDataValue))
            {
                titleDataValue = null; // Ensure that this field is removed
            }
            // This api-call updates one titleData key at a time.
            // You can remove a key by setting the value to null.
            var updateRequest = new ServerModels.SetTitleDataRequest();

            updateRequest.Key   = titleDataKey;
            updateRequest.Value = titleDataValue;

            PlayFabServerAPI.SetTitleInternalData(updateRequest, SetInternalTitleDataCallback, PfSharedControllerEx.FailCallback("SetTitleInternalData"));
        }
예제 #2
0
        public static Action SetTitleData(string titleDataKey, string titleDataValue, bool internalData = false)
        {
            if (string.IsNullOrEmpty(titleDataValue))
                titleDataValue = null; // Ensure that this field is removed

            Action output = () =>
            {
                // This api-call updates one titleData key at a time.
                // You can remove a key by setting the value to null.
                var updateRequest = new ServerModels.SetTitleDataRequest();
                updateRequest.Key = titleDataKey;
                updateRequest.Value = titleDataValue;

                if (internalData)
                    PlayFabServerAPI.SetTitleInternalData(updateRequest, SetInternalTitleDataCallback, PfSharedControllerEx.FailCallback("SetTitleInternalData"));
                else
                    PlayFabServerAPI.SetTitleData(updateRequest, SetTitleDataCallback, PfSharedControllerEx.FailCallback("SetTitleData"));
            };
            return output;
        }