本文整理汇总了C++中net::MessageIn::readItemId方法的典型用法代码示例。如果您正苦于以下问题:C++ MessageIn::readItemId方法的具体用法?C++ MessageIn::readItemId怎么用?C++ MessageIn::readItemId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net::MessageIn
的用法示例。
在下文中一共展示了MessageIn::readItemId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processSkillProduceMixList
void SkillRecv::processSkillProduceMixList(Net::MessageIn &msg)
{
UNIMPLEMENTEDPACKET;
const int count = (msg.readInt16("len") - 4) / 4 * itemIdLen;
for (int f = 0; f < count; f ++)
{
msg.readItemId("item id");
for (int d = 0; d < 3; d ++)
msg.readItemId("material id");
}
}
示例2: processSkillProduceEffect
void SkillRecv::processSkillProduceEffect(Net::MessageIn &msg)
{
UNIMPLEMENTEDPACKET;
msg.readInt16("flag");
msg.readItemId("item id");
}
示例3: processSkillArrowCreateList
void SkillRecv::processSkillArrowCreateList(Net::MessageIn &msg)
{
UNIMPLEMENTEDPACKET;
const int count = (msg.readInt16("len") - 4) / itemIdLen;
for (int f = 0; f < count; f ++)
msg.readItemId("item id");
}
示例4: processSkillFailed
void SkillRecv::processSkillFailed(Net::MessageIn &msg)
{
// Action failed (ex. sit because you have not reached the
// right level)
const int skillId = msg.readInt16("skill id");
const int bskill = msg.readItemId("btype");
const int itemId = msg.readItemId("item id");
const signed char success = msg.readUInt8("success");
const signed char reason = msg.readUInt8("reason");
if (success != CAST_S32(SKILL_FAILED)
&& bskill == CAST_S32(BSKILL_EMOTE))
{
logger->log("Action: %d/%d", bskill, success);
}
if (localPlayer != nullptr)
localPlayer->stopCast(true);
std::string txt;
if (success == CAST_S32(SKILL_FAILED) && bskill != 0)
{
if ((localPlayer != nullptr) && bskill == CAST_S32(BSKILL_EMOTE)
&& reason == CAST_S32(RFAIL_SKILLDEP))
{
localPlayer->stopAdvert();
}
const SkillInfo *const info = skillDialog->getSkill(bskill);
if (info != nullptr)
{
txt = info->errorText;
}
else
{
// TRANSLATORS: skill error message
txt = strprintf(_("Unknown skill error: %d"), bskill);
}
}
else
{
const SkillInfo *const info = skillDialog->getSkill(skillId);
if (info != nullptr)
{
txt = info->errorText + ".";
}
else
{
// TRANSLATORS: skill error message
txt = strprintf(_("Unknown skill error: %d."), skillId);
}
}
txt.append(" ");
switch (reason)
{
case RFAIL_SKILLDEP:
// TRANSLATORS: error message
txt.append(_("You have not yet reached a high enough lvl!"));
break;
case RFAIL_INSUFHP:
// TRANSLATORS: error message
txt.append(_("Insufficient HP!"));
break;
case RFAIL_INSUFSP:
// TRANSLATORS: error message
txt.append(_("Insufficient SP!"));
break;
case RFAIL_NOMEMO:
// TRANSLATORS: error message
txt.append(_("You have no memos!"));
break;
case RFAIL_SKILLDELAY:
// TRANSLATORS: error message
txt.append(_("You cannot do that right now!"));
break;
case RFAIL_ZENY:
// TRANSLATORS: error message
txt.append(_("Seems you need more money... ;-)"));
break;
case RFAIL_WEAPON:
// TRANSLATORS: error message
txt.append(_("You cannot use this skill with that "
"kind of weapon!"));
break;
case RFAIL_REDGEM:
// TRANSLATORS: error message
txt.append(_("You need another red gem!"));
break;
case RFAIL_BLUEGEM:
// TRANSLATORS: error message
txt.append(_("You need another blue gem!"));
break;
case RFAIL_OVERWEIGHT:
// TRANSLATORS: error message
txt.append(_("You're carrying to much to do this!"));
break;
case RFAIL_SUMMON:
// TRANSLATORS: error message
txt.append(_("Fail summon."));
break;
case RFAIL_SPIRITS:
//.........这里部分代码省略.........