• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ IS_PLAYER_GUID函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中IS_PLAYER_GUID函数的典型用法代码示例。如果您正苦于以下问题:C++ IS_PLAYER_GUID函数的具体用法?C++ IS_PLAYER_GUID怎么用?C++ IS_PLAYER_GUID使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: switch

void CreatureTextMgr::BuildMonsterChat(WorldPacket *data, WorldObject* source, ChatType msgtype, char const* text, Language language, uint64 whisperGuid) const
{
    if (!source)
        return;

    ChatMsg sendType = CHAT_MSG_MONSTER_SAY;
    switch (msgtype)
    {
        case CHAT_TYPE_YELL:
            sendType = CHAT_MSG_MONSTER_YELL;
            break;
        case CHAT_TYPE_TEXT_EMOTE:
            sendType = CHAT_MSG_MONSTER_EMOTE;
            break;
        case CHAT_TYPE_BOSS_EMOTE:
            sendType = CHAT_MSG_RAID_BOSS_EMOTE;
            break;
        case CHAT_TYPE_WHISPER:
            if (whisperGuid)
                sendType = CHAT_MSG_MONSTER_WHISPER;
            else
            {
                sLog->outError("CreatureTextMgr: WorldObject(%s) TypeId %u GuidLow %u sent CHAT_TYPE_WHISPER with targetGuid 0. Ignoring.", source->GetName(), uint32(source->GetTypeId()), source->GetGUIDLow());
                return;
            }
            break;
        case CHAT_TYPE_BOSS_WHISPER:
            if (whisperGuid)
                sendType = CHAT_MSG_RAID_BOSS_WHISPER;
            else
            {
                sLog->outError("CreatureTextMgr: WorldObject(%s) TypeId %u GuidLow %u sent CHAT_TYPE_BOSS_WHISPER with targetGuid 0. Ignoring.", source->GetName(), uint32(source->GetTypeId()), source->GetGUIDLow());
                return;
            }
            break;
        case CHAT_TYPE_SAY://default type
        default:
            break;
    }
    *data << (uint8)sendType;
    *data << (uint32)language;
    *data << (uint64)source->GetGUID();
    *data << (uint32)0;                                     // 2.1.0
    *data << (uint32)(strlen(source->GetName())+1);
    *data << source->GetName();
    *data << (uint64)whisperGuid;                           // Unit Target
    if (whisperGuid && !IS_PLAYER_GUID(whisperGuid))        //can only whisper players
    {
        sLog->outError("CreatureTextMgr: WorldObject(%s) TypeId %u GuidLow %u sent WHISPER msg to Non-Player target. Ignoring.", source->GetName(), uint32(source->GetTypeId()), source->GetGUIDLow());
        return;
        // *data << (uint32)1;                                 // target name length
        // *data << (uint8)0;                                  // target name
    }
    *data << (uint32)(strlen(text)+1);
    *data << text;
    *data << (uint8)0;                                      // ChatTag
}
开发者ID:AwkwardDev,项目名称:CataOld,代码行数:57,代码来源:CreatureTextMgr.cpp


示例2: HandlePetSpellAutocastOpcode

