public override void Deserialize(BigEndianReader reader)
 {
     allowed = reader.ReadBoolean();
 }
コード例 #2
0
ファイル: GraphicalEffect.cs プロジェクト: greeduomacro/SpyUO
        protected override void Parse( BigEndianReader reader )
        {
            reader.ReadByte(); // ID

            _Type = (GraphicalEffectType) reader.ReadByte();
            _Source = reader.ReadUInt32();
            _Target = reader.ReadUInt32();
            _ObjectID = reader.ReadInt16();
            _SourceX = reader.ReadInt16();
            _SourceY = reader.ReadInt16();
            _SourceZ = reader.ReadSByte();
            _TargetX = reader.ReadInt16();
            _TargetY = reader.ReadInt16();
            _TargetZ = reader.ReadSByte();
            _Speed = reader.ReadByte();
            _Duration = reader.ReadByte();
            reader.ReadInt16();
            _FixedDirection = reader.ReadBoolean();
            _Explode = reader.ReadBoolean();
        }
コード例 #3
0
 private static object ReadBoolean(string fieldName, BigEndianReader reader, int dimension = 0)
 {
     return(reader.ReadBoolean());
 }
 public override void Deserialize(BigEndianReader reader)
 {
     enable = reader.ReadBoolean();
 }
コード例 #5
0
 public override void Deserialize(BigEndianReader reader)
 {
     infos = new Types.CharacterBaseInformations();
     infos.Deserialize(reader);
     isCollectingStats = reader.ReadBoolean();
 }
コード例 #6
0
 private bool method_4(string string_1, BigEndianReader dofusReader_0)
 {
     return(dofusReader_0.ReadBoolean());
 }
コード例 #7
0
ファイル: Map.cs プロジェクト: pingwiniasty/BlueSheep
        internal void Init(BigEndianReader reader)
        {
            reader.ReadByte();
            this.MapVersion = reader.ReadByte();
            this.Id         = (int)reader.ReadUInt();
            if (this.MapVersion >= 7)
            {
                this.Encrypted        = reader.ReadBoolean();
                this.EncryptedVersion = reader.ReadByte();
                int count = reader.ReadInt();
                if (this.Encrypted)
                {
                    byte[] buffer  = CustomHex.ToArray(CustomHex.FromString("649ae451ca33ec53bbcbcc33becf15f4", false));
                    byte[] buffer2 = reader.ReadBytes(count);
                    int    num7    = (buffer2.Length - 1);
                    int    n       = 0;
                    while (n <= num7)
                    {
                        buffer2[n] = Convert.ToByte((buffer2[n] ^ buffer[(n % buffer.Length)]));
                        n         += 1;
                    }
                    reader = new BigEndianReader(buffer2);
                }
            }
            this.RelativeId            = (int)reader.ReadUInt();
            this.MapType               = reader.ReadByte();
            this.SubAreaId             = reader.ReadInt();
            this.TopNeighbourId        = reader.ReadInt();
            this.BottomNeighbourId     = reader.ReadInt();
            this.LeftNeighbourId       = reader.ReadInt();
            this.RightNeighbourId      = reader.ReadInt();
            this.ShadowBonusOnEntities = reader.ReadInt();
            if (this.MapVersion >= 3)
            {
                this.BackgroundRed   = reader.ReadByte();
                this.BackgroundGreen = reader.ReadByte();
                this.BackgroundBlue  = reader.ReadByte();
            }
            if (this.MapVersion >= 4)
            {
                this.ZoomScale   = (Convert.ToDouble(reader.ReadUShort()) / 100);
                this.ZoomOffsetX = reader.ReadShort();
                this.ZoomOffsetY = reader.ReadShort();
            }
            this.UseLowPassFilter = reader.ReadBoolean();
            this.UseReverb        = reader.ReadBoolean();
            if (this.UseReverb)
            {
                this.PresetId = reader.ReadInt();
            }
            this.BackgroundsCount = reader.ReadByte();
            int backgroundsCount = this.BackgroundsCount;
            int i = 1;

            while (i <= backgroundsCount)
            {
                Fixture item = new Fixture();
                item.Init(reader);
                this.BackgroundFixtures.Add(item);
                i += 1;
            }
            this.ForegroundsCount = reader.ReadByte();
            int foregroundsCount = this.ForegroundsCount;
            int j = 1;

            while (j <= foregroundsCount)
            {
                Fixture fixture2 = new Fixture();
                fixture2.Init(reader);
                this.ForegroundFixtures.Add(fixture2);
                j += 1;
            }
            this.CellsCount = 560;
            reader.ReadInt();
            this.GroundCRC   = reader.ReadInt().ToString();
            this.LayersCount = reader.ReadByte();
            int layersCount = this.LayersCount;
            int k           = 1;

            while (k <= layersCount)
            {
                Layer layer = new Layer();
                layer.Init(reader, this.MapVersion);
                this.Layers.Add(layer);
                k += 1;
            }
            int  cellsCount = this.CellsCount;
            int  m          = 1;
            uint oldMvtSys  = 0;

            while (m <= cellsCount)
            {
                CellData data = new CellData();
                data.Init(reader, this.MapVersion);
                if (oldMvtSys == 0)
                {
                    oldMvtSys = (uint)data.MoveZone;
                }
                if (data.MoveZone != oldMvtSys)
                {
                    IsUsingNewMovementSystem = true;
                }
                this.Cells.Add(data);
                m += 1;
            }
        }
