Exemple #1
0
        public void MsgPackReader(string file, bool JSON)
        {
            MsgPack MsgPack = file.ReadMP(JSON);

            if (MsgPack.Element("AuthDB", out MsgPack AuthDB))
            {
                if (AuthDB.Element <MsgPack>("Category", out MsgPack Temp))
                {
                    Category = new string[Temp.Array.Length];
                    for (int i = 0; i < Category.Length; i++)
                    {
                        if (Temp is MsgPack Category)
                        {
                            this.Category[i] = Category.ReadString();
                        }
                    }
                }

                if (AuthDB.Element <MsgPack>("UID", out Temp))
                {
                    _UID = new UID[Temp.Array.Length];
                    for (int i = 0; i < _UID.Length; i++)
                    {
                        if (Temp[i] is MsgPack UID)
                        {
                            _UID[i].Category = UID.ReadString("C");
                            _UID[i].OrgUid   = UID.ReadNInt32("O");
                            _UID[i].Size     = UID.ReadNInt32("S");
                            _UID[i].Value    = UID.ReadString("V");
                        }
                    }
                }
            }
            MsgPack = MsgPack.New;
        }
Exemple #2
0
        public void MsgPackReader(string file, bool JSON)
        {
            MsgPack MsgPack = file.ReadMP(JSON);

            if (MsgPack.Element("AuthDB", out MsgPack AuthDB))
            {
                if (AuthDB.Element("Category", out MsgPack Temp, typeof(object[])))
                {
                    this.Category = new string[((object[])Temp.Object).Length];
                    MsgPack Category;
                    for (int i = 0; i < this.Category.Length; i++)
                    {
                        if (Temp[i].GetType() == typeof(MsgPack))
                        {
                            Category = (MsgPack)Temp[i]; this.Category[i] = Category.ReadString();
                        }
                    }
                }

                if (AuthDB.Element("UID", out Temp, typeof(object[])))
                {
                    _UID = new UID[((object[])Temp.Object).Length];
                    MsgPack UID;
                    for (int i = 0; i < _UID.Length; i++)
                    {
                        if (Temp[i].GetType() == typeof(MsgPack))
                        {
                            UID = (MsgPack)Temp[i];
                            _UID[i].Category = UID.ReadString("C");
                            _UID[i].OrgUid   = UID.ReadNInt32("O");
                            _UID[i].Size     = UID.ReadNInt32("S");
                            _UID[i].Value    = UID.ReadString("V");
                        }
                    }
                }
            }
            MsgPack = null;
        }