void WorldSession::HandlePetSpellAutocastOpcode(WorldPacket& recvPacket)
{
    ;//sLog->outDetail("CMSG_PET_SPELL_AUTOCAST");
    uint64 guid;
    uint32 spellid;
    uint8  state;                                           //1 for on, 0 for off
    recvPacket >> guid >> spellid >> state;

    if (!_player->GetGuardianPet() && !_player->GetCharm())
        return;

    if (IS_PLAYER_GUID(guid))
        return;

	SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellid);
	if (!spellInfo)
		return;

    Creature* checkPet = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, guid);
    if (!checkPet || (checkPet != _player->GetGuardianPet() && checkPet != _player->GetCharm()))
    {
        sLog->outError("HandlePetSpellAutocastOpcode.Pet %u isn't pet of player %s .", uint32(GUID_LOPART(guid)), GetPlayer()->GetName().c_str());
        return;
    }

	Unit::ControlSet petsSet;
	if (checkPet->GetEntry() != GUID_ENPART(guid))
		petsSet.insert(checkPet);
	else
		petsSet = _player->m_Controlled;

	// Xinef: loop all pets with same entry (fixes partial state change for feral spirits)
	for (Unit::ControlSet::const_iterator itr = petsSet.begin(); itr != petsSet.end(); ++itr)
	{
		Unit* pet = *itr;
		if (checkPet->GetEntry() == GUID_ENPART(guid) && pet->GetEntry() != GUID_ENPART(guid))
			continue;

		// do not add not learned spells/ passive spells
		if (!pet->HasSpell(spellid) || !spellInfo->IsAutocastable())
			continue;

		CharmInfo* charmInfo = pet->GetCharmInfo();
		if (!charmInfo)
		{
			sLog->outError("WorldSession::HandlePetSpellAutocastOpcod: object (GUID: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!", pet->GetGUIDLow(), pet->GetTypeId());
			continue;
		}

		if (pet->IsPet())
			((Pet*)pet)->ToggleAutocast(spellInfo, state);
		else
			pet->GetCharmInfo()->ToggleCreatureAutocast(spellInfo, state);

		charmInfo->SetSpellAutocast(spellInfo, state);
	}
}
开发者ID:AlexHjelm,项目名称:sunwell,代码行数:57,代码来源:PetHandler.cpp


示例3: GetCreatureOrPetOrVehicle

Creature* ObjectAccessor::GetCreatureOrPetOrVehicle(WorldObject const& u, uint64 guid)
{
    if (IS_PLAYER_GUID(guid))
        return NULL;

    if (IS_PET_GUID(guid))
        return GetPet(guid);

    return u.IsInWorld() ? u.GetMap()->GetCreature(guid) : NULL;
}
开发者ID:GameOn,项目名称:gameon,代码行数:10,代码来源:ObjectAccessor.cpp


示例4: FindPlayer

Unit*
ObjectAccessor::GetUnit(WorldObject const &u, uint64 guid)
{
    if(!guid)
        return NULL;

    if(IS_PLAYER_GUID(guid))
        return FindPlayer(guid);

    return GetCreatureOrPetOrVehicle(u, guid);
}
开发者ID:Attractivee,项目名称:dfteam,代码行数:11,代码来源:ObjectAccessor.cpp


示例5:

void FollowMovementGenerator<Creature>::_updateSpeed(Creature* owner)
{
    // pet only sync speed with owner
    /// Make sure we are not in the process of a map change (IsInWorld)
	if (!IS_PLAYER_GUID(owner->GetOwnerGUID()) || !owner->IsInWorld() || !i_target.isValid() || i_target->GetGUID() != owner->GetOwnerGUID())
        return;

    owner->UpdateSpeed(MOVE_RUN, true);
    owner->UpdateSpeed(MOVE_WALK, true);
    owner->UpdateSpeed(MOVE_SWIM, true);
}
开发者ID:AlexHjelm,项目名称:sunwell,代码行数:11,代码来源:TargetedMovementGenerator.cpp


示例6: AttackStart

            void AttackStart(Unit* who)
            {
                if (me->ToTempSummon())
                {
                    if (who->GetTypeId() == TYPEID_PLAYER || IS_PLAYER_GUID(who->GetOwnerGUID()))
                        if (Unit* summoner = me->ToTempSummon()->GetSummoner())
                            summoner->GetAI()->DoAction(ACTION_INFORM);
                    return;
                }

                ScriptedAI::AttackStart(who);
            }
开发者ID:Keader,项目名称:Sunwell,代码行数:12,代码来源:boss_drakkari_colossus.cpp


示例7: FindPlayer

Unit*
ObjectAccessor::GetUnit(WorldObject const &u, uint64 guid)
{
    if(!guid)
        return NULL;

    if(IS_PLAYER_GUID(guid))
        return FindPlayer(guid);

    if (!u.IsInWorld())
        return NULL;

    return u.GetMap()->GetCreatureOrPetOrVehicle(guid);
}
开发者ID:AztiIluna,项目名称:mangos,代码行数:14,代码来源:ObjectAccessor.cpp


