Ejemplo n.º 1
0
 public override void WriteData(RAMBuffer buffer)
 {
     buffer.WriteByte(StretchMode);
     buffer.WriteByte(CompensationMode);
     buffer.WriteByte(DropAnimationMode);
     buffer.WriteByte(PenetrationMode);
     buffer.WriteByte(Unknown24);
     buffer.WriteFloat(ProjectileArc);
 }
Ejemplo n.º 2
0
 public override void WriteData(RAMBuffer buffer)
 {
     buffer.WriteShort(SheepConversion);
     buffer.WriteFloat(SearchRadius);
     buffer.WriteFloat(WorkRate);
     buffer.WriteShort(DropSite1);
     buffer.WriteShort(DropSite2);
     buffer.WriteByte(VillagerMode);
     buffer.WriteShort(AttackSound);
     buffer.WriteShort(MoveSound);
     buffer.WriteByte(AnimalMode);
 }
Ejemplo n.º 3
0
        public override void WriteData(RAMBuffer buffer)
        {
            buffer.WriteByte((byte)TechTreeAges.Count);
            buffer.WriteByte((byte)BuildingConnections.Count);
            buffer.WriteByte((byte)UnitConnections.Count);
            buffer.WriteByte((byte)ResearchConnections.Count);
            buffer.WriteInteger(Unknown2);

            TechTreeAges.ForEach(e => e.WriteData(buffer));
            BuildingConnections.ForEach(e => e.WriteData(buffer));
            UnitConnections.ForEach(e => e.WriteData(buffer));
            ResearchConnections.ForEach(e => e.WriteData(buffer));
        }
Ejemplo n.º 4
0
        public override void WriteData(RAMBuffer buffer)
        {
            buffer.WriteShort(WalkingGraphic1);
            buffer.WriteShort(WalkingGraphic2);
            buffer.WriteFloat(RotationSpeed);
            buffer.WriteByte(Unknown11);
            buffer.WriteShort(TrackingUnit);
            buffer.WriteByte(TrackingUnitUsed);
            buffer.WriteFloat(TrackingUnitDensity);
            buffer.WriteByte(Unknown16);

            AssertListLength(Unknown16B, 5);
            Unknown16B.ForEach(e => buffer.WriteInteger(e));
        }
Ejemplo n.º 5
0
 public override void WriteData(RAMBuffer buffer)
 {
     buffer.WriteByte(Type);
     buffer.WriteShort(A);
     buffer.WriteShort(B);
     buffer.WriteShort(C);
     buffer.WriteFloat(D);
 }
Ejemplo n.º 6
0
        public override void WriteData(RAMBuffer buffer)
        {
            buffer.WriteByte(One);
            buffer.WriteString(Name, 20);
            buffer.WriteUShort((ushort)Resources.Count);
            buffer.WriteShort(TechTreeID);
            buffer.WriteShort(TeamBonusID);
            Resources.ForEach(e => buffer.WriteFloat(e));
            buffer.WriteByte(IconSet);
            buffer.WriteUShort((ushort)UnitPointers.Count);
            UnitPointers.ForEach(e => buffer.WriteInteger(e));

            // Sicherstellen, dass genau jede definierte Einheit einen entsprechenden Pointer hat; hier nur über die Listenlänge, sollte aber die meisten auftretenden Fehler abdecken
            AssertListLength(Units, UnitPointers.Count(p => p != 0));
            foreach(var u in Units)
                u.Value.WriteData(buffer);
        }
Ejemplo n.º 7
0
        public override void WriteData(RAMBuffer buffer)
        {
            buffer.WriteByte(Exists);

            if(Exists != 0)
            {
                buffer.WriteUShort((ushort)Commands.Count);
                Commands.ForEach(e => e.WriteData(buffer));
            }
        }
