Example #1
0
 public ParserBase GetParser(HostParser host, PcdbFile database)
 {
     return new OldPcdbParserImpl(host, database);
 }
Example #2
0
 public OldPcdbParserImpl(HostParser host, PcdbFile database)
     : base(host)
 {
     Database = database;
 }
 public void CloseDatabase()
 {
     if (database == null)
         return;
     database.CloseConnection();
     database = null;
     OnConnectionStatusChanged(false);
 }
 public void OpenDatabase(string path)
 {
     CloseDatabase();
     database = PcdbFile.Open(path);
     database.OpenConnection();
     OnConnectionStatusChanged(true);
 }
 protected PlayerDumpParser(HostParser host, PcdbFile database)
     : base(host)
 {
     Database = database;
 }
Example #6
0
 private void ParseRev3(PcdbFile src)
 {
     var srcGameVersion = src.GetGameVersion();
     var selfGameVersion = Database.GetGameVersion();
     if (srcGameVersion != selfGameVersion)
         return;
     var progress = new Progress(100);
     OnProgressChanged(progress);
     var hashes = src.SelectHashes(DatabaseTableId.Hash);
     var hashCount = hashes.Rows.Count;
     OnFoundData(DatabaseTableId.Hash, hashCount);
     for (var hashIndex = 0; hashIndex < hashCount; hashIndex++)
     {
         if (Cancelled)
             break;
         var hash = (string)hashes.Rows[hashIndex][0];
         var hashRow = src.Select(DatabaseTableId.Hash, hash).Rows[0];
         var info = (string)hashRow.ItemArray[1];
         if (String.IsNullOrEmpty(info))
             Database.InsertHash(hash);
         else
             Database.InsertUpdateHash(hash, info);
         // names
         var names = src.Select(DatabaseTableId.Name, hash);
         OnFoundData(DatabaseTableId.Name, names.Rows.Count);
         for (var i = 0; i < names.Rows.Count; i++)
         {
             var nameRow = names.Rows[i];
             var name = (string)nameRow[1];
             Database.InsertName(hash, name, (DateTime)nameRow[2]);
         }
         // ips
         var ips = src.Select(DatabaseTableId.Ip, hash);
         OnFoundData(DatabaseTableId.Ip, ips.Rows.Count);
         for (var i = 0; i < ips.Rows.Count; i++)
         {
             var ipRow = ips.Rows[i];
             var ip = (string)ipRow[1];
             Database.InsertIp(hash, ip, (DateTime)ipRow[2]);
         }
         // gsids
         if (srcGameVersion == PcdbGameVersion.COP)
         {
             var gsids = src.Select(DatabaseTableId.Gsid, hash);
             OnFoundData(DatabaseTableId.Gsid, gsids.Rows.Count);
             for (var i = 0; i < gsids.Rows.Count; i++)
             {
                 var gsidRow = gsids.Rows[i];
                 var gsid = Convert.ToUInt32(gsidRow[1]);
                 Database.InsertGsid(hash, gsid, (DateTime)gsidRow[2]);
             }
         }
         var newProgress = (uint)Math.Round(100.0*(hashIndex + 1)/hashCount);
         if (newProgress > progress.Current)
         {
             progress.Current = newProgress;
             OnProgressChanged(progress);
         }
     }
 }
 public ParserBase GetParser(HostParser host, PcdbFile database)
 {
     return new StatisticsDumpParserImpl(host, database);
 }
 public StatisticsDumpParserImpl(HostParser host, PcdbFile database)
     : base(host)
 {
     Database = database;
 }
 public ParserBase GetParser(HostParser host, PcdbFile database)
 {
     return new ConfigDumpParserImpl(host, database);
 }
 public ConfigDumpParserImpl(HostParser host, PcdbFile database)
     : base(host, database)
 {
 }
Example #11
0
 public HostParser(PcdbFile database, ISpecificParser provider)
     : this(database)
 {
     AddProvider(provider);
 }
Example #12
0
 public HostParser(PcdbFile database, IEnumerable<ISpecificParser> providers)
     : this(database)
 {
     AddProviders(providers);
 }
Example #13
0
 public HostParser(PcdbFile database)
 {
     Database = database;
     parserProviders = new List<ISpecificParser>();
 }
 public ScreenshotParserImpl(HostParser host, PcdbFile database)
     : base(host, database)
 {
 }
 public ParserBase GetParser(HostParser host, PcdbFile database)
 {
     return new ScreenshotParserImpl(host, database);
 }