示例8: TC_LOG_DEBUG

void WorldSession::HandleGuildFinderDeclineRecruit(WorldPacket& recvPacket)
{
    TC_LOG_DEBUG("network", "WORLD: Received CMSG_LF_GUILD_DECLINE_RECRUIT");

    ObjectGuid playerGuid;

    recvPacket.ReadBitSeq<3, 4, 0, 1, 6, 2, 5, 7>(playerGuid);
    recvPacket.ReadByteSeq<2, 6, 5, 1, 7, 0, 4, 3>(playerGuid);

    if (!IS_PLAYER_GUID(playerGuid))
        return;

    sGuildFinderMgr->RemoveMembershipRequest(GUID_LOPART(playerGuid), GetPlayer()->GetGuildId());
}
开发者ID:Exodius,项目名称:chuspi,代码行数:14,代码来源:GuildFinderHandler.cpp


示例9: SF_LOG_DEBUG

void WorldSession::HandleGuildFinderDeclineRecruit(WorldPacket& recvPacket)
{
    SF_LOG_DEBUG("network", "WORLD: Received CMSG_LF_GUILD_DECLINE_RECRUIT");

    ObjectGuid RecruitGUID;

    recvPacket.ReadGuidMask(RecruitGUID, 6, 7, 3, 1, 2, 0, 4, 5);
    recvPacket.ReadGuidBytes(RecruitGUID, 0, 7, 1, 6, 4, 3, 5, 2);
    
    if (!IS_PLAYER_GUID(RecruitGUID))
        return;

    sGuildFinderMgr->RemoveMembershipRequest(GUID_LOPART(RecruitGUID), GetPlayer()->GetGuildId());
}
开发者ID:ProjectSkyfire,项目名称:SkyFire.548,代码行数:14,代码来源:GuildFinderHandler.cpp


示例10: HandleNpcBotResetCommand

 static bool HandleNpcBotResetCommand(ChatHandler* handler, const char* /*args*/)
 {
     Player* owner = handler->GetSession()->GetPlayer();
     Player* master = NULL;
     bool all = false;
     uint64 guid = owner->GetTarget();
     if (!guid)
     {
         handler->PSendSysMessage(".npcbot reset");
         handler->PSendSysMessage("Reset selected npcbot, or all npcbots if used on self");
         handler->SetSentErrorMessage(true);
         return false;
     }
     if (IS_PLAYER_GUID(guid))
     {
         master = owner;
         all = true;
     }
     else if (IS_CREATURE_GUID(guid))
     {
         if (Creature* cre = ObjectAccessor::GetCreature(*owner, guid))
             master = cre->GetBotOwner();
     }
     if (master && master->GetGUID() == owner->GetGUID())
     {
         if (!master->HaveBot())
         {
             handler->PSendSysMessage("Npcbots are not found!");
             handler->SetSentErrorMessage(true);
             return false;
         }
         for (uint8 i = 0; i != master->GetMaxNpcBots(); ++i)
         {
             if (all)
                 master->RemoveBot(master->GetBotMap(i)->_Guid());
             else if (master->GetBotMap(i)->_Guid() == guid)
             {
                 master->RemoveBot(guid);
                 break;
             }
         }
         handler->SetSentErrorMessage(true);
         return true;
     }
     handler->PSendSysMessage(".npcbot reset");
     handler->PSendSysMessage("Reset selected npcbot. Cannot be used in combat");
     handler->SetSentErrorMessage(true);
     return false;
 }
开发者ID:Ganshans,项目名称:world,代码行数:49,代码来源:botcommands.cpp


示例11: BuildPacket