Ejemplo n.º 8
0
        public override void WriteData(RAMBuffer buffer)
        {
            buffer.WriteShort(ConstructionGraphicID);
            buffer.WriteShort(SnowGraphicID);
            buffer.WriteByte(AdjacentMode);
            buffer.WriteShort(GraphicsAngle);
            buffer.WriteByte(DisappearsWhenBuilt);
            buffer.WriteShort(StackUnitID);
            buffer.WriteShort(FoundationTerrainID);
            buffer.WriteShort(OldTerrainLikeID);
            buffer.WriteShort(ResearchID);
            buffer.WriteByte(Unknown33);

            AssertListLength(Annexes, 4);
            Annexes.ForEach(e => e.WriteData(buffer));

            buffer.WriteShort(HeadUnit);
            buffer.WriteShort(TransformUnit);
            buffer.WriteShort(UnknownSound);
            buffer.WriteShort(ConstructionSound);
            buffer.WriteByte(GarrisonType);
            buffer.WriteFloat(GarrisonHealRate);
            buffer.WriteFloat(Unknown35);
            buffer.WriteShort(PileUnit);

            AssertListLength(LootingTable, 6);
            LootingTable.ForEach(e => buffer.WriteByte(e));
        }
Ejemplo n.º 9
0
            public override void WriteData(RAMBuffer buffer)
            {
                buffer.WriteInteger(ID);
                buffer.WriteByte(Unknown1);
                buffer.WriteInteger(UpperBuilding);

                Common.WriteData(buffer);

                buffer.WriteInteger(VerticalLine);

                buffer.WriteByte((byte)Units.Count);
                Units.ForEach(e => buffer.WriteInteger(e));

                buffer.WriteInteger(LocationInAge);
                buffer.WriteInteger(RequiredResearch);
                buffer.WriteInteger(LineMode);
                buffer.WriteInteger(EnablingResearch);
            }
Ejemplo n.º 10
0
            public override void WriteData(RAMBuffer buffer)
            {
                buffer.WriteInteger(ID);
                buffer.WriteByte(Unknown2);

                buffer.WriteByte((byte)Buildings.Count);
                Buildings.ForEach(e => buffer.WriteInteger(e));

                buffer.WriteByte((byte)Units.Count);
                Units.ForEach(e => buffer.WriteInteger(e));

                buffer.WriteByte((byte)Researches.Count);
                Researches.ForEach(e => buffer.WriteInteger(e));

                Common.WriteData(buffer);
                buffer.WriteByte(SlotsUsed);

                AssertListLength(Unknown4, 10);
                Unknown4.ForEach(e => buffer.WriteByte(e));

                AssertListLength(Unknown5, 10);
                Unknown5.ForEach(e => buffer.WriteByte(e));

                buffer.WriteByte(Unknown6);
                buffer.WriteInteger(LineMode);
            }
Ejemplo n.º 11
0
            public override void WriteData(RAMBuffer buffer)
            {
                buffer.WriteInteger(ID);
                buffer.WriteByte(Unknown1);

                buffer.WriteByte((byte)Buildings.Count);
                Buildings.ForEach(e => buffer.WriteInteger(e));

                buffer.WriteByte((byte)Units.Count);
                Units.ForEach(e => buffer.WriteInteger(e));

                buffer.WriteByte((byte)Researches.Count);
                Researches.ForEach(e => buffer.WriteInteger(e));

                Common.WriteData(buffer);
                buffer.WriteByte(LocationInAge);

                AssertListLength(UnitsTechsTotal, 5);
                UnitsTechsTotal.ForEach(e => buffer.WriteByte(e));

                AssertListLength(UnitsTechsFirst, 5);
                UnitsTechsFirst.ForEach(e => buffer.WriteByte(e));

                buffer.WriteInteger(LineMode);
                buffer.WriteInteger(EnablingResearch);
            }
