Ejemplo n.º 1
0
        public void Marshal(Span <byte> span, int protocolVersion)
        {
            var writer = new SpanWriter(span);

            writer.Skip(8);
            foreach (var c in _characters)
            {
                if (c == null)
                {
                    writer.WriteByte(0);
                }
                else
                {
                    writer.WriteByte(c.Level);
                    writer.WriteDaocString(c.Name);
                    writer.WriteUInt32LittleEndian(0x18);
                    writer.Write(c.Customization);
                    writer.Skip(13);
                    writer.WriteDaocString(c.LocationDescription);
                    writer.WriteDaocString(c.Classification.Class.DisplayName());
                    writer.WriteDaocString(c.Classification.Race.ToString());
                    writer.WriteUInt16LittleEndian(c.Model);
                    writer.WriteUInt16LittleEndian(c.Region);
                    writer.Write(c.Equipment);
                    writer.Write(c.Stats);
                    writer.Write(c.Classification);
                    // active weapon slots - see DoL's PacketLib1125.cs line 340
                    writer.WriteByte(0xFF);
                    writer.WriteByte(0xFF);
                    writer.WriteByte(0x01);                     // something about region
                    writer.WriteByte(c.Stats.Constitution);
                }
            }
            // TODO real stuff - see DoL's PacketLib1125.SendCharacterOverview
        }
Ejemplo n.º 2
0
        public void Marshal(Span <byte> span, int protocolVersion)
        {
            var writer = new SpanWriter(span);

            writer.WriteUInt32BigEndian(_timestamp);
            writer.Skip(4);
            writer.WriteUInt16BigEndian(_sequence);
        }
Ejemplo n.º 3
0
        public void Marshal(Span <byte> span, int protocolVersion)
        {
            var writer = new SpanWriter(span);

            // DoL writes byte 0x00 and then region ID as a byte
            // but region is represented elsewhere as a ushort
            writer.WriteUInt16BigEndian(_region.Id);
            writer.Skip(20);
            writer.WriteFixedString(_region.Port.ToString(), 5);
            writer.WriteFixedString(_region.Port.ToString(), 5);             // yeah, twice
            writer.WriteFixedString(_region.Address.ToString(), 20);
        }