Exemple #1
0
 internal static IEnumerable <KeyValuePair <uint, string> > LoadRelationNamesEnum(IKeyValueDBTransaction tr)
 {
     tr.InvalidateCurrentKey();
     while (tr.FindNextKey(RelationNamesPrefix))
     {
         yield return(new KeyValuePair <uint, string>((uint)PackUnpack.UnpackVUInt(tr.GetValue()), new SpanReader(tr.GetKey().Slice(RelationNamesPrefixLen)).ReadString()));
     }
 }
Exemple #2
0
 public static bool Enumerate(this IKeyValueDBTransaction transaction)
 {
     if (transaction.GetKeyIndex() < 0)
     {
         return(transaction.FindFirstKey());
     }
     if (transaction.FindNextKey())
     {
         return(true);
     }
     transaction.InvalidateCurrentKey();
     return(false);
 }
Exemple #3
0
        public void LoadGlobalInfo(bool sortTableByNameAsc = false)
        {
            LoadTableNamesDict();
            LoadRelationInfoDict();
            MarkLastDictId();
            _trkv.InvalidateCurrentKey();
            _singletons = new Dictionary <uint, ulong>();
            while (_trkv.FindNextKey(ObjectDB.TableSingletonsPrefix))
            {
                _singletons.Add(new SpanReader(_trkv.GetKey().Slice((int)ObjectDB.TableSingletonsPrefixLen)).ReadVUInt32(), new SpanReader(_trkv.GetValue()).ReadVUInt64());
            }

            if (sortTableByNameAsc)
            {
                _singletons = _singletons.OrderBy(item => _tableId2Name.TryGetValue(item.Key, out var name) ? name : "").ToDictionary(item => item.Key, item => item.Value);
            }
        }
Exemple #4
0
 public void InvalidateCurrentKey()
 {
     LogSimpleOperation(KVReplayOperation.InvalidateCurrentKey);
     _tr.InvalidateCurrentKey();
 }
 public void InvalidateCurrentKey()
 {
     _keyValueDBTransaction.InvalidateCurrentKey();
 }