Ejemplo n.º 1
0
        public static void AETDBProcessor(bool JSON)
        {
            Console.Title = "AET DB Converter";
            DB.Aet Aet;
            Main.Choose(1, "bin", out string[] FileNames);
            if (FileNames.Length < 1)
            {
                return;
            }
            string filepath = "";
            string ext      = "";

            foreach (string file in FileNames)
            {
                Console.Title = "AET DB Converter: " + Path.GetFileNameWithoutExtension(file);
                Aet           = new DB.Aet();
                ext           = Path.GetExtension(file).ToLower();
                filepath      = file.Replace(Path.GetExtension(file), "");

                if (ext == ".bin")
                {
                    Aet.BINReader(filepath);
                    Aet.MsgPackWriter(filepath, JSON);
                }
                else if (ext == ".mp" || ext == ".json")
                {
                    Aet.MsgPackReader(filepath, ext == ".json");
                    Aet.BINWriter(filepath);
                }
            }
        }
Ejemplo n.º 2
0
            public void ReadMsgPack(MsgPack msg)
            {
                FileName    = msg.ReadString("FileName");
                Id          = msg.ReadNUInt16("Id");
                Name        = msg.ReadString("Name");
                NewId       = msg.ReadBoolean("NewId");
                SpriteSetId = msg.ReadNUInt16("SpriteSetId");

                if (msg.Element("Aets", out MsgPack Aets, typeof(object[])))
                {
                    object Aet;
                    this.Aets = new AET[((object[])Aets.Object).Length];
                    for (int i0 = 0; i0 < this.Aets.Length; i0++)
                    {
                        Aet = Aets[i0]; if (Aet.GetType() == typeof(MsgPack))
                        {
                            this.Aets[i0].ReadMsgPack((MsgPack)Aet);
                        }
                    }
                }
            }