當前位置: 首頁>>代碼示例>>C++>>正文


C++ GetObjectGuid函數代碼示例

本文整理匯總了C++中GetObjectGuid函數的典型用法代碼示例。如果您正苦於以下問題:C++ GetObjectGuid函數的具體用法?C++ GetObjectGuid怎麽用?C++ GetObjectGuid使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了GetObjectGuid函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: DETAIL_FILTER_LOG

void Transport::Start()
{
    DETAIL_FILTER_LOG(LOG_FILTER_TRANSPORT_MOVES, "Transport::StartMovement %s (%s) start moves, period %u/%u",
        GetObjectGuid().GetString().c_str(),
        GetName(),
        m_pathTime,
        GetPeriod()
        );
    SetActiveObjectState(true);
    BuildStartMovePacket(GetMap());
}
開發者ID:120239197a,項目名稱:SingleCore,代碼行數:11,代碼來源:Transports.cpp

示例2: GetMap

void DynamicObject::RemoveFromWorld()
{
    ///- Remove the dynamicObject from the accessor
    if(IsInWorld())
    {
        GetMap()->GetObjectsStore().erase<DynamicObject>(GetObjectGuid(), (DynamicObject*)NULL);
        GetViewPoint().Event_RemovedFromWorld();
    }

    Object::RemoveFromWorld();
}
開發者ID:KioM,項目名稱:mangos-b,代碼行數:11,代碼來源:DynamicObject.cpp

示例3: GetUInt32Value

// Though the client has the information in the item's data field,
// we have to send SMSG_ITEM_TIME_UPDATE to display the remaining
// time.
void Item::SendTimeUpdate(Player* owner)
{
    uint32 duration = GetUInt32Value(ITEM_FIELD_DURATION);
    if (!duration)
        return;

    WorldPacket data(SMSG_ITEM_TIME_UPDATE, (8 + 4));
    data << ObjectGuid(GetObjectGuid());
    data << uint32(duration);
    owner->GetSession()->SendPacket(&data);
}
開發者ID:PanteraPolnocy,項目名稱:MaNGOS-Zero,代碼行數:14,代碼來源:Item.cpp

示例4: DETAIL_FILTER_LOG

void MOTransport::Stop()
{
    DETAIL_FILTER_LOG(LOG_FILTER_TRANSPORT_MOVES, "Transport::StartMovement %s (%s) stop moves, period %u/%u",
        GetObjectGuid().GetString().c_str(),
        GetName(),
        m_pathTime,
        GetPeriod()
        );
    SetActiveObjectState(false);
    RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
    SetGoState(GO_STATE_READY);
    SetLootState(GO_JUST_DEACTIVATED);
}
開發者ID:beyourself,項目名稱:RustEmu-Core,代碼行數:13,代碼來源:Transports.cpp

示例5: MANGOS_ASSERT

void Corpse::DeleteBonesFromWorld()
{
    MANGOS_ASSERT(GetType() == CORPSE_BONES);
    Corpse* corpse = GetMap()->GetCorpse(GetObjectGuid());

    if (!corpse)
    {
        sLog.outError("Bones %u not found in world.", GetGUIDLow());
        return;
    }

    AddObjectToRemoveList();
}
開發者ID:krullgor,項目名稱:mangos-wotlk,代碼行數:13,代碼來源:Corpse.cpp

示例6: data

WorldPacket CPlayer::BuildNameQuery()
{
    WorldPacket data(SMSG_NAME_QUERY_RESPONSE, (8 + 1 + 4 + 4 + 4 + 10));
    data << GetObjectGuid();      // player guid
    data << GetName();            // player name
    data << uint8(0);                       // realm name
    data << uint32(getRace());    // player race
    data << uint32(getGender());  // player gender
    data << uint32(getClass());   // player class
    data << uint8(0);                       // is not declined

    return data;
}
開發者ID:kuramajssken001,項目名稱:mangos-tbc,代碼行數:13,代碼來源:CFBG.cpp

示例7: data

