Пример #1
0
void ClusterInterface::HandlePackedPlayerInfo(WorldPacket & pck)
{
	uint32 real_size;
	pck >> real_size;
	uLongf rsize = real_size;

	ByteBuffer buf(real_size);
	buf.resize(real_size);

	if(uncompress((uint8*)buf.contents(), &rsize, pck.contents() + 4, (u_long)pck.size() - 4) != Z_OK)
	{
		printf("Uncompress of player info failed.\n");
		return;
	}

	RPlayerInfo * pi;
	uint32 count;
	buf >> count;
	for(uint32 i = 0; i < count; ++i)
	{
		pi = new RPlayerInfo;
		pi->Unpack(buf);
		_onlinePlayers[pi->Guid] = pi;
	}
}
Пример #2
0
void ClusterInterface::HandlePlayerInfo(WorldPacket & pck)
{
	uint32 guid;
	pck >> guid;
	RPlayerInfo * pRPlayer = GetPlayer(guid);
	if(!pRPlayer)
		pRPlayer = new RPlayerInfo;

	pRPlayer->Unpack(pck);

	_onlinePlayers[pRPlayer->Guid] = pRPlayer;
}
Пример #3
0
void ClusterInterface::HandlePackedPlayerInfo(WorldPacket & pck)
{
	RPlayerInfo * pi;
	// todo: uncompress
	uint32 count;
	pck >> count;
	for(uint32 i = 0; i < count; ++i)
	{
		pi = new RPlayerInfo;
		pi->Unpack(pck);
		_onlinePlayers[pi->Guid] = pi;
	}
}