示例#1
0
        public async Task <QScript.ScriptKeyRecord> ResolveCompressedKey(System.Int64 key, int compressedByteSize)
        {
            await LoadCompressedKeys();

            var record = compressedKeys.Where(s => s.checksum == key && s.compressedByteSize == compressedByteSize).FirstOrDefault();

            if (record != null)
            {
                var qrec = new QScript.ScriptKeyRecord();
                qrec.name               = record.name.ToLower();
                qrec.checksum           = (System.UInt32)record.checksum;
                qrec.compressedByteSize = record.compressedByteSize;
                return(qrec);
            }
            return(null);
        }
示例#2
0
        public async Task <QScript.ScriptKeyRecord> GetCompressedKey(string keyName)
        {
            await LoadCompressedKeys();

            var record = compressedKeys.Where(s => s.name.ToLower() == keyName.ToLower()).FirstOrDefault();

            if (record != null)
            {
                var qrec = new QScript.ScriptKeyRecord();
                qrec.name               = keyName.ToLower();
                qrec.checksum           = (System.UInt32)record.checksum;
                qrec.compressedByteSize = record.compressedByteSize;
                return(qrec);
            }
            return(null);
        }
示例#3
0
        private async Task <List <QScript.ScriptKeyRecord> > GetCompressedKeys()
        {
            var ret    = new List <QScript.ScriptKeyRecord>();
            var record = new Repository.ScriptKeyRecord();

            record.platform = platform;
            record.version  = version;
            var entries = await scriptKeyRepository.GetCompressTables(record);

            foreach (var entry in entries)
            {
                var qrec = new QScript.ScriptKeyRecord();
                qrec.checksum           = (System.UInt32)entry.checksum;
                qrec.compressedByteSize = entry.compressedByteSize;
                qrec.name = entry.name;
                ret.Add(qrec);
            }
            return(ret);
        }