void
ObjectAccessor::WorldObjectChangeAccumulator::Visit(DynamicObjectMapType &m)
{
    for(DynamicObjectMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
    {
        uint64 guid = iter->getSource()->GetCasterGUID();
        if(IS_PLAYER_GUID(guid))
        {
            //Caster may be NULL if DynObj is in removelist
            if(Player *caster = FindPlayer(guid))
                if (caster->GetUInt64Value(PLAYER_FARSIGHT) == iter->getSource()->GetGUID())
                    BuildPacket(caster);
        }
    }
}
开发者ID:MilchBuby,项目名称:riboncore,代码行数:15,代码来源:ObjectAccessor.cpp


示例12: EnterEvadeMode

void SmartAI::EnterEvadeMode()
{
    // xinef: fixes strange jumps when charming SmartAI npc
    if (!me->IsAlive() || me->IsInEvadeMode())
        return;
    
    if (IS_PLAYER_GUID(me->GetCharmerGUID()) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED))
    {
        me->AttackStop();
        return;
    }

    me->RemoveEvadeAuras();

    me->AddUnitState(UNIT_STATE_EVADE);
    me->DeleteThreatList();
    me->CombatStop(true);
    me->LoadCreaturesAddon(true);
    me->SetLootRecipient(NULL);
    me->ResetPlayerDamageReq();
    me->SetLastDamagedTime(0);

    GetScript()->ProcessEventsFor(SMART_EVENT_EVADE);//must be after aura clear so we can cast spells from db

    SetRun(mRun);
    if (HasEscortState(SMART_ESCORT_ESCORTING))
    {
        AddEscortState(SMART_ESCORT_RETURNING);
        ReturnToLastOOCPos();
    }
    else if (mFollowGuid)
    {
        if (Unit* target = ObjectAccessor::GetUnit(*me, mFollowGuid))
            me->GetMotionMaster()->MoveFollow(target, mFollowDist, mFollowAngle);
        me->ClearUnitState(UNIT_STATE_EVADE);

        // xinef: do not forget to reset scripts as we wont call reached home
        GetScript()->OnReset();
    }
    else
    {
        me->GetMotionMaster()->MoveTargetedHome();
        
        // xinef: do not forget to reset scripts as we wont call reached home
        if (!me->HasUnitState(UNIT_STATE_EVADE))
            GetScript()->OnReset();
    }
}
开发者ID:Matt-One,项目名称:azerothcore-wotlk,代码行数:48,代码来源:SmartAI.cpp


示例13: GetOwnerGUID

GameObject::~GameObject()
{
    if(m_uint32Values)                                      // field array can be not exist if GameOBject not loaded
    {
        // crash possible at access to deleted GO in Unit::m_gameobj
        uint64 owner_guid = GetOwnerGUID();
        if(owner_guid)
        {
            Unit* owner = ObjectAccessor::GetUnit(*this,owner_guid);
            if(owner)
                owner->RemoveGameObject(this,false);
            else if(!IS_PLAYER_GUID(owner_guid))
                sLog.outError("Delete GameObject (GUID: %u Entry: %u ) that have references in not found creature %u GO list. Crash possible later.",GetGUIDLow(),GetGOInfo()->id,GUID_LOPART(owner_guid));
        }
    }
}
开发者ID:Actionfox,项目名称:mangos,代码行数:16,代码来源:GameObject.cpp


