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


C++ InPacket::read_long方法代码示例

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

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

示例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;
	}
开发者ID:Ordywee,项目名称:JourneyClient,代码行数:20,代码来源:LoginParser.cpp

示例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);
		}
	}
开发者ID:snopboy,项目名称:JourneyClient,代码行数:21,代码来源:SetfieldHandlers.cpp

示例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;
	}
开发者ID:Ordywee,项目名称:JourneyClient,代码行数:38,代码来源:LoginParser.cpp


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