Ejemplo n.º 1
0
    public void GetContainerCredentialsWithToken()
    {
        ShowLoader();
        PlayFabMultiplayerAPI.GetContainerRegistryCredentials(new GetContainerRegistryCredentialsRequest(),
                                                              result => {
            Debug.Log("GOT CREDS OK: " + result.ToJson().ToString());
            HideLoader();

            Inform("Ready to build container!");
            string dockerPath = Application.dataPath +
                                (Application.platform == RuntimePlatform.OSXPlayer ? "/.." : "") + "/../Docker/";
            string path        = dockerPath + "Credentials";
            string credentials = string.Format("Repo={0}\n" +
                                               "User={1}\n" +
                                               "Pass={2}",
                                               result.DnsName,
                                               result.Username,
                                               result.Password);
            try {
                File.WriteAllText(path, credentials);
                RunPowershellSetup(dockerPath);
            } catch (System.Exception e) {
                Inform(e.Message);
            }
        },
                                                              error => {
            Debug.LogError("GET CREDS FAILED: " + error.ToString());
            HideLoader();
            Inform("GET CREDENTIALS FAILED: " + error.ErrorMessage);
        });
    }