示例14: HandleListAurasCommand

    static bool HandleListAurasCommand(ChatHandler* handler, char const* /*args*/)
    {
        Unit* unit = handler->getSelectedUnit();
        if (!unit)
        {
            handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
            handler->SetSentErrorMessage(true);
            return false;
        }

        char const* talentStr = handler->GetTrinityString(LANG_TALENT);
        char const* passiveStr = handler->GetTrinityString(LANG_PASSIVE);

        Unit::AuraApplicationMap const& auras = unit->GetAppliedAuras();
        handler->PSendSysMessage(LANG_COMMAND_TARGET_LISTAURAS, auras.size());
        for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
        {
            bool talent = GetTalentSpellCost(itr->second->GetBase()->GetId()) > 0;

            AuraApplication const* aurApp = itr->second;
            Aura const* aura = aurApp->GetBase();
            char const* name = aura->GetSpellInfo()->SpellName[handler->GetSessionDbcLocale()];

            std::ostringstream ss_name;
            ss_name << "|cffffffff|Hspell:" << aura->GetId() << "|h[" << name << "]|h|r";

            handler->PSendSysMessage(LANG_COMMAND_TARGET_AURADETAIL, aura->GetId(), (handler->GetSession() ? ss_name.str().c_str() : name),
                aurApp->GetEffectMask(), aura->GetCharges(), aura->GetStackAmount(), aurApp->GetSlot(),
                aura->GetDuration(), aura->GetMaxDuration(), (aura->IsPassive() ? passiveStr : ""),
                (talent ? talentStr : ""), IS_PLAYER_GUID(aura->GetCasterGUID()) ? "player" : "creature",
                GUID_LOPART(aura->GetCasterGUID()));
        }

        for (uint16 i = 0; i < TOTAL_AURAS; ++i)
        {
            Unit::AuraEffectList const& auraList = unit->GetAuraEffectsByType(AuraType(i));
            if (auraList.empty())
                continue;

            handler->PSendSysMessage(LANG_COMMAND_TARGET_LISTAURATYPE, auraList.size(), i);

            for (Unit::AuraEffectList::const_iterator itr = auraList.begin(); itr != auraList.end(); ++itr)
                handler->PSendSysMessage(LANG_COMMAND_TARGET_AURASIMPLE, (*itr)->GetId(), (*itr)->GetEffIndex(), (*itr)->GetAmount());
        }

        return true;
    }
开发者ID:3000Lane,项目名称:TrinityCore,代码行数:47,代码来源:cs_list.cpp


示例15: HandleGameObjectDeleteCommand

    //delete object by selection or guid
    static bool HandleGameObjectDeleteCommand (ChatHandler* handler, const char* args)
    {
        // number or [name] Shift-click form |color|Hgameobject:go_guid|h[name]|h|r
        char* cId = handler->extractKeyFromLink((char*) args, "Hgameobject");
        if (!cId)
            return false;

        uint32 lowguid = atoi(cId);
        if (!lowguid)
            return false;

        GameObject* obj = NULL;

        // by DB guid
        if (GameObjectData const* go_data = sObjectMgr->GetGOData(lowguid))
            obj = handler->GetObjectGlobalyWithGuidOrNearWithDbGuid(lowguid, go_data->id);

        if (!obj)
        {
            handler->PSendSysMessage(LANG_COMMAND_OBJNOTFOUND, lowguid);
            handler->SetSentErrorMessage(true);
            return false;
        }

        uint64 owner_guid = obj->GetOwnerGUID();
        if (owner_guid)
        {
            Unit* owner = ObjectAccessor::GetUnit(*handler->GetSession()->GetPlayer(), owner_guid);
            if (!owner || !IS_PLAYER_GUID(owner_guid))
            {
                handler->PSendSysMessage(LANG_COMMAND_DELOBJREFERCREATURE, GUID_LOPART(owner_guid), obj->GetGUIDLow());
                handler->SetSentErrorMessage(true);
                return false;
            }

            owner->RemoveGameObject(obj, false);
        }

        obj->SetRespawnTime(0);          // not save respawn time
        obj->Delete();
        obj->DeleteFromDB();

        handler->PSendSysMessage(LANG_COMMAND_DELOBJMESSAGE, obj->GetGUIDLow());
        sLog->outSQLDev("DELETE FROM gameobject WHERE guid = %u;", obj->GetGUIDLow());
        return true;
    }
开发者ID:Kretol,项目名称:ArkCORE,代码行数:47,代码来源:cs_gobject.cpp


