private static void Add(this Packet packet, Account account)
{
packet.PutLong(DateTime.Now); // Last Login
packet.PutLong(DateTime.Now); // Last Logout
packet.PutInt(0);
packet.PutByte(1);
packet.PutByte(34);
packet.PutInt(0); // 0x800200FF
packet.PutByte(1);
// Premium services, listed in char selection
// --------------------------------------------------------------
// All 3 are visible, if one is set.
packet.PutByte(false); // Nao's Support
packet.PutLong(0);
packet.PutByte(false); // Extra Storage
packet.PutLong(0);
packet.PutByte(false); // Advanced Play
packet.PutLong(0);
packet.PutByte(0);
packet.PutByte(1);
// Always visible?
packet.PutByte(account.PremiumServices.HasInventoryPlusService);
packet.PutLong(account.PremiumServices.InventoryPlusExpiration);
packet.PutByte(account.PremiumServices.HasPremiumService);
packet.PutLong(account.PremiumServices.PremiumExpiration);
packet.PutByte(account.PremiumServices.HasVipService);
packet.PutLong(account.PremiumServices.VipExpiration);
// [170402, TW170300] New premium thing
{
// Invisible?
packet.PutByte(0);
packet.PutLong(0);
}
// [180800, NA196 (14.10.2014)] ?
{
packet.PutByte(0);
packet.PutLong(0);
}
packet.PutByte(0);
packet.PutByte(0); // 1: 프리미엄 PC방 서비스 사용중, 16: Free Play Event
packet.PutByte(false); // Free Beginner Service
// [200100, NA229 (2016-06-16)] ?
{
packet.PutByte(1);
}
// Characters
// --------------------------------------------------------------
packet.PutShort((short)account.Characters.Count);
foreach (var character in account.Characters)
{
packet.PutString(character.Server);
packet.PutLong(character.EntityId);
packet.PutString(character.Name);
packet.PutByte((byte)character.DeletionFlag);
packet.PutLong(0);
packet.PutInt(0);
packet.PutByte(0); // 0: Human, 1: Elf, 2: Giant
packet.PutByte(0); // Assist character ?
packet.PutByte(0); // >0 hides all characters?
}
// Pets
// --------------------------------------------------------------
packet.PutShort((short)account.Pets.Count);
foreach (var pet in account.Pets)
{
packet.PutString(pet.Server);
packet.PutLong(pet.EntityId);
packet.PutString(pet.Name);
packet.PutByte((byte)pet.DeletionFlag);
packet.PutLong(0);
packet.PutInt(pet.Race);
packet.PutLong(0);
packet.PutLong(0);
packet.PutInt(0);
packet.PutByte(0);
}
// Character cards
// --------------------------------------------------------------
packet.PutShort((short)account.CharacterCards.Count);
foreach (var card in account.CharacterCards)
{
packet.PutByte(1);
packet.PutLong(card.Id);
packet.PutInt(card.Type);
packet.PutLong(0);
packet.PutLong(0);
packet.PutInt(0);
}
// Pet cards
// --------------------------------------------------------------
packet.PutShort((short)account.PetCards.Count);
foreach (var card in account.PetCards)
{
packet.PutByte(1);
packet.PutLong(card.Id);
packet.PutInt(card.Type);
packet.PutInt(card.Race);
packet.PutLong(0);
packet.PutLong(0);
packet.PutInt(0);
}
// Gifts
// --------------------------------------------------------------
packet.PutShort((short)account.Gifts.Count);
foreach (var gift in account.Gifts)
{
packet.PutLong(gift.Id);
packet.PutByte(gift.IsCharacter);
packet.PutInt(gift.Type);
packet.PutInt(gift.Race);
packet.PutString(gift.Sender);
packet.PutString(gift.SenderServer);
packet.PutString(gift.Message);
packet.PutString(gift.Receiver);
packet.PutString(gift.ReceiverServer);
packet.PutLong(gift.Added);
}
packet.PutByte(0);
}