void WorldSession::HandleNameCacheOpcode(WorldPacket& recv_data)
{
    uint64 guid;

    recv_data >> guid;

    Player *pChar = sObjectMgr->GetPlayer(guid);

    if (pChar)
        SendNameCacheOpcode(pChar);
    else
    {
        if (CharacterNameData* cname = sWorld->GetCharacterNameData(guid))
        {
            WorldPacket data(SMSG_NAME_CACHE, 8+1+1+1+1+1+1+10);
            data.appendPackGUID(guid);
            data << uint8(0);
            if (cname->m_name == "")
            {
                data << std::string(GetStrawberryString(LANG_NON_EXIST_CHARACTER));
                data << uint32(0);
            }
            else
            {
                data << cname->m_name;
                data << uint8(0);
                data << uint8(cname->m_race);
                data << uint8(cname->m_gender);
                data << uint8(cname->m_class);
            }
            data << uint8(0);
            SendPacket(&data);
        }
    }
}
Beispiel #2
0
void WorldSession::HandleNameCacheOpcode( WorldPacket & recv_data )
{
    ObjectGuid guid;

    recv_data >> guid;

    Player *pChar = sObjectMgr.GetPlayer(guid);

    if (pChar)
        SendNameCacheOpcode(pChar);
    else
        SendNameCacheOpcodeFromDB(guid);
}