void Group::SendUpdate()
{
    for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
    {
        Player* player = sObjectMgr.GetPlayer(citr->guid);
        if (!player || !player->GetSession() || player->GetGroup() != this)
            continue;
        // guess size
        WorldPacket data(SMSG_GROUP_LIST, (1 + 1 + 1 + 1 + 8 + 4 + GetMembersCount() * 20));
        data << uint8(m_groupType);                         // group type (flags in 3.3)
        data << uint8(citr->group);                         // groupid
        data << uint8(GetFlags(*citr));                     // group flags
        data << uint8(isBGGroup() ? 1 : 0);                 // 2.0.x, isBattleGroundGroup?
        if (m_groupType & GROUPTYPE_LFD)
        {
            data << uint8(0);
            data << uint32(0);
        }
        data << GetObjectGuid();                            // group guid
        data << uint32(0);                                  // 3.3, this value increments every time SMSG_GROUP_LIST is sent
        data << uint32(GetMembersCount() - 1);
        for (member_citerator citr2 = m_memberSlots.begin(); citr2 != m_memberSlots.end(); ++citr2)
        {
            if (citr->guid == citr2->guid)
                continue;
            Player* member = sObjectMgr.GetPlayer(citr2->guid);
            uint8 onlineState = (member && member->GetSession() && !member->GetSession()->PlayerLogout()) ? MEMBER_STATUS_ONLINE : MEMBER_STATUS_OFFLINE;
            onlineState = onlineState | ((isBGGroup()) ? MEMBER_STATUS_PVP : 0);

            data << citr2->name;
            data << citr2->guid;
            data << uint8(onlineState);
            data << uint8(citr2->group);                    // groupid
            data << uint8(GetFlags(*citr2));                // group flags
            data << uint8(0);                               // 3.3, role?
        }

        ObjectGuid masterLootGuid = (m_lootMethod == MASTER_LOOT) ? m_masterLooterGuid : ObjectGuid();
        data << m_leaderGuid;                               // leader guid
        if (GetMembersCount() - 1)
        {
            data << uint8(m_lootMethod);                    // loot method
            data << masterLootGuid;                         // master loot guid
            data << uint8(m_lootThreshold);                 // loot threshold
            data << uint8(m_dungeonDifficulty);             // Dungeon Difficulty
            data << uint8(m_raidDifficulty);                // Raid Difficulty
            data << uint8(0);                               // 3.3, dynamic difficulty?
        }
        player->GetSession()->SendPacket(&data);
    }
}
開發者ID:HerrTrigger,項目名稱:mangos-wotlk,代碼行數:51,代碼來源:Group.cpp

示例8: MANGOS_ASSERT

void Bag::StoreItem(uint8 slot, Item* pItem, bool /*update*/)
{
    MANGOS_ASSERT(slot < MAX_BAG_SIZE);

    if (pItem)
    {
        m_bagslot[slot] = pItem;
        SetGuidValue(CONTAINER_FIELD_SLOT_1 + (slot * 2), pItem->GetObjectGuid());
        pItem->SetGuidValue(ITEM_FIELD_CONTAINED, GetObjectGuid());
        pItem->SetGuidValue(ITEM_FIELD_OWNER, GetOwnerGuid());
        pItem->SetContainer(this);
        pItem->SetSlot(slot);
    }
}
開發者ID:mynew4,項目名稱:RustEmu-Core,代碼行數:14,代碼來源:Bag.cpp

示例9: JoinBattleGround

void CPlayer::JoinBattleGround(BattleGround* bg)
{
    if (bg->isArena())
        return;

    if (!NativeTeam())
    {
        m_FakedPlayers.push_back(GetObjectGuid());
        SetByteValue(UNIT_FIELD_BYTES_0, 0, getFRace());
        setFaction(getFFaction());
    }

    SetRecache();
    FakeDisplayID();
}
開發者ID:kuramajssken001,項目名稱:mangos-tbc,代碼行數:15,代碼來源:CFBG.cpp

示例10: data

