Esempio n. 1
0
        public static async Task Identify()
        {
            string directory = await Interaction.Instance.GetJBDirectory();

            if (string.IsNullOrEmpty(directory))
            {
                return;
            }

            if (!IsValidDirectory(directory))
            {
                Interaction.Instance.ReportMessage("Invalid JB directory", ReportType.Fail);
                return;
            }
            // Parse PARAM.SFO
            ParamSfo sfo     = ParamSfo.Load(System.IO.Path.Combine(directory, "PS3_GAME\\PARAM.SFO"));
            string   gameid  = sfo.GetStringValue("TITLE_ID");
            string   appver  = sfo.GetStringValue("APP_VER");
            string   gamever = sfo.GetStringValue("VERSION");

            Interaction.Instance.ReportMessage("Title: " + sfo.GetStringValue("TITLE"));
            Interaction.Instance.ReportMessage("Game ID: " + gameid);
            Interaction.Instance.ReportMessage("App version: " + appver);
            Interaction.Instance.ReportMessage("Release version: " + gamever);

            await IrdUploader.Search(gameid, appver, gamever);
        }
Esempio n. 2
0
        private bool CheckParams(IrdFile irdFile)
        {
            // Check the game id
            ParamSfo sfo    = ParamSfo.Load(System.IO.Path.Combine(Path, @"PS3_GAME\PARAM.SFO"));
            string   gameID = sfo.GetStringValue("TITLE_ID");

            if (gameID != irdFile.GameID)
            {
                Interaction.Instance.ReportMessage(
                    string.Format("This IRD file is for another game (IRD File: {0}, JB Rip: {1})", irdFile.GameID, gameID),
                    ReportType.Fail);
                return(false);
            }

            // Check the game version
            string gameVersion = sfo.GetStringValue("VERSION");

            if (gameVersion != irdFile.GameVersion)
            {
                Interaction.Instance.ReportMessage(
                    string.Format("This IRD file is for another release version (IRD File: {0}, JB Rip: {1})",
                                  irdFile.GameVersion, gameVersion), ReportType.Fail);
                return(false);
            }

            // Check the game version
            string appVersion = sfo.GetStringValue("APP_VER");

            if (appVersion != irdFile.AppVersion)
            {
                Interaction.Instance.ReportMessage(
                    string.Format("This IRD file is for another application version (IRD File: {0}, JB Rip: {1})",
                                  irdFile.AppVersion, appVersion), ReportType.Fail);
                return(false);
            }
            return(true);
        }