public TrophyConfNode( XmlNode Node, String TrophySignature, String TrophyConfigSignature, String Folder ) { SceNpTrophySignature = TrophySignature; SceNpTrophySignature_TropConf = TrophyConfigSignature; version = Node.Attributes["version"].Value; npcommid = Node["npcommid"].InnerText; trophysetversion = Node["trophyset-version"].InnerText; parentallevel = Node["parental-level"].InnerText; parentallevel_licensearea = Node["parental-level"].Attributes["license-area"].Value; TitleName = Node["title-name"].InnerText; TitleDetail = Node["title-detail"].InnerText; this.Folder = Folder; XmlNodeList TrophyNodes = Node.SelectNodes( "trophy" ); if ( Folder != null ) { TropUsrFile = new TropUsr( System.IO.File.ReadAllBytes( Folder + "TROPUSR.DAT" ) ); } Trophies = new Dictionary<uint, TrophyNode>(); foreach ( XmlNode Trophy in TrophyNodes ) { TrophyNode t = new TrophyNode( Trophy, Folder ); Trophies.Add( UInt32.Parse( t.ID ), t ); } }
public TrophyConfNode(XmlNode Node, String TrophySignature, String TrophyConfigSignature, String Folder) { SceNpTrophySignature = TrophySignature; SceNpTrophySignature_TropConf = TrophyConfigSignature; version = Node.Attributes["version"].Value; npcommid = Node["npcommid"].InnerText; trophysetversion = Node["trophyset-version"].InnerText; parentallevel = Node["parental-level"].InnerText; parentallevel_licensearea = Node["parental-level"].Attributes["license-area"].Value; TitleName = Node["title-name"].InnerText; TitleDetail = Node["title-detail"].InnerText; this.Folder = Folder; XmlNodeList TrophyNodes = Node.SelectNodes("trophy"); if (Folder != null) { TropUsrFile = new TropUsr(System.IO.File.ReadAllBytes(Folder + "TROPUSR.DAT")); } Trophies = new Dictionary <uint, TrophyNode>(); foreach (XmlNode Trophy in TrophyNodes) { TrophyNode t = new TrophyNode(Trophy, Folder); Trophies.Add(UInt32.Parse(t.ID), t); } }
public int CompareTo(object obj) { TrophyNode t = (TrophyNode)obj; int CurrentID = Int32.Parse(this.ID); int OtherID = Int32.Parse(t.ID); return(CurrentID - OtherID); }
public static List<TrophyNode> GetSQL( String ConnectionString, String GracesJapaneseConnectionString ) { //List<ScenarioFile> Trophies = new List<TrophyNode>(); Dictionary<string, TrophyNode> Trophies = new Dictionary<string, TrophyNode>(); SQLiteConnection Connection = new SQLiteConnection( ConnectionString ); Connection.Open(); using ( SQLiteTransaction Transaction = Connection.BeginTransaction() ) using ( SQLiteCommand Command = new SQLiteCommand( Connection ) ) { Command.CommandText = "SELECT english, PointerRef, StringID, t_id, t_hidden, t_ttype, t_pid FROM Text ORDER BY ID"; SQLiteDataReader r = Command.ExecuteReader(); while ( r.Read() ) { String SQLText; String T_ID; bool T_Hidden; String T_TType; String T_PID; try { SQLText = r.GetString( 0 ).Replace( "''", "'" ); T_ID = r.GetString( 3 ); T_Hidden = r.GetInt32( 4 ) == 1; T_TType = r.GetString( 5 ); T_PID = r.GetString( 6 ); } catch ( System.InvalidCastException ) { SQLText = null; T_ID = null; T_Hidden = false; T_TType = null; T_PID = null; } int PointerRef = r.GetInt32( 1 ); int StringID = r.GetInt32( 2 ); if ( Trophies.ContainsKey( T_ID ) ) { if ( PointerRef == 0 ) { Trophies[T_ID].Name = SQLText; } else if ( PointerRef == 1 ) { Trophies[T_ID].Detail = SQLText; } } else { String Name = null; String Detail = null; if ( PointerRef == 0 ) { Name = SQLText; } else if ( PointerRef == 1 ) { Detail = SQLText; } TrophyNode Trophy = new TrophyNode( T_ID, T_Hidden, T_TType, T_PID, Name, Detail, null ); Trophies[T_ID] = Trophy; } } Transaction.Rollback(); } Connection.Close(); return Trophies.Values.ToList(); }