示例#1
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);
     }
 }
 public override void Serialize(IUnmanagedMemoryWriter writer)
 {
     base.Serialize(writer);
     writer.WriteBoolean(Win);
     writer.WriteByte(Level);
     writer.WriteInt32(Experience);
     writer.WriteInt32(EllapsedSeconds);
     writer.WriteByte((byte)ItemReward.Count());
     foreach (var item in ItemReward)
     {
         writer.WriteItem(item);
     }
 }
        public override void Serialize(IUnmanagedMemoryWriter writer)
        {
            base.Serialize(writer);

            writer.WriteUInt16((ushort)(Failure ? 1 : 0));
            if (CharacterId > 0)
            {
                writer.WriteInt32(CharacterId);
                writer.WriteByte((byte)Type);
            }
        }
        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);
                }
            }
        }
示例#5
0
 public static IUnmanagedMemoryWriter WriteItem(this IUnmanagedMemoryWriter writer, Item item)
 {
     writer.WriteInt32(item.Id);
     writer.WriteByte(item.CategoryType);
     writer.WriteInt32(item.Index);
     writer.WriteByte(item.UseType);
     writer.WriteInt32(item.Quantity);
     if (item.ExpirationDate == null)
     {
         writer.WriteInt64(0);
     }
     else
     {
         writer.WriteInt64((long)((item.ExpirationDate.Value - DateTime.Now).TotalMilliseconds * 10000));
     }
     writer.WriteByte(item.EnchantStrength);
     writer.WriteByte(item.EnchantStamina);
     writer.WriteByte(item.EnchantDexterity);
     writer.WriteByte(item.EnchantWillpower);
     writer.WriteByte(item.Unknown1);
     writer.WriteByte(item.Unknown2);
     return(writer);
 }
示例#6
0
        public override void Serialize(IUnmanagedMemoryWriter writer)
        {
            base.Serialize(writer);
            writer.WriteInt32(Unknown);
            writer.WriteUInt16((ushort)Items.Count);

            foreach (var item in Items)
            {
                writer.WriteInt32(item.Index);
                writer.WriteByte((byte)(item.PriceType == ShopPriceType.Gold ? 0 : 1));
                writer.WriteInt32(item.GoldBack);
                writer.WriteInt32(item.Use0);
                writer.WriteInt32(item.Use1);
                writer.WriteInt32(item.Use2);
                writer.WriteInt32(item.Price0);
                writer.WriteInt32(item.Price1);
                writer.WriteInt32(item.Price2);
                writer.WriteInt32(item.OldPrice0);
                writer.WriteInt32(item.OldPrice1);
                writer.WriteInt32(item.OldPrice2);
            }
        }
示例#7
0
 public override void Serialize(IUnmanagedMemoryWriter writer)
 {
     base.Serialize(writer);
     writer.WriteByte((byte)Type);
     writer.WriteByte(0);
 }
示例#8
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);
            }
        }
 public override void Serialize(IUnmanagedMemoryWriter writer)
 {
     base.Serialize(writer);
     writer.WriteUInt16((ushort)(Failure ? 1 : 0));
     writer.WriteByte(Flag);
 }
 public override void Serialize(IUnmanagedMemoryWriter writer)
 {
     base.Serialize(writer);
     writer.WriteByte(Level);
     writer.WriteInt32(Experience);
 }