Ejemplo n.º 12
0
        public override void WriteData(RAMBuffer buffer)
        {
            AssertListLength(RequiredTechs, 6);
            RequiredTechs.ForEach(e => buffer.WriteShort(e));

            AssertListLength(ResourceCosts, 3);
            ResourceCosts.ForEach(e =>
            {
                buffer.WriteShort(e.Type);
                buffer.WriteShort(e.Amount);
                buffer.WriteByte(e.Enabled);
            });

            buffer.WriteShort(RequiredTechCount);
            buffer.WriteShort(Civ);
            buffer.WriteShort(FullTechMode);
            buffer.WriteShort(ResearchLocation);
            buffer.WriteUShort(LanguageDLLName1);
            buffer.WriteUShort(LanguageDLLDescription);
            buffer.WriteShort(ResearchTime);
            buffer.WriteShort(TechageID);
            buffer.WriteShort(Type);
            buffer.WriteShort(IconID);
            buffer.WriteByte(ButtonID);
            buffer.WriteInteger(LanguageDLLHelp);
            buffer.WriteInteger(LanguageDLLName2);
            buffer.WriteInteger(Unknown1);

            buffer.WriteUShort((ushort)Name.Length);
            buffer.WriteString(Name);
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Schreibt die enthaltenen Daten in das interne RAMBuffer-Objekt.
        /// </summary>
        /// <remarks></remarks>
        public void WriteData()
        {
            // Puffer initialisieren
            _buffer = new RAMBuffer();

            // --- HEADER ---
            WriteString(_buffer, _header.Copyright, 40);
            WriteString(_buffer, _header.Version, 4);
            WriteString(_buffer, _header.FileType, 12);
            _buffer.WriteUInteger(_header.TableCount);

            // ErsteDateiOffset wird vor den Tabellen berechnet, daher erstmal 0
            _buffer.WriteUInteger(0);

            // Erstes Tabellen-Offset ausrechnen Hilft bei der Geschwindigkeitserhöhung beim TABELLEN-Prozess
            uint aktTableOffset = (uint)(_buffer.Position + _tableInfos.Count * 12);

            // --- TABELLENINFORMATIONEN ---
            TableInfo currTableInfo;
            for(int i = 0; i < _tableInfos.Count; ++i)
            {
                // Tabelleninformationen holen
                currTableInfo = _tableInfos[i];

                // Werte schreiben
                _buffer.WriteByte(currTableInfo.Unknown1);
                WriteString(_buffer, currTableInfo.ResourceType, 3);
                _buffer.WriteUInteger(aktTableOffset);
                _buffer.WriteUInteger(currTableInfo.FileCount);

                // Offset erhöhen
                aktTableOffset += currTableInfo.FileCount * 12;
            }

            // Erstes Datei-Offset ausrechnen Hilft bei der Geschwindigkeitserhöhung beim DATEIEN-Prozess
            uint aktFileOffset = (uint)_buffer.Position;
            for(int i = 0; i < _tables.Count; ++i)
                aktFileOffset += (uint)(_tables[i].Entries.Count * 12);

            // Header->ErsteDateiOffset
            uint aktPos = (uint)_buffer.Position;
            _buffer.Position = 60;
            _buffer.WriteUInteger(aktFileOffset);
            _buffer.Position = (int)aktPos;

            // --- TABELLEN ---
            Table currTable;
            TableEntry currEntry;
            for(int i = 0; i < _tables.Count; ++i)
            {
                // Tabelle abrufen
                currTable = _tables[i];

                // Einträge schreiben
                for(int j = 0; j < currTable.Entries.Count; ++j)
                {
                    // Eintrag abrufen
                    currEntry = currTable.Entries[j];

                    // Werte schreiben
                    _buffer.WriteUInteger(currEntry.FileID);
                    _buffer.WriteUInteger(aktFileOffset);
                    _buffer.WriteUInteger(currEntry.FileSize);

                    // Offset erhöhen
                    aktFileOffset += currEntry.FileSize;
                }
            }

            // --- DATEIEN ---
            foreach(Table aktT in _tables)
            {
                // Alle Einträge durchlaufen
                foreach(TableEntry currE in aktT.Entries)
                {
                    // Zum Eintrag gehörige Datei suchen
                    foreach(KeyValuePair<uint, byte[]> currFile in _files)
                    {
                        // Datei gefunden?
                        if(currE.FileID == currFile.Key)
                        {
                            _buffer.Write(currFile.Value);
                            break;
                        }
                    }
                }
            }
        }
Ejemplo n.º 14
0
        public override void WriteData(RAMBuffer buffer)
        {
            buffer.WriteString(Name1, 21);
            buffer.WriteString(Name2, 13);

            buffer.WriteInteger(SLP);
            buffer.WriteByte(Unknown1);
            buffer.WriteByte(Unknown2);
            buffer.WriteByte(Layer);
            buffer.WriteByte(PlayerColor);
            buffer.WriteByte(Rainbow);
            buffer.WriteByte(Replay);

            AssertListLength(Coordinates, 4);
            Coordinates.ForEach(e => buffer.WriteShort(e));

            buffer.WriteUShort((ushort)Deltas.Count);
            buffer.WriteShort(SoundID);
            buffer.WriteByte(AttackSoundUsed);
            buffer.WriteUShort(FrameCount);
            buffer.WriteUShort(AngleCount);
            buffer.WriteFloat(NewSpeed);
            buffer.WriteFloat(FrameRate);
            buffer.WriteFloat(ReplayDelay);
            buffer.WriteByte(SequenceType);
            buffer.WriteShort(ID);
            buffer.WriteByte(MirroringMode);
            buffer.WriteByte(Unknown3);

            Deltas.ForEach(e => e.WriteData(buffer));
            if(AttackSoundUsed != 0)
            {
                AssertListLength(AttackSounds, AngleCount);
                AttackSounds.ForEach(e => e.WriteData(buffer));
            }
        }
Ejemplo n.º 15
0
            public override void WriteData(RAMBuffer buffer)
            {
                buffer.WriteShort(One);
                buffer.WriteShort(ID);
                buffer.WriteByte(Unknown1);
                buffer.WriteShort(Type);
                buffer.WriteShort(ClassID);
                buffer.WriteShort(UnitID);
                buffer.WriteShort(TerrainID);
                buffer.WriteShort(ResourceIn);
                buffer.WriteShort(ResourceProductivityMultiplier);
                buffer.WriteShort(ResourceOut);
                buffer.WriteShort(Resource);
                buffer.WriteFloat(WorkRateMultiplier);
                buffer.WriteFloat(ExecutionRadius);
                buffer.WriteFloat(ExtraRange);
                buffer.WriteByte(Unknown4);
                buffer.WriteFloat(Unknown5);
                buffer.WriteByte(SelectionEnabler);
                buffer.WriteByte(Unknown7);
                buffer.WriteShort(PlunderSource);
                buffer.WriteShort(Unknown9);
                buffer.WriteByte(SelectionMode);
                buffer.WriteByte(RightClickMode);
                buffer.WriteByte(Unknown12);

                AssertListLength(Graphics, 6);
                Graphics.ForEach(e => buffer.WriteShort(e));
            }
Ejemplo n.º 16
0
        public override void WriteData(RAMBuffer buffer)
        {
            AssertListLength(ResourceCosts, 3);
            ResourceCosts.ForEach(e =>
            {
                buffer.WriteShort(e.Type);
                buffer.WriteShort(e.Amount);
                buffer.WriteShort(e.Enabled);
            });

            buffer.WriteShort(TrainTime);
            buffer.WriteShort(TrainLocationID);
            buffer.WriteByte(ButtonID);
            buffer.WriteInteger(Unknown26);
            buffer.WriteInteger(Unknown27);
            buffer.WriteByte(Unknown28);
            buffer.WriteByte(HeroMode);
            buffer.WriteInteger(GarrisonGraphic);
            buffer.WriteFloat(DuplicatedMissilesMin);
            buffer.WriteByte(DuplicatedMissilesMax);

            AssertListLength(MissileSpawningArea, 3);
            MissileSpawningArea.ForEach(e => buffer.WriteFloat(e));

            buffer.WriteInteger(AlternativeProjectileUnit);
            buffer.WriteInteger(ChargingGraphic);
            buffer.WriteByte(ChargingMode);
            buffer.WriteShort(DisplayedPierceArmour);
        }
Ejemplo n.º 17
0
            public override void WriteData(RAMBuffer buffer)
            {
                buffer.WriteByte((byte)Type);
                buffer.WriteUShort((ushort)Name1.Length);
                buffer.WriteShort(ID1);
                buffer.WriteUShort(LanguageDLLName);
                buffer.WriteUShort(LanguageDLLCreation);
                buffer.WriteShort(Class);
                buffer.WriteShort(StandingGraphic1);
                buffer.WriteShort(StandingGraphic2);
                buffer.WriteShort(DyingGraphic1);
                buffer.WriteShort(DyingGraphic2);
                buffer.WriteByte(DeathMode);
                buffer.WriteShort(HitPoints);
                buffer.WriteFloat(LineOfSight);
                buffer.WriteByte(GarrisonCapacity);
                buffer.WriteFloat(SizeRadius1);
                buffer.WriteFloat(SizeRadius2);
                buffer.WriteFloat(HPBarHeight1);
                buffer.WriteShort(TrainSound1);
                buffer.WriteShort(TrainSound2);
                buffer.WriteShort(DeadUnitID);
                buffer.WriteByte(PlacementMode);
                buffer.WriteByte(AirMode);
                buffer.WriteShort(IconID);
                buffer.WriteByte(HideInEditor);
                buffer.WriteShort(Unknown1);
                buffer.WriteByte(Enabled);
                buffer.WriteByte(Disabled);
                buffer.WriteShort(PlacementBypassTerrain1);
                buffer.WriteShort(PlacementBypassTerrain2);
                buffer.WriteShort(PlacementTerrain1);
                buffer.WriteShort(PlacementTerrain2);
                buffer.WriteFloat(EditorRadius1);
                buffer.WriteFloat(EditorRadius2);
                buffer.WriteByte(HillMode);
                buffer.WriteByte(VisibleInFog);
                buffer.WriteShort(TerrainRestriction);
                buffer.WriteByte(FlyMode);
                buffer.WriteShort(ResourceCapacity);
                buffer.WriteFloat(ResourceDecay);
                buffer.WriteByte(BlastType);
                buffer.WriteByte(Unknown2);
                buffer.WriteByte(InteractionMode);
                buffer.WriteByte(MinimapMode);
                buffer.WriteByte(CommandAttribute);
                buffer.WriteFloat(Unknown3A);
                buffer.WriteByte(MinimapColor);
                buffer.WriteInteger(LanguageDLLHelp);
                buffer.WriteInteger(LanguageDLLHotKeyText);
                buffer.WriteInteger(HotKey);
                buffer.WriteByte(Unselectable);
                buffer.WriteByte(Unknown6);
                buffer.WriteByte(UnknownSelectionMode);
                buffer.WriteByte(Unknown8);
                buffer.WriteByte(SelectionMask);
                buffer.WriteByte(SelectionShapeType);
                buffer.WriteByte(SelectionShape);
                buffer.WriteByte(Attribute);
                buffer.WriteByte(Civilization);
                buffer.WriteShort(Nothing);
                buffer.WriteByte(SelectionEffect);
                buffer.WriteByte(EditorSelectionColor);
                buffer.WriteFloat(SelectionRadius1);
                buffer.WriteFloat(SelectionRadius2);
                buffer.WriteFloat(HPBarHeight2);

                AssertListLength(ResourceStorages, 3);
                ResourceStorages.ForEach(e =>
                {
                    buffer.WriteShort(e.Type);
                    buffer.WriteFloat(e.Amount);
                    buffer.WriteByte(e.Enabled);
                });

                buffer.WriteByte((byte)DamageGraphics.Count);
                DamageGraphics.ForEach(e => e.WriteData(buffer));

                buffer.WriteShort(SelectionSound);
                buffer.WriteShort(DyingSound);
                buffer.WriteByte(AttackMode);
                buffer.WriteByte(EdibleMeat);
                buffer.WriteString(Name1);
                buffer.WriteShort(ID2);
                buffer.WriteShort(ID3);

                if(Type >= UnitType.Flag)
                    buffer.WriteFloat(Speed);
                if(Type >= UnitType.DeadFish)
                    DeadFish.WriteData(buffer);
                if(Type >= UnitType.Bird)
                    Bird.WriteData(buffer);
                if(Type >= UnitType.Type50)
                    Type50.WriteData(buffer);
                if(Type == UnitType.Projectile)
                    Projectile.WriteData(buffer);
                if(Type >= UnitType.Creatable)
                    Creatable.WriteData(buffer);
                if(Type == UnitType.Building)
                    Building.WriteData(buffer);
            }
Ejemplo n.º 18
0
            public override void WriteData(RAMBuffer buffer)
            {
                // Eigenschaften schreiben
                buffer.WriteByte((byte)ElementType);
                buffer.WriteShort(ElementObjectID);
                buffer.WriteByte(Age);
                buffer.WriteByte((byte)RenderMode);

                // Deaktivierende Kulturen schreiben
                buffer.WriteByte((byte)DisableCivs.Count);
                DisableCivs.ForEach(c => buffer.WriteByte(c));

                // Kindelemente schreiben
                buffer.WriteShort((short)Children.Count);
                Children.ForEach(c => c.WriteData(buffer));

                // Benötigte Elemente schreiben
                buffer.WriteShort((short)RequiredElements.Count);
                RequiredElements.ForEach(r => { buffer.WriteByte((byte)r.Item1); buffer.WriteShort(r.Item2); });
            }
Ejemplo n.º 19
0
            public override void WriteData(RAMBuffer buffer)
            {
                // SLP-Daten
                buffer.WriteInteger(NodeSlpFileName.Length);
                buffer.WriteString(NodeSlpFileName);
                buffer.WriteInteger(NodeSlpId);
                buffer.WriteInteger(ScrollSlpFileName.Length);
                buffer.WriteString(ScrollSlpFileName);
                buffer.WriteInteger(ScrollSlpId);
                buffer.WriteInteger(TileSlpFileName.Length);
                buffer.WriteString(TileSlpFileName);
                buffer.WriteInteger(TileSlpId);
                buffer.WriteInteger(LegendAgesSlpFileName.Length);
                buffer.WriteString(LegendAgesSlpFileName);
                buffer.WriteInteger(LegendAgesSlpId);
                buffer.WriteInteger(LegendDisableSlpFileName.Length);
                buffer.WriteString(LegendDisableSlpFileName);
                buffer.WriteInteger(LegendDisableSlpId);

                // Scroll-Daten
                buffer.WriteInteger(MouseScrollArea);
                buffer.WriteInteger(MouseScrollDelay);
                buffer.WriteInteger(MouseScrollOffset);
                buffer.WriteInteger(KeyScrollOffset);

                // Button-Rechtecke
                WriteRectangle(CloseButtonRelativeRectangle, buffer);
                WriteRectangle(ScrollLeftButtonRelativeRectangle, buffer);
                WriteRectangle(ScrollRightButtonRelativeRectangle, buffer);

                // Auflösungsdaten
                buffer.WriteInteger(ResolutionData.Count);
                foreach(var rd in ResolutionData)
                {
                    // Daten schreiben
                    buffer.WriteInteger(rd.Key);
                    rd.Value.WriteData(buffer);
                };

                // Popup-Label-Daten
                buffer.WriteInteger(PopupLabelDelay);
                buffer.WriteInteger(PopupLabelWidth);
                buffer.WriteInteger(PopupInnerPadding);
                AssertListLength(PopupBoxBevelColorIndices, 6);
                for(int i = 0; i < 6; ++i)
                    buffer.WriteByte(PopupBoxBevelColorIndices[i]);

                // Sonstige Daten
                buffer.WriteByte(NodeFontIndex);
            }
Ejemplo n.º 20
0
        public override void WriteData(RAMBuffer buffer)
        {
            buffer.WriteShort(DefaultArmour);

            buffer.WriteUShort((ushort)Attacks.Count);
            foreach(KeyValuePair<short, short> currA in Attacks)
            {
                buffer.WriteShort(currA.Key);
                buffer.WriteShort(currA.Value);
            }

            buffer.WriteUShort((ushort)Armours.Count);
            foreach(KeyValuePair<short, short> currA in Armours)
            {
                buffer.WriteShort(currA.Key);
                buffer.WriteShort(currA.Value);
            }

            buffer.WriteShort(TerrainRestrictionForDamageMultiplying);
            buffer.WriteFloat(MaxRange);
            buffer.WriteFloat(BlastRadius);
            buffer.WriteFloat(ReloadTime);
            buffer.WriteShort(ProjectileUnitID);
            buffer.WriteShort(AccuracyPercent);
            buffer.WriteByte(TowerMode);
            buffer.WriteShort(FrameDelay);

            AssertListLength(GraphicDisplacement, 3);
            GraphicDisplacement.ForEach(e => buffer.WriteFloat(e));

            buffer.WriteByte(BlastLevel);
            buffer.WriteFloat(MinRange);
            buffer.WriteFloat(AccuracyErrorRadius);
            buffer.WriteShort(AttackGraphic);
            buffer.WriteShort(DisplayedMeleeArmour);
            buffer.WriteShort(DisplayedAttack);
            buffer.WriteFloat(DisplayedRange);
            buffer.WriteFloat(DisplayedReloadTime);
        }
Ejemplo n.º 21
0
 public override void WriteData(RAMBuffer buffer)
 {
     buffer.WriteShort(GraphicID);
     buffer.WriteByte(DamagePercent);
     buffer.WriteByte(ApplyMode);
     buffer.WriteByte(Unknown2);
 }