本文整理汇总了C++中net::MessageIn::readUInt16方法的典型用法代码示例。如果您正苦于以下问题:C++ MessageIn::readUInt16方法的具体用法?C++ MessageIn::readUInt16怎么用?C++ MessageIn::readUInt16使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net::MessageIn
的用法示例。
在下文中一共展示了MessageIn::readUInt16方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processTradeItemAdd
void TradeRecv::processTradeItemAdd(Net::MessageIn &msg)
{
const int amount = msg.readInt32("amount");
const int type = msg.readInt16("type");
const uint8_t identify = msg.readUInt8("identify");
msg.readUInt8("attribute");
const uint8_t refine = msg.readUInt8("refine");
int cards[maxCards];
for (int f = 0; f < maxCards; f++)
cards[f] = msg.readUInt16("card");
if (tradeWindow)
{
if (type == 0)
{
tradeWindow->setMoney(amount);
}
else
{
tradeWindow->addItem2(type,
ItemType::Unknown,
cards,
4,
false,
amount,
refine,
ItemColor_one,
fromBool(identify, Identified),
Damaged_false,
Favorite_false,
Equipm_false);
}
}
}
示例2: processReadMail
void MailRecv::processReadMail(Net::MessageIn &msg)
{
const int sz = msg.readInt16("len") - 101;
MailMessage *const mail = new MailMessage;
mail->id = msg.readInt32("message id");
mail->title = msg.readString(40, "title");
mail->sender = msg.readString(24, "sender name");
msg.readInt32("unused");
mail->money = msg.readInt32("money");
mail->itemAmount = msg.readInt32("item amount");
mail->itemId = msg.readInt16("item id");
mail->itemType = msg.readInt16("item type");
mail->itemIdentify = msg.readUInt8("identify");
mail->itemAttribute = msg.readUInt8("attribute");
mail->itemRefine = msg.readUInt8("refine");
for (int f = 0; f < maxCards; f ++)
mail->card[f] = msg.readUInt16("card");
const int msgLen = msg.readUInt8("msg len");
if (msgLen != sz)
logger->log("error: wrong message size");
mail->text = msg.readString(sz, "message");
msg.readUInt8("zero");
mail->strTime = timeToStr(mail->time);
mailWindow->showMessage(mail);
}
示例3: processAuctionResults
void AuctionRecv::processAuctionResults(Net::MessageIn &msg)
{
UNIMPLEMENTEDPACKET;
msg.readInt16("len");
msg.readInt32("pages");
const int itemCount = msg.readInt32("items count");
for (int f = 0; f < itemCount; f ++)
{
msg.readInt32("auction id");
msg.readString(24, "seller name");
msg.readInt16("item id"); // here item always 16 bit
msg.readInt32("auction type");
msg.readInt16("item amount"); // always 1
msg.readUInt8("identify");
msg.readUInt8("attribute");
msg.readUInt8("refine");
for (int d = 0; d < maxCards; d ++)
msg.readUInt16("card"); // here item always 16 bit
msg.readInt32("price");
msg.readInt32("buy now");
msg.readString(24, "buyer name");
msg.readInt32("timestamp");
// +++ need use ItemColorManager for color
}
}