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


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

本文整理汇总了C++中InPacket::readint方法的典型用法代码示例。如果您正苦于以下问题:C++ InPacket::readint方法的具体用法?C++ InPacket::readint怎么用?C++ InPacket::readint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在InPacket的用法示例。


在下文中一共展示了InPacket::readint方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: handle

	void SpawnMobHandler::handle(InPacket& recv) const
	{
		int32_t oid = recv.readint();
		bool hascontrol = recv.readbyte() == 5;
		int32_t id = recv.readint();

		recv.skip(22);

		Point<int16_t> position = recv.readpoint();
		int8_t stance = recv.readbyte();

		recv.skip(2);

		uint16_t fh = recv.readshort();
		int8_t effect = recv.readbyte();

		if (effect > 0)
		{
			recv.readbyte();
			recv.readshort();
			if (effect == 15)
			{
				recv.readbyte();
			}
		}

		int8_t team = recv.readbyte();

		recv.skip(4);

		Stage::get().getmobs().addmob(oid, id, hascontrol, stance, fh, effect == -2, team, position);
	}
开发者ID:thisIsTooHard,项目名称:JourneyClient,代码行数:32,代码来源:MapObjectHandlers.cpp

示例2: handle

	void UpdateskillsHandler::handle(InPacket& recv) const
	{
		recv.skip(3);

		int32_t skillid = recv.readint();
		int32_t level = recv.readint();
		int32_t masterlevel = recv.readint();
		int64_t expire = recv.readlong();

		Stage::get().getplayer().getskills().setskill(skillid, level, masterlevel, expire);
	}
开发者ID:eaxvac,项目名称:JourneyClient,代码行数:11,代码来源:PlayerHandlers.cpp

示例3: handlebuff

	void ApplyBuffHandler::handlebuff(InPacket& recv, Buffstat::Value bs) const
	{
		int16_t value = recv.readshort();
		int32_t skillid = recv.readint();
		int32_t duration = recv.readint();

		Buff buff = Buff(bs, value, skillid, duration);
		Stage::get().getplayer().givebuff(buff);

		UI::get().withelement(UIElement::BUFFLIST, &UIBuffList::addbuff, skillid, duration);
	}
开发者ID:eaxvac,项目名称:JourneyClient,代码行数:11,代码来源:PlayerHandlers.cpp

示例4:

	MapInfo::MapInfo(InPacket& recv)
	{
		mapwalls.setfirst(recv.readshort());
		mapwalls.setsecond(recv.readshort());
		mapborders.setfirst(recv.readshort());
		mapborders.setsecond(recv.readshort());
		bgm = recv.read<string>();
		cloud = recv.readbool();
		fieldlimit = recv.readint();
		hideminimap = recv.readbool();
		mapmark = recv.read<string>();
		swim = recv.readbool();
		town = recv.readbool();

		uint16_t numseats = recv.readshort();
		for (uint16_t i = 0; i < numseats; i++)
		{
			seats.push_back(recv);
		}

		uint16_t numladders = recv.readshort();
		for (uint16_t i = 0; i < numladders; i++)
		{
			ladders.push_back(recv);
		}
	}
开发者ID:aadarshasubedi,项目名称:JourneyClient,代码行数:26,代码来源:Mapinfo.cpp

示例5: handle

	void ServerIPHandler::handle(InPacket& recv) const
	{
		recv.skip(2);

		// Read the ipv4 adress in a string.
		string addrstr;
		for (int i = 0; i < 4; i++)
		{
			uint8_t num = static_cast<uint8_t>(recv.readbyte());
			addrstr.append(std::to_string(num));
			if (i < 3)
			{
				addrstr.push_back('.');
			}
		}

		// Read the port adress in a string.
		string portstr = std::to_string(recv.readshort());

		int32_t cid = recv.readint();

		// Attempt to reconnect to the server and if successfull, login to the game.
		Session::get().reconnect(addrstr.c_str(), portstr.c_str());
		PlayerLoginPacket(cid).dispatch();
	}
开发者ID:am910021,项目名称:JourneyClient,代码行数:25,代码来源:LoginHandlers.cpp

示例6:

	Account::Account(InPacket& recv)
	{
		recv.readshort();
		accid = recv.readint();
		female = recv.readbool();
		recv.readbool(); //is admin
		gmlevel = recv.readbyte();
		recv.readbyte();
		name = recv.readascii();
		recv.readbyte();
		muted = recv.readbool();
		recv.readlong(); //muted until
		recv.readlong(); //creation date
		recv.readint();
		pin = recv.readshort();
		selected = 0;
	}
开发者ID:pandaforks,项目名称:JourneyClient,代码行数:17,代码来源:Account.cpp

示例7: parseaccount

	void Login::parseaccount(InPacket& recv)
	{
		recv.readshort();
		account.accid = recv.readint();
		account.female = recv.readbool();
		recv.readbool(); //is admin
		account.gmlevel = recv.readbyte();
		recv.readbyte();
		account.name = recv.readascii();
		recv.readbyte();
		account.muted = recv.readbool();
		recv.readlong(); //muted until
		recv.readlong(); //creation date
		recv.readint();
		account.pin = recv.readshort();
		account.selected = 0;
	}
开发者ID:eaxvac,项目名称:JourneyClient,代码行数:17,代码来源:Login.cpp

