Ejemplo n.º 1
0
        public void Read(ByteArrayStreamReader reader)
        {
            TalkType = (TalkType)reader.ReadByte();

            switch (TalkType)
            {
            case TalkType.Private:

            case TalkType.PrivateRed:

            case TalkType.ReportRuleViolationAnswer:

                Name = reader.ReadString();

                break;

            case TalkType.ChannelYellow:

            case TalkType.ChannelWhite:

            case TalkType.ChannelRed:

            case TalkType.ChannelOrange:

            case TalkType.ChannelRedAnonymous:

                ChannelId = reader.ReadUShort();

                break;
            }

            Message = reader.ReadString();
        }
Ejemplo n.º 2
0
        public void Read(ByteArrayStreamReader reader)
        {
            OperatingSystem = (OperatingSystem)reader.ReadUShort();

            Version = reader.ReadUShort();

            TibiaDat = reader.ReadUInt();

            TibiaSpr = reader.ReadUInt();

            TibiaPic = reader.ReadUInt();

            reader.ReadByte();

            Keys = new uint[]
            {
                reader.ReadUInt(),

                    reader.ReadUInt(),

                    reader.ReadUInt(),

                    reader.ReadUInt()
            };

            Account = reader.ReadString();

            Password = reader.ReadString();
        }
Ejemplo n.º 3
0
        public void Read(ByteArrayStreamReader reader)
        {
            OperatingSystem = (OperatingSystem)reader.ReadUShort();

            Version = reader.ReadUShort();

            reader.ReadByte();

            Keys = new uint[]
            {
                reader.ReadUInt(),

                    reader.ReadUInt(),

                    reader.ReadUInt(),

                    reader.ReadUInt()
            };

            Gamemaster = reader.ReadBool();

            Account = reader.ReadString();

            Character = reader.ReadString();

            Password = reader.ReadString();
        }
Ejemplo n.º 4
0
        public void Read(ByteArrayStreamReader reader)
        {
            OperatingSystem = (OperatingSystem)reader.ReadUShort();

            Version = reader.ReadUShort();

            TibiaDat = reader.ReadUInt();

            TibiaSpr = reader.ReadUInt();

            TibiaPic = reader.ReadUInt();

            reader.ReadByte();

            Keys = new uint[]
            {
                reader.ReadUInt(),

                    reader.ReadUInt(),

                    reader.ReadUInt(),

                    reader.ReadUInt()
            };

            Account = reader.ReadString();

            Password = reader.ReadString();

            LocaleId = reader.ReadByte();

            Locate = Encoding.Default.GetString(reader.ReadBytes(3));

            TotalRam = reader.ReadUShort();

            reader.ReadBytes(6);

            Cpu = Encoding.Default.GetString(reader.ReadBytes(9));

            reader.ReadBytes(2);

            CpuClock = reader.ReadUShort();

            CpuClock2 = reader.ReadUShort();

            reader.ReadBytes(4);

            Cpu = Encoding.Default.GetString(reader.ReadBytes(9));

            VideoRam = reader.ReadUShort();

            ResolutionHorizontal = reader.ReadUShort();

            ResolutionVertical = reader.ReadUShort();

            RefreshRate = reader.ReadByte();
        }
Ejemplo n.º 5
0
        public static Waypoint Load(ByteArrayFileTreeStream stream, ByteArrayStreamReader reader)
        {
            Waypoint waypoint = new Waypoint();

            stream.Seek(Origin.Current, 1);

            waypoint.Name = reader.ReadString();

            waypoint.Position = new Position(reader.ReadUShort(), reader.ReadUShort(), reader.ReadByte());

            return(waypoint);
        }
Ejemplo n.º 6
0
        public static Town Load(ByteArrayFileTreeStream stream, ByteArrayStreamReader reader)
        {
            Town town = new Town();

            stream.Seek(Origin.Current, 1);

            town.Id = reader.ReadUInt();

            town.Name = reader.ReadString();

            town.Position = new Position(reader.ReadUShort(), reader.ReadUShort(), reader.ReadByte());

            return(town);
        }
Ejemplo n.º 7
0
        public static MapInfo Load(ByteArrayFileTreeStream stream, ByteArrayStreamReader reader)
        {
            MapInfo mapInfo = new MapInfo();

            stream.Seek(Origin.Current, 1);

            while (true)
            {
                switch ((OtbmAttribute)reader.ReadByte())
                {
                case OtbmAttribute.Description:

                    mapInfo.descriptions.Add(reader.ReadString());

                    break;

                case OtbmAttribute.SpawnFile:

                    mapInfo.SpawnFile = reader.ReadString();

                    break;

                case OtbmAttribute.HouseFile:

                    mapInfo.HouseFile = reader.ReadString();

                    break;

                default:

                    stream.Seek(Origin.Current, -1);

                    return(mapInfo);
                }
            }
        }
Ejemplo n.º 8
0
        public static Item Load(ByteArrayFileTreeStream stream, ByteArrayStreamReader reader)
        {
            Item item = new Item();

            stream.Seek(Origin.Current, 1);

            item.OpenTibiaId = reader.ReadUShort();

            while (true)
            {
                switch ((OtbmAttribute)reader.ReadByte())
                {
                case OtbmAttribute.Count:

                    item.Count = reader.ReadByte();

                    break;

                case OtbmAttribute.ActionId:

                    item.ActionId = reader.ReadUShort();

                    break;

                case OtbmAttribute.UniqueId:

                    item.UniqueId = reader.ReadUShort();

                    break;

                case OtbmAttribute.Text:

                    item.Text = reader.ReadString();

                    break;

                case OtbmAttribute.WrittenDate:

                    item.WrittenDate = reader.ReadUInt();

                    break;

                case OtbmAttribute.WrittenBy:

                    item.WrittenBy = reader.ReadString();

                    break;

                case OtbmAttribute.SpecialDescription:

                    item.SpecialDescription = reader.ReadString();

                    break;

                case OtbmAttribute.RuneCharges:

                    item.RuneCharges = reader.ReadByte();

                    break;

                case OtbmAttribute.Charges:

                    item.Charges = reader.ReadUShort();

                    break;

                case OtbmAttribute.Duration:

                    item.Duration = reader.ReadUInt();

                    break;

                case OtbmAttribute.Decaying:

                    item.Decaying = reader.ReadByte();

                    break;

                case OtbmAttribute.DepotId:

                    item.DeportId = reader.ReadUShort();

                    break;

                case OtbmAttribute.HouseDoorId:

                    item.HouseDoorId = reader.ReadByte();

                    break;

                case OtbmAttribute.SleeperId:

                    item.SleeperId = reader.ReadUInt();

                    break;

                case OtbmAttribute.SleepStart:

                    item.SleepterStart = reader.ReadUInt();

                    break;

                case OtbmAttribute.TeleportDestination:

                    item.TeleportPosition = new Position(reader.ReadUShort(), reader.ReadUShort(), reader.ReadByte());

                    break;

                case OtbmAttribute.ContainerItems:

                    item.ContainerItems = reader.ReadUInt();

                    break;

                default:

                    stream.Seek(Origin.Current, -1);

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

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

                            if (!stream.Next())
                            {
                                break;
                            }
                        }
                    }
                    return(item);
                }
            }
        }
Ejemplo n.º 9
0
 public void Read(ByteArrayStreamReader reader)
 {
     Message = reader.ReadString();
 }
Ejemplo n.º 10
0
 public void Read(ByteArrayStreamReader reader)
 {
     Name = reader.ReadString();
 }