void Group::SendUpdate()
{
    for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
    {
        Player* player = sObjectMgr.GetPlayer(citr->guid);
        if (!player || !player->GetSession() || player->GetGroup() != this)
            continue;
        // guess size
        WorldPacket data(SMSG_GROUP_LIST, (1 + 1 + 1 + 1 + 8 + 4 + GetMembersCount() * 20));
        data << uint8(m_groupType);                         // group type
        data << uint8(isBGGroup() ? 1 : 0);                 // 2.0.x, isBattleGroundGroup?
        data << uint8(citr->group);                         // groupid
        data << uint8(citr->assistant ? 0x01 : 0);          // 0x2 main assist, 0x4 main tank
        data << GetObjectGuid();                            // group guid
        data << uint32(GetMembersCount() - 1);
        for (member_citerator citr2 = m_memberSlots.begin(); citr2 != m_memberSlots.end(); ++citr2)
        {
            if (citr->guid == citr2->guid)
                continue;
            Player* member = sObjectMgr.GetPlayer(citr2->guid);
            uint8 onlineState = (member) ? MEMBER_STATUS_ONLINE : MEMBER_STATUS_OFFLINE;
            onlineState = onlineState | ((isBGGroup()) ? MEMBER_STATUS_PVP : 0);

            data << citr2->name;
            data << citr2->guid;
            // online-state
            data << uint8(sObjectMgr.GetPlayer(citr2->guid) ? 1 : 0);
            data << uint8(citr2->group);                    // groupid
            data << uint8(citr2->assistant ? 0x01 : 0);     // 0x2 main assist, 0x4 main tank
        }

        ObjectGuid masterLootGuid = (m_lootMethod == MASTER_LOOT) ? m_masterLooterGuid : ObjectGuid();
        data << m_leaderGuid;                               // leader guid
        if (GetMembersCount() - 1)
        {
            data << uint8(m_lootMethod);                    // loot method
            data << masterLootGuid;                         // master loot guid
            data << uint8(m_lootThreshold);                 // loot threshold
            data << uint8(m_difficulty);                    // Heroic Mod Group
        }
        player->GetSession()->SendPacket(&data);
    }
}
開發者ID:AlexHjelm,項目名稱:Core,代碼行數:43,代碼來源:Group.cpp

示例11: GetBattleGround

void CPlayer::RecachePlayersFromBG()
{
    BattleGround* bg = GetBattleGround();

    if (!bg)
        return;

    for (auto& itr : bg->GetPlayers())
    {
        if (Player* player = sObjectMgr.GetPlayer(itr.first))
        {
            if (!player->ToCPlayer()->NativeTeam())
            {
                // Erase bg players from source player cache
                WorldPacket data(SMSG_INVALIDATE_PLAYER, 8);
                data << player->GetObjectGuid();
                GetSession()->SendPacket(&data);
                // Send bg player data to source player
                data = player->ToCPlayer()->BuildNameQuery();
                GetSession()->SendPacket(&data);
            }

            if (!NativeTeam())
            {
                // Erase source player from bg players cache
                WorldPacket data(SMSG_INVALIDATE_PLAYER, 8);
                data << GetObjectGuid();
                player->GetSession()->SendPacket(&data);
                // Send new source data to bg players
                data = BuildNameQuery();
                player->GetSession()->SendPacket(&data);
            }
        }
        else
        {
            // Couldn't find bgplayer, recache him for source player in case he logs in again.
            WorldPacket data(SMSG_INVALIDATE_PLAYER, 8);
            data << itr.first;
            GetSession()->SendPacket(&data);
        }
    }
}
開發者ID:kuramajssken001,項目名稱:mangos-tbc,代碼行數:42,代碼來源:CFBG.cpp

示例12: data