コード例 #8
0
        public void FromRaw(BigEndianReader param1, byte[] param2)
        {
            int             num1            = -1;
            BigEndianReader bigEndianReader = param1;

            byte[] numArray = param2;
            try
            {
                if (bigEndianReader.ReadByte() != (byte)77)
                {
                    throw new Exception("Unknown file format.");
                }
                this.MapVersion = (int)bigEndianReader.ReadByte();
                this.Id         = bigEndianReader.ReadInt();
                if (this.MapVersion >= 7)
                {
                    this.Encrypted         = bigEndianReader.ReadBoolean();
                    this.EncryptionVersion = (uint)bigEndianReader.ReadByte();
                    int n = bigEndianReader.ReadInt();
                    if (this.Encrypted)
                    {
                        if (numArray.Length < 1)
                        {
                            throw new Exception("Map decryption key is empty");
                        }
                        byte[] buffer = bigEndianReader.ReadBytes(n);
                        for (int index = 0; index < buffer.Length; ++index)
                        {
                            buffer[index] = (byte)((uint)buffer[index] ^ (uint)numArray[index % numArray.Length]);
                        }
                        bigEndianReader = new BigEndianReader((Stream) new MemoryStream(buffer));
                    }
                }
                this.RelativeId            = bigEndianReader.ReadInt();
                this.MapType               = (int)bigEndianReader.ReadByte();
                this.SubAreaId             = bigEndianReader.ReadInt();
                this.TopNeighbourId        = bigEndianReader.ReadInt();
                this.BottomNeighbourId     = bigEndianReader.ReadInt();
                this.LeftNeighbourId       = bigEndianReader.ReadInt();
                this.RightNeighbourId      = bigEndianReader.ReadInt();
                this.ShadowBonusOnEntities = bigEndianReader.ReadInt();
                if (this.MapVersion >= 9)
                {
                    int num2 = bigEndianReader.ReadInt();
                    this.BackgroundAlpha = (int)(((long)num2 & 4278190080L) >> 32);
                    this.BackgroundRed   = (num2 & 16711680) >> 16;
                    this.BackgroundGreen = (num2 & 65280) >> 8;
                    this.BackgroundBlue  = num2 & (int)byte.MaxValue;
                    int num3 = bigEndianReader.ReadInt();
                    this.GridColor = (uint)((int)(((long)num3 & 4278190080L) >> 32) & (int)byte.MaxValue | ((num3 & 16711680) >> 16 & (int)byte.MaxValue) << 16 | ((num3 & 65280) >> 8 & (int)byte.MaxValue) << 8 | num3 & (int)byte.MaxValue & (int)byte.MaxValue);
                }
                else if (this.MapVersion >= 3)
                {
                    this.BackgroundRed   = (int)bigEndianReader.ReadByte();
                    this.BackgroundGreen = (int)bigEndianReader.ReadByte();
                    this.BackgroundBlue  = (int)bigEndianReader.ReadByte();
                }
                this.BackgroundColor = (uint)(this.BackgroundAlpha & (int)byte.MaxValue | (this.BackgroundRed & (int)byte.MaxValue) << 16 | (this.BackgroundGreen & (int)byte.MaxValue) << 8 | this.BackgroundBlue & (int)byte.MaxValue);
                if (this.MapVersion >= 4)
                {
                    this.ZoomScale   = (int)bigEndianReader.ReadShort() / 100;
                    this.ZoomOffsetX = (int)bigEndianReader.ReadShort();
                    this.ZoomOffsetY = (int)bigEndianReader.ReadShort();
                    if (this.ZoomScale < 1)
                    {
                        this.ZoomScale   = 1;
                        this.ZoomOffsetY = 0;
                        this.ZoomOffsetX = 0;
                    }
                }
                if (this.MapVersion > 10)
                {
                    this.TacticalModeTemplateId = bigEndianReader.ReadInt();
                }
                this.UseLowPassFilter    = bigEndianReader.ReadByte() == (byte)1;
                this.UseReverb           = bigEndianReader.ReadByte() == (byte)1;
                this.PresetId            = !this.UseReverb ? -1 : bigEndianReader.ReadInt();
                this.BackgroundsCount    = (int)bigEndianReader.ReadByte();
                this.BackgroundsFixtures = new Fixture[this.BackgroundsCount];
                for (int index = 0; index < this.BackgroundsCount; ++index)
                {
                    Fixture fixture = new Fixture(this);
                    fixture.FromRaw(bigEndianReader);
                    this.BackgroundsFixtures[index] = fixture;
                }
                this.ForegroundsCount   = (int)bigEndianReader.ReadByte();
                this.ForegroundFixtures = new Fixture[this.ForegroundsCount];
                for (int index = 0; index < this.ForegroundsCount; ++index)
                {
                    Fixture fixture = new Fixture(this);
                    fixture.FromRaw(bigEndianReader);
                    this.ForegroundFixtures[index] = fixture;
                }
                this.CellsCount = Constants.MapCellsCount;
                bigEndianReader.ReadInt();
                this.GroundCrc   = bigEndianReader.ReadInt();
                this.LayersCount = (int)bigEndianReader.ReadByte();
                this.Layers      = new Layer[this.LayersCount];
                for (int index = 0; index < this.LayersCount; ++index)
                {
                    Layer layer = new Layer(this);
                    layer.FromRaw(bigEndianReader, this.MapVersion);
                    this.Layers[index] = layer;
                }
                this.Cells = new CellData[this.CellsCount];
                for (int index = 0; index < this.CellsCount; ++index)
                {
                    CellData cellData = new CellData(this, (uint)index);
                    cellData.FromRaw(bigEndianReader);
                    if (num1 == -1)
                    {
                        num1 = (int)cellData.MoveZone;
                    }
                    if ((long)cellData.MoveZone != (long)num1)
                    {
                        this.IsUsingNewMovementSystem = true;
                    }
                    this.Cells[index] = cellData;
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine((object)ex);
                throw;
            }
        }
コード例 #9
0
 public override void Deserialize(BigEndianReader reader)
 {
     ignoreAdded = Types.ProtocolTypeManager.GetInstance <Types.IgnoredInformations>(reader.ReadShort());
     ignoreAdded.Deserialize(reader);
     session = reader.ReadBoolean();
 }
コード例 #10
0
 public override void Deserialize(BigEndianReader reader)
 {
     verbose = reader.ReadBoolean();
     search  = reader.ReadUTF();
 }
コード例 #11
0
 public override void Deserialize(BigEndianReader reader)
 {
     base.Deserialize(reader);
     loyal = reader.ReadBoolean();
 }
コード例 #12
0
 public override void Deserialize(BigEndianReader reader)
 {
     kicked   = reader.ReadBoolean();
     memberId = reader.ReadInt();
 }
コード例 #13
0
        public void Open(string filePath)
        {
            FileInfo fileInfo = new FileInfo(filePath);

            if (m_Indexes == null)
            {
                m_Indexes = new Dictionary <int, int>();
            }
            m_UnDiacriticalIndex  = new Dictionary <int, int>();
            m_TextIndexes         = new Dictionary <string, int>();
            m_TextIndexesOverride = new Dictionary <string, string>();
            m_TextSortIndex       = new Dictionary <int, int>();

            byte[]     fileContent = new byte[fileInfo.Length];
            FileStream fileStream  = new FileStream(filePath, FileMode.Open, FileAccess.Read);

            fileStream.Read(fileContent, 0, fileContent.Length);
            fileStream.Dispose();

            m_Stream = new BigEndianReader(fileContent);

            int position = m_Stream.ReadInt();

            m_Stream.Seek(position, SeekOrigin.Begin);

            int indexCount = m_Stream.ReadInt();

            for (int index = 0; index < indexCount; index += 9)
            {
                int  key             = m_Stream.ReadInt();
                bool diacriticalText = m_Stream.ReadBoolean();
                int  pointeur        = m_Stream.ReadInt();
                m_Indexes.Add(key, pointeur);

                if (diacriticalText)
                {
                    index += 4;
                    m_UnDiacriticalIndex.Add(key, m_Stream.ReadInt());
                }
                else
                {
                    m_UnDiacriticalIndex.Add(key, pointeur);
                }
            }

            int textIndexesCount = m_Stream.ReadInt();

            while (textIndexesCount > 0)
            {
                position = (int)m_Stream.Position;
                m_TextIndexes.Add(m_Stream.ReadUTF(), m_Stream.ReadInt());
                textIndexesCount -= (int)(m_Stream.Position - position);
            }

            textIndexesCount = m_Stream.ReadInt();

            int i = 0;

            while (textIndexesCount > 0)
            {
                position = (int)m_Stream.Position;
                m_TextSortIndex.Add(m_Stream.ReadInt(), ++i);
                textIndexesCount -= (int)(m_Stream.Position - position);
            }
        }
コード例 #14
0
        internal void Init(BigEndianReader reader)
        {
            reader.ReadSByte();
            MapVersion = reader.ReadSByte();
            Id         = (int)reader.ReadUInt();

            if (MapVersion >= 7)
            {
                Encrypted        = reader.ReadBoolean();
                EncryptedVersion = reader.ReadSByte();
                var count = reader.ReadInt();
                if (Encrypted)
                {
                    var buffer  = CustomHex.ToArray(CustomHex.FromString("649ae451ca33ec53bbcbcc33becf15f4"));
                    var buffer2 = reader.ReadBytes(count);
                    for (var n = 0; n < buffer2.Length; n++)
                    {
                        buffer2[n] = Convert.ToByte(buffer2[n] ^ buffer[n % buffer.Length]);
                    }
                    reader = new BigEndianReader(buffer2);
                }
            }

            RelativeId            = (int)reader.ReadUInt();
            MapType               = reader.ReadSByte();
            SubAreaId             = reader.ReadInt();
            TopNeighbourId        = reader.ReadInt();
            BottomNeighbourId     = reader.ReadInt();
            LeftNeighbourId       = reader.ReadInt();
            RightNeighbourId      = reader.ReadInt();
            ShadowBonusOnEntities = (int)reader.ReadUInt();

            if (MapVersion >= 9)
            {
                var readColor = reader.ReadInt();
                BackgroundAlpha = (readColor & 4278190080) >> 32;
                BackgroundRed   = (readColor & 16711680) >> 16;
                BackgroundGreen = (readColor & 65280) >> 8;
                BackgroundBlue  = readColor & 255;
                var readColor2 = reader.ReadUInt();
                GridAlpha = (readColor2 & 4278190080) >> 32;
                GridRed   = (readColor2 & 16711680) >> 16;
                GridGreen = (readColor2 & 65280) >> 8;
                GridBlue  = readColor2 & 255;
            }
            else if (MapVersion >= 3)
            {
                BackgroundRed   = reader.ReadSByte();
                BackgroundGreen = reader.ReadSByte();
                BackgroundBlue  = reader.ReadSByte();
            }
            if (MapVersion >= 4)
            {
                ZoomScale   = Convert.ToDouble(reader.ReadUShort()) / 100;
                ZoomOffsetX = reader.ReadShort();
                ZoomOffsetY = reader.ReadShort();
            }

            UseLowPassFilter = reader.ReadBoolean();
            UseReverb        = reader.ReadBoolean();
            if (UseReverb)
            {
                PresetId = reader.ReadInt();
            }
            BackgroundsCount = reader.ReadSByte();
            for (var i = 0; i < BackgroundsCount; i++)
            {
                var item = new Fixture();
                item.Init(reader);
                BackgroundFixtures.Add(item);
            }
            ForegroundsCount = reader.ReadSByte();
            for (var i = 0; i < ForegroundsCount; i++)
            {
                var fixture2 = new Fixture();
                fixture2.Init(reader);
                ForegroundFixtures.Add(fixture2);
            }
            CellsCount = 560;
            reader.ReadInt();
            GroundCRC   = reader.ReadInt().ToString();
            LayersCount = reader.ReadSByte();
            for (var i = 0; i < LayersCount; i++)
            {
                var layer = new Layer();
                layer.Init(reader, MapVersion);
                Layers.Add(layer);
            }
            uint oldMvtSys = 0;

            for (var i = 0; i < CellsCount; i++)
            {
                var data = new CellData();
                data.Init(reader, MapVersion);
                if (oldMvtSys == 0)
                {
                    oldMvtSys = data.MoveZone;
                }
                if (data.MoveZone != oldMvtSys)
                {
                    IsUsingNewMovementSystem = true;
                }
                Cells.Add(data);
            }
        }
コード例 #15
0
 public override void Deserialize(BigEndianReader reader)
 {
     allianceInfo = new Types.AllianceInformations();
     allianceInfo.Deserialize(reader);
     enabled = reader.ReadBoolean();
 }