示例8: handle

	void AttackHandler::handle(InPacket& recv) const
	{
		int32_t cid = recv.readint();
		uint8_t count = recv.readbyte();

		recv.skip(1);

		using Gameplay::AttackResult;
		AttackResult attack;
		attack.type = type;

		attack.level = recv.readbyte();
		attack.skill = (attack.level > 0) ? recv.readint() : 0;

		attack.display = recv.readbyte();
		attack.toleft = recv.readbool();
		attack.stance = recv.readbyte();
		attack.speed = recv.readbyte();

		recv.skip(1);

		attack.bullet = recv.readint();

		attack.mobcount = (count >> 4) & 0xF;
		attack.hitcount = count & 0xF;
		for (uint8_t i = 0; i < attack.mobcount; i++)
		{
			int32_t oid = recv.readint();

			recv.skip(1);

			using Gameplay::Skill;
			uint8_t length = (attack.skill == Skill::MESO_EXPLOSION) ? recv.readbyte() : attack.hitcount;
			for (uint8_t j = 0; j < length; j++)
			{
				int32_t damage = recv.readint();
				bool critical = false; // todo
				auto singledamage = std::make_pair(damage, critical);
				attack.damagelines[oid].push_back(singledamage);
			}
		}

		using Gameplay::Stage;
		Stage::get().showattack(cid, attack);
	}
开发者ID:am910021,项目名称:JourneyClient,代码行数:45,代码来源:AttackHandlers.cpp

示例9: parsecharlist

	void Login::parsecharlist(InPacket& recv)
	{
		size_t numchars = recv.readbyte();
		for (size_t i = 0; i < numchars; i++)
		{
			addcharentry(recv);
		}

		account.pic = recv.readbyte();
		account.slots = static_cast<int8_t>(recv.readint());
	}
开发者ID:eaxvac,项目名称:JourneyClient,代码行数:11,代码来源:Login.cpp

示例10: parselook

	LookEntry Login::parselook(InPacket& recv) const
	{
		LookEntry look;

		look.female = recv.readbool();
		look.skin = recv.readbyte();
		look.faceid = recv.readint();
		recv.readbool(); //megaphone
		look.hairid = recv.readint();
		uint8_t slot = recv.readbyte();
		while (slot != 0xFF)
		{
			look.equips[slot] = recv.readint();
			slot = recv.readbyte();
		}
		slot = recv.readbyte();
		while (slot != 0xFF)
		{
			look.maskedequips[slot] = recv.readint();
			slot = recv.readbyte();
		}
		look.maskedequips[-111] = recv.readint();
		for (uint8_t i = 0; i < 3; i++)
		{
			look.petids.push_back(recv.readint());
		}

		return look;
	}
开发者ID:eaxvac,项目名称:JourneyClient,代码行数:29,代码来源:Login.cpp

示例11: parsestats

	StatsEntry Login::parsestats(InPacket& recv) const
	{
		StatsEntry statsentry;

		statsentry.name = recv.readpadascii(13);

		recv.readbool(); //gender
		recv.readbyte(); //skin
		recv.readint(); //face
		recv.readint(); //hair

		for (size_t i = 0; i < 3; i++)
		{
			statsentry.petids.push_back(recv.readlong());
		}

		statsentry.stats[Maplestat::LEVEL] = recv.readbyte();
		statsentry.stats[Maplestat::JOB] = recv.readshort();
		statsentry.stats[Maplestat::STR] = recv.readshort();
		statsentry.stats[Maplestat::DEX] = recv.readshort();
		statsentry.stats[Maplestat::INT] = recv.readshort();
		statsentry.stats[Maplestat::LUK] = recv.readshort();
		statsentry.stats[Maplestat::HP] = recv.readshort();
		statsentry.stats[Maplestat::MAXHP] = recv.readshort();
		statsentry.stats[Maplestat::MP] = recv.readshort();
		statsentry.stats[Maplestat::MAXMP] = recv.readshort();
		statsentry.stats[Maplestat::AP] = recv.readshort();
		statsentry.stats[Maplestat::SP] = recv.readshort();
		statsentry.exp = recv.readint();
		statsentry.stats[Maplestat::FAME] = recv.readshort();

		recv.skip(4); //gachaexp
		statsentry.mapid = recv.readint();
		statsentry.portal = recv.readbyte();
		recv.skip(4); //timestamp

		statsentry.job = CharJob(statsentry.stats[Maplestat::JOB]);

		return statsentry;
	}
开发者ID:eaxvac,项目名称:JourneyClient,代码行数:40,代码来源:Login.cpp

示例12: parsecharentry

	CharEntry Login::parsecharentry(InPacket& recv) const
	{
		CharEntry toparse;
		toparse.cid = recv.readint();
		toparse.stats = parsestats(recv);
		toparse.look = parselook(recv);

		recv.readbool(); // 'rankinfo' bool
		if (recv.readbool())
		{
			int32_t currank = recv.readint();
			int32_t rankmv = recv.readint();
			int32_t curjobrank = recv.readint();
			int32_t jobrankmv = recv.readint();
			int8_t rankmc = (rankmv > 0) ? '+' : (rankmv < 0) ? '-' : '=';
			int8_t jobrankmc = (jobrankmv > 0) ? '+' : (jobrankmv < 0) ? '-' : '=';

			toparse.stats.rank = std::make_pair(currank, rankmc);
			toparse.stats.jobrank = std::make_pair(curjobrank, jobrankmc);
		}

		return toparse;
	}
开发者ID:eaxvac,项目名称:JourneyClient,代码行数:23,代码来源:Login.cpp

示例13:

	World::World(uint8_t id, InPacket& recv)
	{
		wid = id;
		name = recv.readascii();
		flag = recv.readbyte();
		message = recv.readascii();
		recv.readbyte();
		recv.readbyte();
		recv.readbyte();
		recv.readbyte();
		recv.readbyte();
		channelcount = recv.readbyte();
		for (uint8_t i = 0; i < channelcount; i++)
		{
			recv.readascii();
			recv.readint();
			chloads.push_back(recv.readbyte());
			recv.readshort();
		}
	}
开发者ID:pandaforks,项目名称:JourneyClient,代码行数:20,代码来源:World.cpp


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