Beispiel #1
0
        public static RESInformation[] GetRESInformationBySHA1(string sha1)
        {
            List <RESInformation> result = new List <RESInformation>();

            sha1 = sha1.ToUpper();
            SQLiteConnection con = GetConnection();

            con.Open();
            SQLiteDataReader reader = getAllJoined3Where("res", "bundles", "tocfiles", "bundle", "id", "tocfile", "id", "res.sha1='" + sha1 + "'", con);
            int count = 0;

            while (reader.Read())
            {
                RESInformation res = new RESInformation();
                res.resname     = reader.GetString(0);
                res.sha1        = reader.GetString(1);
                res.rtype       = reader.GetString(2);
                res.bundlepath  = reader.GetString(6);
                res.offset      = reader.GetInt32(7);
                res.size        = reader.GetInt32(8);
                res.isbase      = reader.GetString(9) == "True";
                res.isdelta     = reader.GetString(10) == "True";
                res.tocfilepath = reader.GetString(12);
                res.incas       = reader.GetString(14) == "True";
                switch (reader.GetString(15))
                {
                default:
                    res.isbasegamefile = true;
                    break;

                case "u":
                    res.isDLC = true;
                    break;

                case "p":
                    res.isPatch = true;
                    break;
                }
                result.Add(res);
                if (count++ % 1000 == 0)
                {
                    Application.DoEvents();
                }
            }
            con.Close();
            return(result.ToArray());
        }
Beispiel #2
0
 public static RESInformation[] GetRESInformationsByType(string type)
 {
     List<RESInformation> result = new List<RESInformation>();
     SQLiteConnection con = GetConnection();
     con.Open();
     SQLiteDataReader reader = getAllJoined3Where("res", "bundles", "tocfiles", "bundle", "id", "tocfile", "id", "res.rtype='" + type + "'", con);
     int count = 0;
     while (reader.Read())
     {
         RESInformation res = new RESInformation();
         res.resname = reader.GetString(0);
         res.sha1 = reader.GetString(1);
         res.rtype = reader.GetString(2);
         res.bundlepath = reader.GetString(6);
         res.offset = reader.GetInt32(7);
         res.size = reader.GetInt32(8);
         res.isbase = reader.GetString(9) == "True";
         res.isdelta = reader.GetString(10) == "True";
         res.tocfilepath = reader.GetString(12);
         res.incas = reader.GetString(14) == "True";
            switch (reader.GetString(15))
         {
             default:
                 res.isbasegamefile = true;
                 break;
             case "u":
                 res.isDLC = true;
                 break;
             case "p":
                 res.isPatch = true;
                 break;
         }
         result.Add(res);
         if (count++ % 1000 == 0)
             Application.DoEvents();
     }
     con.Close();
     return result.ToArray();
 }