本文整理汇总了C++中InPacket::read_long方法的典型用法代码示例。如果您正苦于以下问题:C++ InPacket::read_long方法的具体用法?C++ InPacket::read_long怎么用?C++ InPacket::read_long使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InPacket
的用法示例。
在下文中一共展示了InPacket::read_long方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handle
void BuffHandler::handle(InPacket& recv) const
{
int64_t firstmask = recv.read_long();
int64_t secondmask = recv.read_long();
switch (secondmask)
{
case Buff::BATTLESHIP:
handlebuff(recv, Buff::BATTLESHIP);
return;
}
for (Buff::Stat stat : Buff::FIRST_BUFFS)
{
if (firstmask & stat)
{
handlebuff(recv, stat);
}
}
for (Buff::Stat stat : Buff::SECOND_BUFFS)
{
if (secondmask & stat)
{
handlebuff(recv, stat);
}
}
Stage::get().getplayer().recalcstats(false);
}
示例2: parse_questlog
void SetfieldHandler::parse_questlog(InPacket& recv, Questlog& quests) const
{
int16_t size = recv.read_short();
for (int16_t i = 0; i < size; i++)
{
int16_t qid = recv.read_short();
std::string qdata = recv.read_string();
if (quests.is_started(qid))
{
int16_t qidl = quests.get_last_started();
quests.add_in_progress(qidl, qid, qdata);
i--;
}
else
{
quests.add_started(qid, qdata);
}
}
std::map<int16_t, int64_t> completed;
size = recv.read_short();
for (int16_t i = 0; i < size; i++)
{
int16_t qid = recv.read_short();
int64_t time = recv.read_long();
quests.add_completed(qid, time);
}
}
示例3: parse_account
Account LoginParser::parse_account(InPacket & recv)
{
Account account;
recv.skip(2);
account.accid = recv.read_int();
account.female = recv.read_bool();
recv.read_bool(); //is admin
account.gmlevel = recv.read_byte();
recv.skip(1);
account.name = recv.read_string();
recv.skip(1);
account.muted = recv.read_bool();
recv.read_long(); //muted until
recv.read_long(); //creation date
recv.skip(4);
account.pin = recv.read_short();
return account;
}
示例4: parse_skillbook
void SetfieldHandler::parse_skillbook(InPacket& recv, Skillbook& skills) const
{
int16_t size = recv.read_short();
for (int16_t i = 0; i < size; i++)
{
int32_t skillid = recv.read_int();
int32_t level = recv.read_int();
int64_t expiration = recv.read_long();
bool fourthtjob = ((skillid % 100000) / 10000 == 2);
int32_t masterlevel = fourthtjob ? recv.read_int() : -1;
skills.set_skill(skillid, level, masterlevel, expiration);
}
size = recv.read_short();
for (int16_t i = 0; i < size; i++)
{
int32_t skillid = recv.read_int();
int32_t cooldown = recv.read_short();
skills.set_cd(skillid, cooldown);
}
}
示例5: parse_stats
StatsEntry LoginParser::parse_stats(InPacket& recv)
{
StatsEntry statsentry;
statsentry.name = recv.read_padded_string(13);
recv.read_bool(); //gender
recv.read_byte(); //skin
recv.read_int(); //face
recv.read_int(); //hair
for (size_t i = 0; i < 3; i++)
{
statsentry.petids.push_back(recv.read_long());
}
statsentry.stats[Maplestat::LEVEL] = recv.read_byte();
statsentry.stats[Maplestat::JOB] = recv.read_short();
statsentry.stats[Maplestat::STR] = recv.read_short();
statsentry.stats[Maplestat::DEX] = recv.read_short();
statsentry.stats[Maplestat::INT] = recv.read_short();
statsentry.stats[Maplestat::LUK] = recv.read_short();
statsentry.stats[Maplestat::HP] = recv.read_short();
statsentry.stats[Maplestat::MAXHP] = recv.read_short();
statsentry.stats[Maplestat::MP] = recv.read_short();
statsentry.stats[Maplestat::MAXMP] = recv.read_short();
statsentry.stats[Maplestat::AP] = recv.read_short();
statsentry.stats[Maplestat::SP] = recv.read_short();
statsentry.exp = recv.read_int();
statsentry.stats[Maplestat::FAME] = recv.read_short();
recv.skip(4); //gachaexp
statsentry.mapid = recv.read_int();
statsentry.portal = recv.read_byte();
recv.skip(4); //timestamp
return statsentry;
}