Пример #1
0
//////////////////////////////////////////////////////////////
/// This function handles CMSG_NAME_QUERY:
//////////////////////////////////////////////////////////////
void WorldSession::HandleNameQueryOpcode( WorldPacket & recv_data )
{
	CHECK_PACKET_SIZE(recv_data, 8);
	uint64 guid;
	recv_data >> guid;

	PlayerInfo *pn = objmgr.GetPlayerInfo( (uint32)guid );
	WoWGuid pguid(guid);

	if(!pn)
		return;

	DEBUG_LOG("WorldSession","Received CMSG_NAME_QUERY for: %s", pn->name );

	uint8 databuffer[5000];
	StackPacket data(SMSG_NAME_QUERY_RESPONSE, databuffer, 5000);
	data << pguid;
	data << uint8(0);
	data << pn->name;
	data << uint8(0);	   // this probably is "different realm" or something flag.
	data << uint8(pn->race);
	data << uint8(pn->gender);
	data << uint8(pn->cl);
	data << uint8(0);
	SendPacket( &data );
}
Пример #2
0
//////////////////////////////////////////////////////////////
/// This function handles CMSG_NAME_QUERY:
//////////////////////////////////////////////////////////////
void WorldSession::HandleNameQueryOpcode( WorldPacket & recv_data )
{
	CHECK_PACKET_SIZE(recv_data, 8);
	uint64 guid;
	recv_data >> guid;

	if(guid & 0x10000000)
	{
		int32 real_guid = int32(guid) & ~0x10000000;
		QueryResult *result = CharacterDatabase.Query(
			"SELECT * FROM fake_players WHERE online=1 and entry=%d", real_guid);
		if(!result) 
			return;
 
		const char *name = result->Fetch()[1].GetString();
		//printf("  found %s\n", name);
 
		WorldPacket data(SMSG_NAME_QUERY_RESPONSE, strlen(name) + 35);
		data << int32(guid) << uint32(0);	//highguid
		data << name;
		data << uint8(0);	   // this is a string showed besides players name (eg. in combat log), a custom title ?
		data << result->Fetch()[5].GetInt32() << int32(0) << result->Fetch()[4].GetInt32();
//		data << uint8(0);			// 2.4.0, why do i get the feeling blizz is adding custom classes or custom titles? (same thing in who list)
		SendPacket( &data );

		delete result;
	}
	else
	{
		PlayerInfo *pn = objmgr.GetPlayerInfo( (uint32)guid );
		if(!pn)
			return;
		sLog.outDebug( "Received CMSG_NAME_QUERY for: %s", pn->name );
		WoWGuid pguid((uint64)pn->guid);
		WorldPacket data(SMSG_NAME_QUERY_RESPONSE, strlen(pn->name) + 35);
		data << pguid << uint8(0); //VLack: usual, new-style guid with an uint8
		data << pn->name;
		data << uint8(0);	   // this is a string showed besides players name (eg. in combat log), a custom title ?
		data << uint8(pn->race) << uint8(pn->gender) << uint8(pn->cl);
		data << uint8(0); //VLack: tell the server this name is not declined... (3.1 fix?)
		SendPacket( &data );
	}
}
Пример #3
0
//////////////////////////////////////////////////////////////
/// This function handles CMSG_NAME_QUERY:
//////////////////////////////////////////////////////////////
void WorldSession::HandleNameQueryOpcode(WorldPacket & recv_data)
{
	CHECK_PACKET_SIZE(recv_data, 8);
	uint64 guid;
	recv_data >> guid;

	PlayerInfo* pn = objmgr.GetPlayerInfo((uint32)guid);

	if(!pn)
		return;

	LOG_DEBUG("Received CMSG_NAME_QUERY for: %s", pn->name);

	WoWGuid pguid((uint64)pn->guid); //VLack: The usual new style guid handling on 3.1.2
	WorldPacket data(SMSG_NAME_QUERY_RESPONSE, strlen(pn->name) + 35);
	data << pguid << uint8(0); //VLack: usual, new-style guid with an uint8
	data << pn->name;
	data << uint8(0);	   // this is a string showed besides players name (eg. in combat log), a custom title ?
	data << uint8(pn->race) << uint8(pn->gender) << uint8(pn->cl);
	data << uint8(0); //VLack: tell the server this name is not declined... (3.1 fix?)
	SendPacket(&data);
}