Пример #1
0
        public static OtbFile Load(string path)
        {
            using (ByteArrayFileTreeStream stream = new ByteArrayFileTreeStream(path))
            {
                ByteArrayStreamReader reader = new ByteArrayStreamReader(stream);

                OtbFile file = new OtbFile();

                file.otbInfo = OtbInfo.Load(stream, reader);

                if (stream.Child())
                {
                    file.items = new List <Item>();

                    while (true)
                    {
                        file.items.Add(Item.Load(stream, reader));

                        if (!stream.Next())
                        {
                            break;
                        }
                    }
                }

                return(file);
            }
        }
Пример #2
0
        public static OtbInfo Load(ByteArrayFileTreeStream stream, ByteArrayStreamReader reader)
        {
            OtbInfo otbInfo = new OtbInfo();

            stream.Seek(Origin.Current, 13);

            otbInfo.MajorVersion = (OtbVersion)reader.ReadUInt();

            otbInfo.MinorVersion = (TibiaVersion)reader.ReadUInt();

            otbInfo.Revision = reader.ReadUInt();

            otbInfo.CsdVersion = reader.ReadCsd();

            return(otbInfo);
        }