void Group::SendUpdate()
{
    for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
    {
        Player* player = sObjectMgr.GetPlayer(citr->guid);
        if (!player || !player->GetSession() || player->GetGroup() != this)
            continue;
        // guess size
        WorldPacket data(SMSG_GROUP_LIST, (1 + 1 + 1 + 1 + 8 + 4 + GetMembersCount() * 20));
        data << uint8(m_groupType);                         // group type
        data << uint8(isBattleGroup() ? 1 : 0);                 // 2.0.x, isBattleGroundGroup?
        data << uint8(citr->group);                         // groupid
        data << uint8(GetFlags(*citr));                     // group flags
        data << GetObjectGuid();                            // group guid
        data << uint32(GetMembersCount() - 1);
        for (member_citerator citr2 = m_memberSlots.begin(); citr2 != m_memberSlots.end(); ++citr2)
        {
            if (citr->guid == citr2->guid)
                continue;
            data << citr2->name;
            data << citr2->guid;
            data << uint8(GetGroupMemberStatus(sObjectMgr.GetPlayer(citr2->guid)));
            data << uint8(citr2->group);                    // groupid
            data << uint8(GetFlags(*citr2));                // group flags
        }

        ObjectGuid masterLootGuid = (m_lootMethod == MASTER_LOOT) ? m_masterLooterGuid : ObjectGuid();
        data << m_leaderGuid;                               // leader guid
        if (GetMembersCount() - 1)
        {
            data << uint8(m_lootMethod);                    // loot method
            data << masterLootGuid;                         // master loot guid
            data << uint8(m_lootThreshold);                 // loot threshold
            data << uint8(m_difficulty);                    // Heroic Mod Group
        }
        player->GetSession()->SendPacket(data);
    }
}
開發者ID:lduguid,項目名稱:mangos-tbc,代碼行數:38,代碼來源:Group.cpp

示例13: ProcessEventId_event_test_of_endurance

bool ProcessEventId_event_test_of_endurance(uint32 eventId, Object* pSource, Object* pTarget, bool isStart)
{
    auto pGO = pTarget->ToGameObject();
    auto pPlayer = pSource->ToPlayer();

    if (!pGO || !pPlayer)
        return true;

    if (pGO->FindNearestCreature(NPC_GRENKA, 100.0f))
        return true;

    if (auto pGrenka = pGO->SummonCreature(Harpies[4].entry,
        Harpies[4].x,
        Harpies[4].y, 
        Harpies[4].z, 
        Harpies[4].o, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, MINUTE*IN_MILLISECONDS))
    {
        if (auto pGrenkaAI = static_cast<npc_grenka_bloodscreechAI*>(pGrenka->AI()))
            pGrenkaAI->m_PlayerGuid = pPlayer->GetObjectGuid();
    }

    return true;
}
開發者ID:Maduse,項目名稱:server,代碼行數:23,代碼來源:thousand_needles.cpp

示例14: CanBeTraded

bool Item::CanBeTraded() const
{
    if (IsSoulBound())
        return false;
    if (IsBag() && (Player::IsBagPos(GetPos()) || !((Bag const*)this)->IsEmpty()))
        return false;

    if (Player* owner = GetOwner())
    {
        if (owner->CanUnequipItem(GetPos(), false) !=  EQUIP_ERR_OK)
            return false;
        if (owner->GetLootGuid() == GetObjectGuid())
            return false;
    }

    if (HasGeneratedLoot())
        return false;

    if (IsBoundByEnchant())
        return false;

    return true;
}
開發者ID:Flairgun,項目名稱:mangos-tbc,代碼行數:23,代碼來源:Item.cpp

示例15: SendObjectDeSpawnAnim

void Totem::UnSummon()
{
    SendObjectDeSpawnAnim(GetObjectGuid());

    CombatStop();
    RemoveAurasDueToSpell(GetSpell());

    if (Unit* owner = GetOwner())
    {
        owner->_RemoveTotem(this);
        owner->RemoveAurasDueToSpell(GetSpell());

        // remove aura all party members too
        if (owner->GetTypeId() == TYPEID_PLAYER)
        {
            // Not only the player can summon the totem (scripted AI)
            if (Group* pGroup = ((Player*)owner)->GetGroup())
            {
                for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
                {
                    Player* Target = itr->getSource();
                    if (Target && pGroup->SameSubGroup((Player*)owner, Target))
                        Target->RemoveAurasDueToSpell(GetSpell());
                }
            }
        }

        if (owner->GetTypeId() == TYPEID_UNIT && ((Creature*)owner)->AI())
            ((Creature*)owner)->AI()->SummonedCreatureDespawn((Creature*)this);
    }

    // any totem unsummon look like as totem kill, req. for proper animation
    if (isAlive())
        SetDeathState(DEAD);

    AddObjectToRemoveList();
}
開發者ID:249CAAFE40,項目名稱:mangos-tbc,代碼行數:37,代碼來源:Totem.cpp


注:本文中的GetObjectGuid函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。