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

            if (!MsgPack.Element("STR", out MsgPack STR))
            {
                return;
            }

            if (!STR.Element <MsgPack>("Strings", out MsgPack Strings))
            {
                return;
            }

            STRs = new String[Strings.Array.Length];
            for (int i = 0; i < STRs.Length; i++)
            {
                if (Strings[i] is MsgPack String)
                {
                    String      = (MsgPack)Strings[i];
                    STRs[i].ID  = String.ReadInt32("ID");
                    STRs[i].Str = String.ReadString("Str");
                }
            }

            MsgPack = MsgPack.New;
        }
Example #2
0
        public void MsgPackReader(string file, bool JSON)
        {
            MsgPack MsgPack = file.ReadMP(JSON);

            if (MsgPack.Element("STR", out MsgPack STR))
            {
                if (STR.Element("Strings", out MsgPack Strings, typeof(object[])))
                {
                    STRs = new String[((object[])Strings.Object).Length];
                    MsgPack String;
                    for (int i = 0; i < STRs.Length; i++)
                    {
                        if (Strings[i].GetType() == typeof(MsgPack))
                        {
                            String      = (MsgPack)Strings[i];
                            STRs[i].ID  = String.ReadInt32("ID");
                            STRs[i].Str = String.ReadString("Str");
                        }
                    }
                }
            }
            MsgPack = null;
        }