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

            if (!MsgPack.Element("STR", out MsgPack STR))
            {
                return;
            }
            Header = new Header();
            System.Enum.TryParse(STR.ReadString("Format"), out Header.Format);

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

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

            MsgPack = MsgPack.New;
        }
Esempio n. 2
0
        public void MsgPackReader(string file, bool JSON)
        {
            MsgPack MsgPack = file.ReadMPAllAtOnce(JSON);

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

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

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

            MsgPack = MsgPack.New;
        }