public void initContentAction()
        {
            ContentManifest manifest = ContentManifestUtility.FromDefinitionFile("Configuration/embedded_content_manifest");
            Content         instance = new Content(manifest);

            Service.Set(instance);
        }
Example #2
0
    protected override IEnumerator setup()
    {
        GcsAccessTokenService gcsAccessTokenService = new GcsAccessTokenService(ConfigHelper.GetEnvironmentProperty <string>("GcsServiceAccountName"), new GcsP12AssetFileLoader(ConfigHelper.GetEnvironmentProperty <string>("GcsServiceAccountFile")));

        Service.Set((IGcsAccessTokenService)gcsAccessTokenService);
        string cdnUrl = ContentHelper.GetCdnUrl();
        string cpipeMappingFilename = ContentHelper.GetCpipeMappingFilename();
        CPipeManifestService cpipeManifestService = new CPipeManifestService(cdnUrl, cpipeMappingFilename, gcsAccessTokenService);

        Service.Set((ICPipeManifestService)cpipeManifestService);
        base.gameObject.AddComponent <KeyChainManager>();
        GameSettings gameSettings = new GameSettings();

        Service.Set(gameSettings);
        ContentManifest definition = ContentManifestUtility.FromDefinitionFile("Configuration/embedded_content_manifest");

        Service.Set(new Content(definition));
        Localizer localizer = Localizer.Instance;

        Service.Set(localizer);
        NullCPSwrveService cpSwrveService = new NullCPSwrveService();

        Service.Set((ICPSwrveService)cpSwrveService);
        NetworkServicesConfig networkConfig = NetworkController.GenerateNetworkServiceConfig(TestEnvironment);

        Service.Set((INetworkServicesManager) new NetworkServicesManager(this, networkConfig, offlineMode: false));
        CommerceService commerceService = new CommerceService();

        commerceService.Setup();
        Service.Set(commerceService);
        Service.Set(new MembershipService(null));
        ConnectionManager connectionManager = base.gameObject.AddComponent <ConnectionManager>();

        Service.Set(connectionManager);
        Service.Set(new SessionManager());
        Service.Set(new MixLoginCreateService());
        Service.Set((CPDataEntityCollection) new CPDataEntityCollectionImpl());
        LocalPlayerData localPlayerData = new LocalPlayerData
        {
            name         = "TestPlayer",
            tutorialData = new List <sbyte>()
        };
        PlayerId playerId = localPlayerData.id = new PlayerId
        {
            id   = "999999999999999",
            type = PlayerId.PlayerIdType.SESSION_ID
        };

        Service.Get <CPDataEntityCollection>().ResetLocalPlayerHandle();
        PlayerDataEntityFactory.AddLocalPlayerProfileDataComponents(Service.Get <CPDataEntityCollection>(), localPlayerData);
        LoginController loginController = new LoginController();

        Service.Set(loginController);
        loginController.SetNetworkConfig(networkConfig);
        IntegrationTestEx.FailIf(Service.Get <MixLoginCreateService>().NetworkConfigIsNotSet);
        yield return(null);
    }
