Exemplo n.º 1
0
        // Set up and check availability
        //public FetchContent(GameType type, string path)
        public FetchContent(FFGImport import)
        {
            importData  = import;
            contentPath = import.path;
            if (import.type == GameType.D2E)
            {
                finder   = new RtLFinder(import.platform);
                gameType = "D2E";
            }
            else if (import.type == GameType.MoM)
            {
                finder   = new MoMFinder(import.platform);
                gameType = "MoM";
            }
            else if (import.type == GameType.IA)
            {
                finder   = new IAFinder(import.platform);
                gameType = "IA";
            }
            else
            {
                return;
            }

            string appVersion = finder.RequiredFFGVersion();
            // Open up the assets to get the actual version number
            string ffgVersion = FetchAppVersion();

            // Add version found to log
            if (ffgVersion.Length != 0)
            {
                ValkyrieDebug.Log("FFG " + gameType + " Version Found: " + ffgVersion + System.Environment.NewLine);
            }
            else
            {
                ValkyrieDebug.Log("FFG " + gameType + " not found." + System.Environment.NewLine);
            }

            // Check if version is acceptable for import
            importAvailable = VersionNewerOrEqual(appVersion, ffgVersion);

            if (importData.platform == Platform.Android)
            {
                importAvailable = File.Exists(finder.ObbPath());
            }
        }