Exemplo n.º 1
0
        private static GameParameters ReadSfo( Stream sfo )
        {
            GameParameters gp = new GameParameters();
            SfoReader reader = new SfoReader( sfo );

            if( reader[ "TITLE" ] != null )
                gp.Title = reader[ "TITLE" ].Data as string;
            if( reader[ "CATEGORY" ] != null )
            {
                string categoryString = reader[ "CATEGORY" ].Data as string;
                switch( categoryString )
                {
                    case "WG":
                        gp.Category = GameCategory.WlanGame;
                        break;
                    case "MS":
                        gp.Category = GameCategory.SaveGame;
                        break;
                    case "UG":
                        gp.Category = GameCategory.UmdGame;
                        break;
                    case "UV":
                        gp.Category = GameCategory.UmdVideo;
                        break;
                    case "UA":
                        gp.Category = GameCategory.UmdAudio;
                        break;
                    case "UC":
                        gp.Category = GameCategory.CleaningDisc;
                        break;
                    case "MG":
                    default:
                        gp.Category = GameCategory.MemoryStickGame;
                        break;
                }
            }
            if( reader[ "DISC_ID" ] != null )
                gp.DiscID = reader[ "DISC_ID" ].Data as string;
            if( reader[ "DISC_VERSION" ] != null )
                gp.GameVersion = new Version( reader[ "DISC_VERSION" ].Data as string );
            if( reader[ "PSP_SYSTEM_VER" ] != null )
                gp.SystemVersion = new Version( reader[ "PSP_SYSTEM_VER" ].Data as string );
            if( reader[ "REGION" ] != null )
                gp.Region = ( int )reader[ "REGION" ].Data;
            if( reader[ "LANGUAGE" ] != null )
                gp.Language = reader[ "LANGUAGE" ].Data as string;

            return gp;
        }
Exemplo n.º 2
0
        private static GameParameters ReadSfo(Stream sfo)
        {
            GameParameters gp     = new GameParameters();
            SfoReader      reader = new SfoReader(sfo);

            if (reader["TITLE"] != null)
            {
                gp.Title = reader["TITLE"].Data as string;
            }
            if (reader["CATEGORY"] != null)
            {
                string categoryString = reader["CATEGORY"].Data as string;
                switch (categoryString)
                {
                case "WG":
                    gp.Category = GameCategory.WlanGame;
                    break;

                case "MS":
                    gp.Category = GameCategory.SaveGame;
                    break;

                case "UG":
                    gp.Category = GameCategory.UmdGame;
                    break;

                case "UV":
                    gp.Category = GameCategory.UmdVideo;
                    break;

                case "UA":
                    gp.Category = GameCategory.UmdAudio;
                    break;

                case "UC":
                    gp.Category = GameCategory.CleaningDisc;
                    break;

                case "MG":
                default:
                    gp.Category = GameCategory.MemoryStickGame;
                    break;
                }
            }
            if (reader["DISC_ID"] != null)
            {
                gp.DiscID = reader["DISC_ID"].Data as string;
            }
            if (reader["DISC_VERSION"] != null)
            {
                gp.GameVersion = new Version(reader["DISC_VERSION"].Data as string);
            }
            if (reader["PSP_SYSTEM_VER"] != null)
            {
                gp.SystemVersion = new Version(reader["PSP_SYSTEM_VER"].Data as string);
            }
            if (reader["REGION"] != null)
            {
                gp.Region = ( int )reader["REGION"].Data;
            }
            if (reader["LANGUAGE"] != null)
            {
                gp.Language = reader["LANGUAGE"].Data as string;
            }

            return(gp);
        }