public override void Serialize(IUnmanagedMemoryWriter writer)
        {
            base.Serialize(writer);
            writer.WriteByte((byte)GameServers.Count());

            foreach (var server in GameServers)
            {
                writer.WriteByte(server.UnknownByte);
                writer.WriteInt16(server.Id);
                writer.WriteByte((byte)server.Type);
                writer.WriteString(server.Host, Encoding.Unicode, 256);
                writer.WriteUInt16(server.Port);
                writer.WriteUInt16(server.OnlineCount);
                writer.WriteBoolean(server.ShowName);
                if (server.ShowName)
                {
                    writer.WriteString(server.Name, Encoding.Unicode, 64);
                }
            }
        }
Example #2
0
 public override void Serialize(IUnmanagedMemoryWriter writer)
 {
     base.Serialize(writer);
     writer.WriteByte((byte)Friends.Count());
     foreach (var friend in Friends)
     {
         writer.WriteInt32(friend.Id);
         writer.WriteString(friend.Name, Encoding.Unicode, 12);
         writer.WriteByte(friend.Type);
         writer.WriteInt16(friend.ActiveServer);
     }
 }
Example #3
0
        public override void Serialize(IUnmanagedMemoryWriter writer)
        {
            base.Serialize(writer);

            writer.WriteInt32(CClientNet_Vftable);
            writer.WriteInt32(Unknown2);
            writer.WriteByte(Unknown3);
            writer.WriteInt32(SelectedCharacterId);
            writer.WriteByte(Unknown4);
            writer.WriteByte((byte)Characters.Count());

            foreach (var character in Characters)
            {
                writer.WriteInt32(character.Id);
                writer.WriteString(character.Name, Encoding.Unicode, 12);
                writer.WriteByte(character.Level);
                writer.WriteBoolean(character.IsCreated);
                writer.WriteByte(character.UnknownByte1);
                writer.WriteInt32(character.Gold);
                writer.WriteByte((byte)character.Type);
                writer.WriteByte(character.Strength);
                writer.WriteByte(character.Stamina);
                writer.WriteByte(character.Dexterity);
                writer.WriteByte(character.Willpower);
                writer.WriteByte(character.StatusPoints);
                //TODO: handle name change
                writer.WriteBoolean(character.NameChangeAllowed && !character.NameChangeByIcon);
                writer.WriteBoolean(character.NameChangeAllowed && character.NameChangeByIcon);

                var equipment = EquipmentBuilder.Generate(Items.Where(p => p.CharacterId == character.Id));
                writer.Write(equipment.HairIndex);
                writer.Write(equipment.FaceIndex);
                writer.Write(equipment.DressIndex);
                writer.Write(equipment.PantsIndex);
                writer.Write(equipment.SocksIndex);
                writer.Write(equipment.ShoesIndex);
                writer.Write(equipment.GlovesIndex);
                writer.Write(equipment.RacketIndex);
                writer.Write(equipment.GlassesIndex);
                writer.Write(equipment.BagIndex);
                writer.Write(equipment.HatIndex);
                writer.Write(equipment.DyeIndex);
            }
        }