示例16: HandleGameObjectDeleteCommand

    //delete object by selection or guid
    static bool HandleGameObjectDeleteCommand(ChatHandler* handler, char const* args)
    {
        // number or [name] Shift-click form |color|Hgameobject:go_guid|h[name]|h|r
        char* id = handler->extractKeyFromLink((char*)args, "Hgameobject");
        if (!id)
            return false;

        uint32 guidLow = atoi(id);
        if (!guidLow)
            return false;

        GameObject* object = NULL;

        // by DB guid
        if (GameObjectData const* gameObjectData = sObjectMgr->GetGOData(guidLow))
            object = handler->GetObjectGlobalyWithGuidOrNearWithDbGuid(guidLow, gameObjectData->id);

        if (!object)
        {
            handler->PSendSysMessage(LANGUAGE_COMMAND_OBJNOTFOUND, guidLow);
            handler->SetSentErrorMessage(true);
            return false;
        }

        uint64 ownerGuid = object->GetOwnerGUID();
        if (ownerGuid)
        {
            Unit* owner = ObjectAccessor::GetUnit(*handler->GetSession()->GetPlayer(), ownerGuid);
            if (!owner || !IS_PLAYER_GUID(ownerGuid))
            {
                handler->PSendSysMessage(LANGUAGE_COMMAND_DELOBJREFERCREATURE, GUID_LOPART(ownerGuid), object->GetGUIDLow());
                handler->SetSentErrorMessage(true);
                return false;
            }

            owner->RemoveGameObject(object, false);
        }

        object->SetRespawnTime(0);                                 // not save respawn time
        object->Delete();
        object->DeleteFromDB();

        handler->PSendSysMessage(LANGUAGE_COMMAND_DELOBJMESSAGE, object->GetGUIDLow());

        return true;
    }
开发者ID:Baeumchen,项目名称:SkyFireEMU,代码行数:47,代码来源:cs_gobject.cpp


示例17: uint32

void WorldSession::HandleQuestgiverQueryQuestOpcode(WorldPacket & recv_data) {
	uint64 guid;
	uint32 quest;
	uint8 unk1;
	recv_data >> guid >> quest >> unk1;
	sLog->outDebug(
			LOG_FILTER_NETWORKIO,
			"WORLD: Received CMSG_QUESTGIVER_QUERY_QUEST npc = %u, quest = %u, unk1 = %u",
			uint32(GUID_LOPART(guid)), quest, unk1);

	// Verify that the guid is valid and is a questgiver or involved in the requested quest
	Object* pObject = ObjectAccessor::GetObjectByTypeMask(
			*_player,
			guid,
			TYPEMASK_UNIT | TYPEMASK_GAMEOBJECT | TYPEMASK_ITEM
					| TYPEMASK_PLAYER);

	if (!IS_PLAYER_GUID(guid)) {
		if (!pObject
				|| (!pObject->hasQuest(quest)
						&& !pObject->hasInvolvedQuest(quest))) {
			_player->PlayerTalkClass->CloseGossip();
			return;
		}
	}

	Quest const* pQuest = sObjectMgr->GetQuestTemplate(quest);
	if (pQuest) {
		if (pQuest->IsAutoAccept() && _player->CanAddQuest(pQuest, true)) {
			_player->AddQuest(pQuest, pObject);
			if (_player->CanCompleteQuest(quest))
				_player->CompleteQuest(quest);
		}

		if (pQuest->HasFlag(QUEST_FLAGS_AUTOCOMPLETE))
			_player->PlayerTalkClass->SendQuestGiverRequestItems(pQuest,
					pObject->GetGUID(),
					_player->CanCompleteQuest(pQuest->GetQuestId()), true);
		else
			_player->PlayerTalkClass->SendQuestGiverQuestDetails(pQuest,
					pObject->GetGUID(), true);
	}
	// Now save player every accept/deliver a quest
	if (_player)
		_player->SaveToDB();
}
开发者ID:rexy,项目名称:ArkCORE,代码行数:46,代码来源:QuestHandler.cpp


示例18: HandleGuildFinderDeclineRecruit

void WorldSession::HandleGuildFinderDeclineRecruit(WorldPacket& recvPacket)
{
    sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_LF_GUILD_DECLINE_RECRUIT");

    ObjectGuid playerGuid;

    uint8 bitOrder[8] = {5, 1, 3, 7, 6, 2, 0, 4};
    recvPacket.ReadBitInOrder(playerGuid, bitOrder);

    uint8 byteOrder[8] = {4, 2, 3, 7, 6, 0, 1, 5};
    recvPacket.ReadBytesSeq(playerGuid, byteOrder);

    if (!IS_PLAYER_GUID(playerGuid))
        return;

    sGuildFinderMgr->RemoveMembershipRequest(GUID_LOPART(playerGuid), GetPlayer()->GetGuildId());
}
开发者ID:cooler-SAI,项目名称:PandaFire,代码行数:17,代码来源:GuildFinderHandler.cpp