Example #3
0
        protected override IEnumerator setup()
        {
            base.gameObject.AddComponent <KeyChainManager>();
            GameSettings gameSettings = new GameSettings();

            Service.Set(gameSettings);
            ContentManifest       definition            = ContentManifestUtility.FromDefinitionFile("Configuration/embedded_content_manifest");
            GcsAccessTokenService gcsAccessTokenService = new GcsAccessTokenService(ConfigHelper.GetEnvironmentProperty <string>("GcsServiceAccountName"), new GcsP12AssetFileLoader(ConfigHelper.GetEnvironmentProperty <string>("GcsServiceAccountFile")));

            Service.Set((IGcsAccessTokenService)gcsAccessTokenService);
            string cdnUrl = ContentHelper.GetCdnUrl();
            string cpipeMappingFilename = ContentHelper.GetCpipeMappingFilename();
            CPipeManifestService cpipeManifestService = new CPipeManifestService(cdnUrl, cpipeMappingFilename, gcsAccessTokenService);

            Service.Set((ICPipeManifestService)cpipeManifestService);
            NullCPSwrveService cpSwrveService = new NullCPSwrveService();

            Service.Set((ICPSwrveService)cpSwrveService);
            Content content = new Content(definition);

            Service.Set(content);
            networkServicesConfig = NetworkController.GenerateNetworkServiceConfig(Disney.Kelowna.Common.Environment.Environment.LOCAL);
            ConnectionManager connectionManager = base.gameObject.AddComponent <ConnectionManager>();

            Service.Set(connectionManager);
            initEnvironmentManager();
            sessionManager = new SessionManager();
            Service.Set(sessionManager);
            Localizer localizer = Localizer.Instance;

            Service.Set(localizer);
            Language language = LocalizationLanguage.GetLanguage();

            localizer.Language       = language;
            localizer.LanguageString = LocalizationLanguage.GetLanguageString(language);
            AppTokensFilePath tokensFilePath = new AppTokensFilePath(Localizer.DEFAULT_TOKEN_LOCATION, Platform.global);
            bool tokensLoaded = false;

            Service.Get <Localizer>().LoadTokensFromLocalJSON(tokensFilePath, delegate
            {
                Debug.Log("Tokens for " + localizer.LanguageString + " have been loaded.");
                tokensLoaded = true;
            });
            while (!tokensLoaded)
            {
                yield return(null);
            }
            mixLoginCreateService = new MixLoginCreateService();
            Service.Set(mixLoginCreateService);
            IntegrationTestEx.FailIf(!mixLoginCreateService.NetworkConfigIsNotSet);
            mixLoginCreateService.SetNetworkConfig(networkServicesConfig);
            IntegrationTestEx.FailIf(mixLoginCreateService.NetworkConfigIsNotSet);
            yield return(null);
        }
        public IEnumerator loadContentManifest()
        {
            Stopwatch timer = new Stopwatch();

            timer.Start();
            yield return(manifestDirectory_download());

            timer.Stop();
            if (manifestDirectory == null)
            {
                Log.LogError(this, "The ContentManifestDirectory downloaded is null! The request to download the directory either was not made or failed to download and deserialize. Reverting to the embedded ContentManifest as no ContentManifestDirectoryEntry is available to reference.");
                handleFailure();
                yield break;
            }
            embeddedManifest = manifestService.LoadEmbeddedManifest();
            DateTimeOffset contentDate      = manifestService.GetContentDate();
            Version        clientVersion    = ClientInfo.ParseClientVersion(ClientInfo.Instance.ClientVersion);
            Version        clientApiVersion = ClientInfo.ParseClientVersion(manifestService.GetClientApiVersionStr());
            string         platform         = manifestService.GetClientPlatform();
            string         environment      = manifestService.GetServerEnvironment().ToString().ToLower();
            ContentManifestDirectoryEntry clientDirectoryEntry = manifestDirectory.FindEntry(contentDate, clientVersion, platform, environment);

            appUpgradeAvailable = manifestDirectory.DoesNewerVersionExist(contentDate, clientVersion, platform, environment);
            if (clientDirectoryEntry == null)
            {
                Log.LogErrorFormatted(this, "No client directory entry available for clientVersion={0}, platform={1}, environment={2}. \nTriggering force upgrade.", clientVersion.ToString(), platform, environment);
                handleFailure(requiresAppUgrade: true);
                yield break;
            }
            ContentManifestDirectoryEntry contentDirectoryEntry = clientDirectoryEntry;

            if (!clientVersion.Equals(clientApiVersion))
            {
                contentDirectoryEntry = manifestDirectory.FindEntry(contentDate, clientApiVersion, platform, environment);
                if (contentDirectoryEntry == null)
                {
                    Log.LogErrorFormatted(this, "Missing Client API Version: No content available for clientApiVersion={0}, platform={1}, environment={2}. Falling back to embedded content version", clientApiVersion.ToString(), platform, environment);
                    handleFailure();
                    yield break;
                }
            }
            if (contentDirectoryEntry.IsEmbeddedContent())
            {
                contentManifest = embeddedManifest;
                checkContentVersionAndManifestHashInManifest(contentManifest, contentDirectoryEntry);
            }
            else
            {
                yield return(contentManifest_download(contentDirectoryEntry));

                contentManifest = ContentManifestUtility.Merge(embeddedManifest, downloadedManifest);
            }
            onInitializeComplete(contentManifest);
        }
Example #5
0
        protected override IEnumerator runTest()
        {
            Service.Set(new Content(ContentManifestUtility.FromDefinitionFile("Configuration/embedded_content_manifest")));
            GameData gameData = new GameData();

            Service.Set(gameData);
            Service.Set((IGameData)gameData);
            gameData.Init(new Type[1] {
                typeof(EmoteDefinition)
            });
            emoteList = EmoteManager.GetAllEmoteCharacters();
            CreateChatBarText();
            yield return(EmojiFontTest());
        }
Example #6
0
        private void Awake()
        {
            Service.ResetAll();
            Service.Set(new EventDispatcher());
            Service.Set((JsonService) new LitJsonService());
            GameObject gameObject = GameObject.Find("CoroutineRunner");

            if (gameObject != null)
            {
                UnityEngine.Object.Destroy(gameObject);
            }
            gameObject = new GameObject("CoroutineRunner");
            gameObject.AddComponent <CoroutineRunner>();
            ContentManifest manifest = ContentManifestUtility.FromDefinitionFile("Configuration/embedded_content_manifest");
            Content         instance = new Content(manifest);

            Service.Set(instance);
            ErrorsMap errorsMap = new ErrorsMap();

            errorsMap.LoadErrorJson("Errors/errors.json");
            Service.Set(errorsMap);
        }
 protected virtual ContentManifest generateManifest()
 {
     return(ContentManifestUtility.FromDefinitionFile("Configuration/embedded_content_manifest"));
 }