当前位置: 首页>>代码示例>>C++>>正文


C++ MessageIn::readBeingId方法代码示例

本文整理汇总了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);
        }
    }
}
开发者ID:dreamsxin,项目名称:ManaPlus,代码行数:31,代码来源:familyrecv.cpp

示例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);
    }
}
开发者ID:supermukmin,项目名称:ManaPlus,代码行数:27,代码来源:itemrecv.cpp

示例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);
    }
}
开发者ID:supermukmin,项目名称:ManaPlus,代码行数:28,代码来源:partyrecv.cpp

示例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);
    }
}
开发者ID:Action-Committee,项目名称:ManaPlus,代码行数:30,代码来源:itemrecv.cpp

示例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);
    }
}
开发者ID:dreamsxin,项目名称:ManaPlus,代码行数:34,代码来源:buyingstorerecv.cpp

示例6: processBattleEmblem

void BattleGroundRecv::processBattleEmblem(Net::MessageIn &msg)
{
    UNIMPLEMENTEDPACKET;
    msg.readBeingId("account id");
    msg.readString(24, "name");
    msg.readInt16("bg id");
}
开发者ID:dreamsxin,项目名称:ManaPlus,代码行数:7,代码来源:battlegroundrecv.cpp

示例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]);
    }
}
开发者ID:Action-Committee,项目名称:ManaPlus,代码行数:33,代码来源:itemrecv.cpp

示例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();
}
开发者ID:yahersfa,项目名称:ManaPlus,代码行数:32,代码来源:vendinghandler.cpp

示例9: processNpcBuySellChoice

void BuySellRecv::processNpcBuySellChoice(Net::MessageIn &msg)
{
    if (!BuySellDialog::isActive())
    {
        mNpcId = msg.readBeingId("npc id");
        CREATEWIDGET(BuySellDialog, mNpcId);
    }
}
开发者ID:Action-Committee,项目名称:ManaPlus,代码行数:8,代码来源:buysellrecv.cpp

示例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);
}
开发者ID:dreamsxin,项目名称:ManaPlus,代码行数:8,代码来源:buyingstorerecv.cpp

示例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);
}
开发者ID:yahersfa,项目名称:ManaPlus,代码行数:8,代码来源:vendinghandler.cpp

示例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");
}
开发者ID:dreamsxin,项目名称:ManaPlus,代码行数:9,代码来源:battlegroundrecv.cpp

示例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");
}
开发者ID:qpulsar,项目名称:ManaPlus,代码行数:9,代码来源:playerhandler.cpp

示例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");
}
开发者ID:mekolat,项目名称:ManaPlus,代码行数:9,代码来源:skillrecv.cpp

示例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");
}
开发者ID:dreamsxin,项目名称:ManaPlus,代码行数:9,代码来源:skillrecv.cpp


注:本文中的net::MessageIn::readBeingId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。