示例19: GetPlayer

void WorldSession::HandleRaidTargetUpdateOpcode(WorldPacket& recvData)
{
    sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_RAID_TARGET_UPDATE");

    Group* group = GetPlayer()->GetGroup();
    if (!group)
        return;

    uint8 x, unk;
    recvData >> unk;
    recvData >> x;

    /** error handling **/
    /********************/

    // everything's fine, do it
    if (x == 0xFF)                                           // target icon request
        group->SendTargetIconList(this);
    else                                                    // target icon update
    {
        if (group->isRaidGroup() && !group->IsLeader(GetPlayer()->GetGUID()) && !group->IsAssistant(GetPlayer()->GetGUID()) && !(group->GetGroupType() & GROUPTYPE_EVERYONE_IS_ASSISTANT))
            return;

        ObjectGuid guid;

        uint8 bitOrder[8] = { 6, 3, 2, 5, 4, 1, 0, 7 };
        recvData.ReadBitInOrder(guid, bitOrder);

        recvData.FlushBits();

        uint8 byteOrder[8] = { 0, 3, 4, 2, 5, 1, 7, 6 };
        recvData.ReadBytesSeq(guid, byteOrder);

        if (IS_PLAYER_GUID(guid))
        {
            Player* target = ObjectAccessor::FindPlayer(guid);

            if (!target || target->IsHostileTo(GetPlayer()))
                return;
        }

        group->SetTargetIcon(x, _player->GetGUID(), guid);
    }
}
开发者ID:Expery,项目名称:Core,代码行数:44,代码来源:GroupHandler.cpp


示例20: HandleEjectPassenger

void WorldSession::HandleEjectPassenger(WorldPacket &data)
{
    if (Vehicle* vehicle = _player->GetVehicleKit())
    {
        uint64 guid;
        data >> guid;

        if (IS_PLAYER_GUID(guid))
        {
            if (Player *plr = ObjectAccessor::FindPlayer(guid))
            {
                VehicleSeatEntry const* seat = vehicle->GetSeatForPassenger(plr);
                if (seat->IsEjectable())
                    plr->ExitVehicle();
                else
                    sLog->outError("Player %u attempted to eject player %u from non-ejectable seat.", GetPlayer()->GetGUIDLow(), GUID_LOPART(guid));
            }
            else
                sLog->outError("Player %u tried to eject player %u from vehicle, but the latter was not found in world!", GetPlayer()->GetGUIDLow(), GUID_LOPART(guid));
        }

        else if (IS_CREATURE_GUID(guid))
        {
            if (Unit *unit = ObjectAccessor::GetUnit(*_player, guid)) // creatures can be ejected too from player mounts
            {
                VehicleSeatEntry const* seat = vehicle->GetSeatForPassenger(unit);
                ASSERT(seat);
                if (seat->IsEjectable())
                {
                    ASSERT(GetPlayer() == vehicle->GetBase());
                    unit->ExitVehicle();
                    unit->ToCreature()->DespawnOrUnsummon(1000);
                    ASSERT(!unit->IsOnVehicle(vehicle->GetBase()));
                }
                else
                    sLog->outError("Player %u attempted to eject creature GUID "UI64FMTD" from non-ejectable seat.", GetPlayer()->GetGUIDLow(), GUID_LOPART(guid));
            }
            else
                sLog->outError("Player %u tried to eject creature guid %u from vehicle, but the latter was not found in world!", GetPlayer()->GetGUIDLow(), GUID_LOPART(guid));
        }
        else
            sLog->outError("HandleEjectPassenger: Player %u tried to eject invalid GUID "UI64FMTD, GetPlayer()->GetGUIDLow(), guid);
    }
开发者ID:sprokopiev,项目名称:TrinityCore,代码行数:43,代码来源:MovementHandler.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ IS_PRINTABLE函数代码示例发布时间:2022-05-30
下一篇:
C++ IS_PATH_SEP函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap