本文整理汇总了C++中net::MessageIn::readBeingId方法的典型用法代码示例。如果您正苦于以下问题:C++ MessageIn::readBeingId方法的具体用法?C++ MessageIn::readBeingId怎么用?C++ MessageIn::readBeingId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net::MessageIn
的用法示例。
在下文中一共展示了MessageIn::readBeingId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processAskForChild
void FamilyRecv::processAskForChild(Net::MessageIn &msg)
{
if (!localPlayer)
{
mParent1 = msg.readBeingId("account id who ask");
mParent2 = msg.readBeingId("acoount id for other parent");
msg.readString(24, "name who ask");
return;
}
mParent1 = msg.readBeingId("account id who ask");
mParent2 = msg.readBeingId("acoount id for other parent");
const std::string name1 = msg.readString(24, "name who ask");
const Party *const party = localPlayer->getParty();
if (party)
{
const PartyMember *const member = party->getMember(mParent2);
if (member)
{
const std::string name2 = member->getName();
CREATEWIDGETV(confirmDlg, ConfirmDialog,
// TRANSLATORS: adopt child message
_("Request parents"),
// TRANSLATORS: adopt child message
strprintf(_("Do you accept %s and %s as parents?"),
name1.c_str(), name2.c_str()),
SOUND_REQUEST,
false);
confirmDlg->addActionListener(&listener);
}
}
}
示例2: processItemVisible
void ItemRecv::processItemVisible(Net::MessageIn &msg)
{
const BeingId id = msg.readBeingId("item object id");
const int itemId = msg.readInt16("item id");
const Identified identified = fromInt(
msg.readUInt8("identify"), Identified);
const int x = msg.readInt16("x");
const int y = msg.readInt16("y");
const int amount = msg.readInt16("amount");
const int subX = static_cast<int>(msg.readInt8("sub x"));
const int subY = static_cast<int>(msg.readInt8("sub y"));
if (actorManager)
{
actorManager->createItem(id,
itemId,
x, y,
0,
amount,
0,
ItemColor_one,
identified,
Damaged_false,
subX, subY,
nullptr);
}
}
示例3: processPartyMemberInfo
void PartyRecv::processPartyMemberInfo(Net::MessageIn &msg)
{
const BeingId id = msg.readBeingId("account id");
const bool leader = msg.readInt32("leader") == 0U;
const int x = msg.readInt16("x");
const int y = msg.readInt16("y");
const bool online = msg.readInt8("online") == 0U;
msg.readString(24, "party name");
const std::string nick = msg.readString(24, "player name");
const std::string map = msg.readString(16, "map name");
msg.readInt8("party.item&1");
msg.readInt8("party.item&2");
if (!Ea::taParty)
return;
PartyMember *const member = Ea::taParty->addMember(id, nick);
if (member)
{
if (partyTab && member->getOnline() != online)
partyTab->showOnline(nick, fromBool(online, Online));
member->setLeader(leader);
member->setOnline(online);
member->setMap(map);
member->setX(x);
member->setY(y);
}
}
示例4: processItemDropped
void ItemRecv::processItemDropped(Net::MessageIn &msg)
{
const BeingId id = msg.readBeingId("id");
const int itemId = msg.readInt16("item id");
ItemTypeT itemType = ItemType::Unknown;
if (msg.getVersion() >= 20130000)
itemType = static_cast<ItemTypeT>(msg.readInt16("type"));
const Identified identified = fromInt(
msg.readUInt8("identify"), Identified);
const int x = msg.readInt16("x");
const int y = msg.readInt16("y");
const int subX = CAST_S32(msg.readInt8("subx"));
const int subY = CAST_S32(msg.readInt8("suby"));
const int amount = msg.readInt16("count");
if (actorManager)
{
actorManager->createItem(id,
itemId,
x, y,
itemType,
amount,
0,
ItemColor_one,
identified,
Damaged_false,
subX, subY,
nullptr);
}
}
示例5: processBuyingStoreItemsList
void BuyingStoreRecv::processBuyingStoreItemsList(Net::MessageIn &msg)
{
const int count = (msg.readInt16("len") - 16) / 9;
const BeingId id = msg.readBeingId("account id");
const int storeId = msg.readInt32("store id");
// +++ in future need use it too
msg.readInt32("money limit");
const Being *const dstBeing = actorManager->findBeing(id);
if (!dstBeing)
return;
SellDialog *const dialog = CREATEWIDGETR(BuyingStoreSellDialog,
dstBeing->getId(),
storeId);
dialog->setMoney(PlayerInfo::getAttribute(Attributes::MONEY));
const Inventory *const inv = PlayerInfo::getInventory();
for (int f = 0; f < count; f ++)
{
const int price = msg.readInt32("price");
const int amount = msg.readInt16("amount");
const ItemTypeT itemType = static_cast<ItemTypeT>(
msg.readUInt8("item type"));
const int itemId = msg.readInt16("item id");
if (!inv)
continue;
const Item *const item = inv->findItem(itemId, ItemColor_one);
if (!item)
continue;
// +++ need add colors support
dialog->addItem(itemId, itemType, ItemColor_one, amount, price);
}
}
示例6: processBattleEmblem
void BattleGroundRecv::processBattleEmblem(Net::MessageIn &msg)
{
UNIMPLEMENTEDPACKET;
msg.readBeingId("account id");
msg.readString(24, "name");
msg.readInt16("bg id");
}
示例7: fromInt
void ItemRecv::processItemDropped2(Net::MessageIn &msg)
{
const BeingId id = msg.readBeingId("id");
const int itemId = msg.readInt16("item id");
const ItemTypeT itemType = static_cast<ItemTypeT>(msg.readUInt8("type"));
const Identified identified = fromInt(
msg.readUInt8("identify"), Identified);
const Damaged damaged = fromBool(msg.readUInt8("attribute"), Damaged);
const uint8_t refine = msg.readUInt8("refine");
int cards[maxCards];
for (int f = 0; f < maxCards; f++)
cards[f] = msg.readInt16("card");
const int x = msg.readInt16("x");
const int y = msg.readInt16("y");
const int amount = msg.readInt16("amount");
const int subX = CAST_S32(msg.readInt8("subx"));
const int subY = CAST_S32(msg.readInt8("suby"));
if (actorManager)
{
actorManager->createItem(id,
itemId,
x, y,
itemType,
amount,
refine,
ItemColorManager::getColorFromCards(&cards[0]),
identified,
damaged,
subX, subY,
&cards[0]);
}
}
示例8: processItemsList
void VendingHandler::processItemsList(Net::MessageIn &msg)
{
const int count = (msg.readInt16("len") - 12) / 22;
const BeingId id = msg.readBeingId("id");
Being *const being = actorManager->findBeing(id);
if (!being)
return;
int cards[4];
CREATEWIDGETV(mBuyDialog, BuyDialog, being->getName());
mBuyDialog->setMoney(PlayerInfo::getAttribute(Attributes::MONEY));
msg.readInt32("vender id");
for (int f = 0; f < count; f ++)
{
const int value = msg.readInt32("price");
const int amount = msg.readInt16("amount");
const int index = msg.readInt16("inv index");
const int type = msg.readUInt8("item type");
const int itemId = msg.readInt16("item id");
msg.readUInt8("identify");
msg.readUInt8("attribute");
msg.readUInt8("refine");
for (int d = 0; d < 4; d ++)
cards[d] = msg.readInt16("card");
const ItemColor color = ItemColorManager::getColorFromCards(&cards[0]);
ShopItem *const item = mBuyDialog->addItem(itemId, type,
color, amount, value);
if (item)
item->setInvIndex(index);
}
mBuyDialog->sort();
}
示例9: processNpcBuySellChoice
void BuySellRecv::processNpcBuySellChoice(Net::MessageIn &msg)
{
if (!BuySellDialog::isActive())
{
mNpcId = msg.readBeingId("npc id");
CREATEWIDGET(BuySellDialog, mNpcId);
}
}
示例10: processBuyingStoreShowBoard
void BuyingStoreRecv::processBuyingStoreShowBoard(Net::MessageIn &msg)
{
const BeingId id = msg.readBeingId("owner id");
const std::string shopName = msg.readString(80, "shop name");
Being *const dstBeing = actorManager->findBeing(id);
if (dstBeing)
dstBeing->setBuyBoard(shopName);
}
示例11: processShowBoard
void VendingHandler::processShowBoard(Net::MessageIn &msg)
{
const BeingId id = msg.readBeingId("owner id");
const std::string shopName = msg.readString(80, "shop name");
Being *const dstBeing = actorManager->findBeing(id);
if (dstBeing)
dstBeing->setSellBoard(shopName);
}
示例12: processBattleUpdateCoords
void BattleGroundRecv::processBattleUpdateCoords(Net::MessageIn &msg)
{
UNIMPLEMENTEDPACKET;
msg.readBeingId("account id");
msg.readString(24, "name");
msg.readInt16("class");
msg.readInt16("x");
msg.readInt16("y");
}
示例13: processPvpInfo
void PlayerHandler::processPvpInfo(Net::MessageIn &msg)
{
UNIMPLIMENTEDPACKET;
msg.readInt32("char id");
msg.readBeingId("account id");
msg.readInt32("pvp won");
msg.readInt32("pvp lost");
msg.readInt32("pvp point");
}
示例14: processSkillScale
void SkillRecv::processSkillScale(Net::MessageIn &msg)
{
msg.readBeingId("being id");
msg.readInt16("skill id");
msg.readInt16("skill level");
msg.readInt16("x");
msg.readInt16("y");
msg.readInt32("cast time");
}
示例15: processSkillDevotionEffect
void SkillRecv::processSkillDevotionEffect(Net::MessageIn &msg)
{
UNIMPLEMENTEDPACKET;
msg.readBeingId("being id");
for (int f = 0; f < 5; f ++)
msg.readInt32("devotee id");
msg.readInt16("range");
}