52 const int flag =
msg.readInt32(
"flag");
80 const int count = (
msg.readInt16(
"len") - 8) / 73;
81 const int amount =
msg.readInt32(
"amount");
85 for (
int f = 0; f < count; f ++)
88 mail->
id =
msg.readInt32(
"message id");
89 mail->
title =
msg.readString(40,
"title");
90 mail->
read =
msg.readUInt8(
"unread flag") != 0U ? true :
false;
91 mail->
sender =
msg.readString(24,
"sender name");
92 mail->
time =
msg.readInt32(
"time stamp");
100 const int sz =
msg.readInt16(
"len") - 101;
102 mail->
id =
msg.readInt32(
"message id");
103 mail->
title =
msg.readString(40,
"title");
104 mail->
sender =
msg.readString(24,
"sender name");
105 msg.readInt32(
"unused");
106 mail->
money =
msg.readInt32(
"money");
108 const int amount =
msg.readInt32(
"item amount");
109 const int itemId =
msg.readInt16(
"item id");
111 msg.readInt16(
"item type"));
112 const uint8_t identify =
msg.readUInt8(
"identify");
114 const uint8_t refine =
msg.readUInt8(
"refine");
117 cards[d] =
msg.readUInt16(
"card");
118 const int msgLen =
msg.readUInt8(
"msg len");
120 logger->
log(
"error: wrong message size");
121 mail->
text =
msg.readString(sz,
"message");
122 msg.readUInt8(
"zero");
138 if (inventory ==
nullptr)
144 const int slot = inventory->
addItem(itemId,
162 const uint8_t flag =
msg.readUInt8(
"flag");
182 const uint8_t flag =
msg.readUInt8(
"fail flag");
199 msg.readInt32(
"message id");
200 const std::string subj =
msg.readString(40,
"title");
201 const std::string sender =
msg.readString(24,
"sender name");
204 strprintf(
_(
"You have new mail from %s with subject %s"),
205 sender.c_str(), subj.c_str()));
211 const int index =
msg.readInt16(
"index");
212 const int flag =
msg.readUInt8(
"flag");
224 const int mail =
msg.readInt32(
"message id");
225 const int flag =
msg.readInt16(
"fail flag");
239 const int mail =
msg.readInt32(
"message id");
240 const int flag =
msg.readInt16(
"fail flag");
#define fromBool(val, name)
#define reportAlways(...)
void setCards(const int index, const int *const cards, const int size) const
int addItem(const int id, const ItemTypeT type, const int quantity, const uint8_t refine, const ItemColor color, const Identified identified, const Damaged damaged, const Favorite favorite, const Equipm equipment, const Equipped equipped)
static ItemColor getColorFromCards(const int *const cards)
void log(const char *const log_text,...)
Inventory * getInventory() const
void removeMail(const int64_t id)
void addMail(MailMessage *const message)
void showMessage(MailMessage *const mail, const int itemsCount)
virtual void refresh() const =0
virtual void setVisible(Visible visible)
bool isWindowVisible() const
const bool Equipped_false
const bool Favorite_false
#define UNIMPLEMENTEDPACKETFIELD(field)
Net::MailHandler * mailHandler
MailViewWindow * mailViewWindow
bool msg(InputEvent &event)
void processSendMailAck(Net::MessageIn &msg)
void processNewMail(Net::MessageIn &msg)
void processSetAttachmentAck(Net::MessageIn &msg)
void processMailOpen(Net::MessageIn &msg)
void processReadMail(Net::MessageIn &msg)
void processMailReturn(Net::MessageIn &msg)
void processDeleteAck(Net::MessageIn &msg)
void processMailList(Net::MessageIn &msg)
void processGetAttachment(Net::MessageIn &msg)
void notify(const unsigned int message)
@ MAIL_ATTACH_MONEY_ERROR
@ MAIL_GET_ATTACH_TOO_MANY_ITEMS
std::string strprintf(const char *const format,...)
std::string timeToStr(const uint32_t time)