예제 #1
0
        public static void GetCloudScriptRevision(GetCloudScriptRevisionRequest request, Action <GetCloudScriptRevisionResult> resultCb, Action <EditorModels.PlayFabError> errorCb)
        {
            var titleId     = PlayFabEditorDataService.envDetails.selectedTitleId;
            var apiEndpoint = String.Format("https://{0}{1}", titleId, PlayFabEditorHelper.TITLE_ENDPOINT);

            PlayFabEditorHttp.MakeApiCall <GetCloudScriptRevisionRequest, GetCloudScriptRevisionResult>("/Admin/GetCloudScriptRevision", apiEndpoint, request, resultCb, errorCb);
        }
예제 #2
0
        public static void GetTitleData(Action <GetTitleDataResult> resultCb, Action <EditorModels.PlayFabError> errorCallback)
        {
            var titleId     = PlayFabEditorDataService.envDetails.selectedTitleId;
            var apiEndpoint = String.Format("https://{0}{1}", titleId, PlayFabEditorHelper.TITLE_ENDPOINT);

            PlayFabEditorHttp.MakeApiCall <GetTitleDataRequest, GetTitleDataResult>("/Server/GetTitleData", apiEndpoint, new GetTitleDataRequest(), resultCb, errorCallback);
        }
예제 #3
0
        public static void CreateTitle(CreateTitleRequest request, Action <RegisterAccountResult> resultCallback,
                                       Action <EditorModels.PlayFabError> errorCallback)
        {
            var token = PlayFabEditorDataService.accountDetails.devToken;

            request.DeveloperClientToken = token;
            PlayFabEditorHttp.MakeApiCall("/DeveloperTools/User/CreateTitle", PlayFabEditorHelper.DEV_API_ENDPOINT, request, resultCallback, errorCallback);
        }
예제 #4
0
        public static void GetStudios(GetStudiosRequest request, Action <GetStudiosResult> resultCallback,
                                      Action <EditorModels.PlayFabError> errorCallback)
        {
            var token = PlayFabEditorDataService.accountDetails.devToken;

            request.DeveloperClientToken = token;
            PlayFabEditorHttp.MakeApiCall("/DeveloperTools/User/GetStudios", PlayFabEditorHelper.DEV_API_ENDPOINT, request, resultCallback, errorCallback);
        }
 public static void ImportLatestEdEx()
 {
     PlayFabEditorHttp.MakeDownloadCall("https://api.playfab.com/sdks/download/unity-edex-upgrade", (fileName) =>
     {
         AssetDatabase.ImportPackage(fileName, false);
         Debug.Log("PlayFab EdEx Upgrade: Complete");
     });
 }
예제 #6
0
 private static void GetLatestSdkVersion()
 {
     if (string.IsNullOrEmpty(latestSdkVersion))
     {
         PlayFabEditorHttp.MakeGitHubApiCall("https://api.github.com/repos/PlayFab/UnitySDK/git/refs/tags", (version) =>
         {
             latestSdkVersion = version ?? "Unknown";
         });
     }
 }
        public static void ImportLatestSDK()
        {
            PlayFabEditorHttp.MakeDownloadCall("https://api.playfab.com/sdks/download/unity-via-edex", (fileName) =>
            {
                Debug.Log("PlayFab SDK Install: Complete");
                AssetDatabase.ImportPackage(fileName, false);

                PlayFabEditorDataService.envDetails.sdkPath = PlayFabEditorHelper.DEFAULT_SDK_LOCATION;
                PlayFabEditorDataService.SaveEnvDetails();
            });
        }
예제 #8
0
        public static void SetTitleData(Dictionary <string, string> keys, Action <SetTitleDataResult> resultCb, Action <EditorModels.PlayFabError> errorCallback)
        {
            foreach (var pair in keys)
            {
                var req = new SetTitleDataRequest()
                {
                    Key = pair.Key, Value = pair.Value
                };

                var titleId     = PlayFabEditorDataService.envDetails.selectedTitleId;
                var apiEndpoint = String.Format("https://{0}{1}", titleId, PlayFabEditorHelper.TITLE_ENDPOINT);
                PlayFabEditorHttp.MakeApiCall <SetTitleDataRequest, SetTitleDataResult>("/Admin/SetTitleData", apiEndpoint, req, resultCb, errorCallback);
            }
        }
예제 #9
0
        public static void InstallEdExPackage(string key)
        {
            //TODO update this to work with a standardized key nomenclature

            if (EditorUtility.DisplayDialog("Confirm Package Installation", "This will install the " + key + " package.", "Confirm", "Cancel"))
            {
                PlayFabEditorHttp.MakeDownloadCall("https://api.playfab.com/sdks/download/android-push50-via-edex", (fileName) =>
                {
                    AssetDatabase.ImportPackage(fileName, true);
                    Debug.Log(string.Format("EdEx: {0} Installation Complete", key));
                });
            }
            else
            {
                //TODO this will need to be updated when we have several plugins.
                AndroidPushPlugin = false;
                _androidPushPluginPreviousState = false;
            }
        }
        private static void GetLatestSdkVersion()
        {
            //TODO start back here
            DateTime threshold = PlayFabEditorDataService.editorSettings.lastSdkVersionCheck != DateTime.MinValue ? PlayFabEditorDataService.editorSettings.lastSdkVersionCheck.AddHours(1) : DateTime.MinValue;

            if (DateTime.Today > threshold)
            {
                PlayFabEditorHttp.MakeGitHubApiCall("https://api.github.com/repos/PlayFab/UnitySDK/git/refs/tags", (version) =>
                {
                    latestSdkVersion = version ?? "Unknown";
                    PlayFabEditorDataService.editorSettings.lastSdkVersionCheck = DateTime.UtcNow;
                    PlayFabEditorDataService.editorSettings.latestSdkVersion    = latestSdkVersion;
                    PlayFabEditorDataService.SaveEditorSettings();
                });
            }
            else
            {
                latestSdkVersion = PlayFabEditorDataService.editorSettings.latestSdkVersion;
            }
        }
예제 #11
0
 public static void Logout(LogoutRequest request, Action <LogoutResult> resultCallback,
                           Action <EditorModels.PlayFabError> errorCallback)
 {
     PlayFabEditorHttp.MakeApiCall("/DeveloperTools/User/Logout", PlayFabEditorHelper.DEV_API_ENDPOINT, request, resultCallback, errorCallback);
 }
예제 #12
0
 public static void RegisterAccouint(RegisterAccountRequest request, Action <RegisterAccountResult> resultCallback,
                                     Action <EditorModels.PlayFabError> errorCallback)
 {
     PlayFabEditorHttp.MakeApiCall("/DeveloperTools/User/RegisterAccount", PlayFabEditorHelper.DEV_API_ENDPOINT, request, resultCallback, errorCallback);
 }