您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ DoLootRelease函数代码示例

51自学网 2021-06-01 20:28:57
  C++
这篇教程C++ DoLootRelease函数代码示例写得很实用,希望能帮到您。

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

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

示例1: DoLootRelease

void WorldSession::HandleLootReleaseOpcode(WorldPackets::Loot::LootRelease& packet){    // cheaters can modify lguid to prevent correct apply loot release code and re-loot    // use internal stored guid    if (GetPlayer()->HasLootWorldObjectGUID(packet.Unit))        DoLootRelease(packet.Unit);}
开发者ID:Lyill,项目名称:TrinityCore,代码行数:7,


示例2: DoLootRelease

void WorldSession::HandleLootReleaseOpcode(WorldPacket& recvData){    sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_LOOT_RELEASE");    // cheaters can modify lguid to prevent correct apply loot release code and re-loot    // use internal stored guid    ObjectGuid guid;	    guid[7] = recvData.ReadBit();    guid[4] = recvData.ReadBit();    guid[2] = recvData.ReadBit();    guid[3] = recvData.ReadBit();    guid[0] = recvData.ReadBit();    guid[5] = recvData.ReadBit();    guid[6] = recvData.ReadBit();    guid[1] = recvData.ReadBit();    recvData.ReadByteSeq(guid[0]);    recvData.ReadByteSeq(guid[6]);    recvData.ReadByteSeq(guid[4]);    recvData.ReadByteSeq(guid[2]);    recvData.ReadByteSeq(guid[5]);    recvData.ReadByteSeq(guid[3]);    recvData.ReadByteSeq(guid[7]);    recvData.ReadByteSeq(guid[1]);    if (uint64 lguid = GetPlayer()->GetLootGUID())        if (lguid == guid)            DoLootRelease(lguid);}
开发者ID:CATACLYSMDEV,项目名称:JadeCore-5.4.8-18291--dev-,代码行数:30,


示例3: DEBUG_LOG

void WorldSession::HandleLootReleaseOpcode( WorldPacket & recv_data ){    DEBUG_LOG("WORLD: CMSG_LOOT_RELEASE");    // cheaters can modify lguid to prevent correct apply loot release code and re-loot    // use internal stored guid    recv_data.read_skip<uint64>();                          // guid;    if(uint64 lguid = GetPlayer()->GetLootGUID())        DoLootRelease(lguid);}
开发者ID:Wowka321,项目名称:mangos,代码行数:11,


示例4: TC_LOG_DEBUG

void WorldSession::HandleLootReleaseOpcode(WorldPackets::Loot::LootRelease& packet){    TC_LOG_DEBUG("network", "WORLD: CMSG_LOOT_RELEASE");    // cheaters can modify lguid to prevent correct apply loot release code and re-loot    // use internal stored guid    ObjectGuid lguid = GetPlayer()->GetLootGUID();    if (!lguid.IsEmpty())        if (lguid == packet.Unit)            DoLootRelease(lguid);}
开发者ID:Abrek,项目名称:My-WoDCore-6.x.x,代码行数:11,


示例5: TC_LOG_DEBUG

void WorldSession::HandleLootReleaseOpcode(WorldPacket& recvData){    TC_LOG_DEBUG("network", "WORLD: CMSG_LOOT_RELEASE");    // cheaters can modify lguid to prevent correct apply loot release code and re-loot    // use internal stored guid    ObjectGuid guid;    recvData >> guid;    if (ObjectGuid lguid = GetPlayer()->GetLootGUID())        if (lguid == guid)            DoLootRelease(lguid);}
开发者ID:Refuge89,项目名称:TrinityCore,代码行数:13,


示例6: DoLootRelease

void WorldSession::HandleLootReleaseOpcode(WorldPacket& recvData){    sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_LOOT_RELEASE");    // cheaters can modify lguid to prevent correct apply loot release code and re-loot    // use internal stored guid    uint64 guid;    recvData >> guid;    if (uint64 lguid = GetPlayer()->GetLootGUID())        if (lguid == guid)            DoLootRelease(lguid);}
开发者ID:FirstCore,项目名称:Trinity-Zero,代码行数:13,


示例7: CHECK_PACKET_SIZE

void WorldSession::HandleLootReleaseOpcode(WorldPacket & recv_data){    CHECK_PACKET_SIZE(recv_data,8);    sLog.outDebug("WORLD: CMSG_LOOT_RELEASE");    // cheaters can modify lguid to prevent correct apply loot release code and re-loot    // use internal stored guid    //uint64   lguid;    //recv_data >> lguid;    if (uint64 lguid = GetPlayer()->GetLootGUID())        DoLootRelease(lguid);}
开发者ID:Dolmero,项目名称:L4G_Core,代码行数:14,


示例8: DEBUG_LOG

void WorldSession::HandleLogoutRequestOpcode( WorldPacket & /*recv_data*/ ){    DEBUG_LOG( "WORLD: Recvd CMSG_LOGOUT_REQUEST Message, security - %u", GetSecurity() );    if (ObjectGuid lootGuid = GetPlayer()->GetLootGuid())        DoLootRelease(lootGuid);    //Can not logout if...    if( GetPlayer()->isInCombat() ||                        //...is in combat        GetPlayer()->duel         ||                        //...is in Duel                                                            //...is jumping ...is falling        GetPlayer()->m_movementInfo.HasMovementFlag(MovementFlags(MOVEFLAG_FALLING | MOVEFLAG_FALLINGFAR)))    {        WorldPacket data( SMSG_LOGOUT_RESPONSE, (2+4) ) ;        data << (uint8)0xC;        data << uint32(0);        data << uint8(0);        SendPacket( &data );        LogoutRequest(0);        return;    }    //instant logout in taverns/cities or on taxi or for admins, gm's, mod's if its enabled in mangosd.conf    if (GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) || GetPlayer()->IsTaxiFlying() ||        GetSecurity() >= (AccountTypes)sWorld.getConfig(CONFIG_UINT32_INSTANT_LOGOUT))    {        LogoutPlayer(true);        return;    }    // not set flags if player can't free move to prevent lost state at logout cancel    if(GetPlayer()->CanFreeMove())    {        float height = GetPlayer()->GetTerrain()->GetHeight(GetPlayer()->GetPositionX(), GetPlayer()->GetPositionY(), GetPlayer()->GetPositionZ());        if ((GetPlayer()->GetPositionZ() < height + 0.1f) && !(GetPlayer()->IsInWater()))            GetPlayer()->SetStandState(UNIT_STAND_STATE_SIT);        WorldPacket data( SMSG_FORCE_MOVE_ROOT, (8+4) );    // guess size        data << GetPlayer()->GetPackGUID();        data << (uint32)2;        SendPacket( &data );        GetPlayer()->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);    }    WorldPacket data( SMSG_LOGOUT_RESPONSE, 5 );    data << uint32(0);    data << uint8(0);    SendPacket( &data );    LogoutRequest(time(NULL));}
开发者ID:SeTM,项目名称:one,代码行数:50,


示例9: GetPlayer

void WorldSession::HandleLogoutRequestOpcode(WorldPackets::Character::LogoutRequest& /*logoutRequest*/){    ObjectGuid lguid = GetPlayer()->GetLootGUID();    if (!lguid.IsEmpty())        DoLootRelease(lguid);    bool instantLogout = (GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) && !GetPlayer()->IsInCombat()) ||                         GetPlayer()->IsInFlight() || HasPermission(rbac::RBAC_PERM_INSTANT_LOGOUT);    /// TODO: Possibly add RBAC permission to log out in combat    bool canLogoutInCombat = GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING);    uint32 reason = 0;    if (GetPlayer()->IsInCombat() && !canLogoutInCombat)        reason = 1;    else if (GetPlayer()->IsFalling())        reason = 3;                                         // is jumping or falling    else if (GetPlayer()->duel || GetPlayer()->HasAura(9454)) // is dueling or frozen by GM via freeze command        reason = 2;                                         // FIXME - Need the correct value    WorldPackets::Character::LogoutResponse logoutResponse;    logoutResponse.LogoutResult = reason;    logoutResponse.Instant = instantLogout;    SendPacket(logoutResponse.Write());    if (reason)    {        SetLogoutStartTime(0);        return;    }    // instant logout in taverns/cities or on taxi or for admins, gm's, mod's if its enabled in worldserver.conf    if (instantLogout)    {        LogoutPlayer(true);        return;    }    // not set flags if player can't free move to prevent lost state at logout cancel    if (GetPlayer()->CanFreeMove())    {        if (GetPlayer()->GetStandState() == UNIT_STAND_STATE_STAND)            GetPlayer()->SetStandState(UNIT_STAND_STATE_SIT);        GetPlayer()->SetRooted(true);        GetPlayer()->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);    }    SetLogoutStartTime(time(NULL));}
开发者ID:beyourself,项目名称:DeathCore_6.x,代码行数:49,


示例10: GetSecurity

void WorldSession::HandleLogoutRequestOpcode( WorldPacket & /*recv_data*/ ){    sLog.outDebug( "WORLD: Recvd CMSG_LOGOUT_REQUEST Message, security - %u", GetSecurity() );    if (uint64 lguid = GetPlayer()->GetLootGUID())        DoLootRelease(lguid);    //Can not logout if...    if( GetPlayer()->isInCombat() ||                        //...is in combat        GetPlayer()->duel         ||                        //...is in Duel                                                            //...is jumping ...is falling        GetPlayer()->HasUnitMovementFlag(MOVEMENTFLAG_JUMPING | MOVEMENTFLAG_FALLING))    {        WorldPacket data( SMSG_LOGOUT_RESPONSE, (2+4) ) ;        data << (uint8)0xC;        data << uint32(0);        data << uint8(0);        SendPacket( &data );        LogoutRequest(0);        return;    }    //instant logout in taverns/cities or on taxi or for admins, gm's, mod's if its enabled in mangosd.conf    if (GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) || GetPlayer()->isInFlight() ||        GetSecurity() >= sWorld.getConfig(CONFIG_INSTANT_LOGOUT))    {        LogoutPlayer(true);        return;    }    // not set flags if player can't free move to prevent lost state at logout cancel    if(GetPlayer()->CanFreeMove())    {        GetPlayer()->SetStandState(PLAYER_STATE_SIT);        WorldPacket data( SMSG_FORCE_MOVE_ROOT, (8+4) );    // guess size        data.append(GetPlayer()->GetPackGUID());        data << (uint32)2;        SendPacket( &data );        GetPlayer()->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_ROTATE);    }    WorldPacket data( SMSG_LOGOUT_RESPONSE, 5 );    data << uint32(0);    data << uint8(0);    SendPacket( &data );    LogoutRequest(time(NULL));}
开发者ID:Ediger,项目名称:mangos,代码行数:48,


示例11: DoLootRelease

void WorldSession::HandleLootReleaseOpcode(WorldPacket& recvData){    sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_LOOT_RELEASE");    // cheaters can modify lguid to prevent correct apply loot release code and re-loot    // use internal stored guid    ObjectGuid guid;    uint8 bitOrder[8] = { 7, 5, 1, 3, 4, 0, 2, 6 };    recvData.ReadBitInOrder(guid, bitOrder);    recvData.FlushBits();    uint8 byteOrder[8] = { 5, 6, 3, 1, 7, 0, 2, 4 };    recvData.ReadBytesSeq(guid, byteOrder);    if (uint64 lguid = GetPlayer()->GetLootGUID())        if (lguid == guid)            DoLootRelease(lguid);}
开发者ID:Cailiaock,项目名称:5.4.7-Wow-source,代码行数:20,


示例12: DoLootRelease

void WorldSession::HandleLootReleaseOpcode(WorldPacket & recv_data){	sLog->outError("StoreLootItem4");    sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_LOOT_RELEASE");    // cheaters can modify lguid to prevent correct apply loot release code and re-loot    // use internal stored guid    uint64 guid;	recv_data >> guid;	if (Player* player = GetPlayer())		if (TransmogEngine::IsActiveInterface(guid))		{			if (Creature* creature = GetPlayer()->GetMap()->GetCreature(guid))				TransmogEngine::SendInterfaceClose(player, guid);			return;		}    if (uint64 lguid = GetPlayer()->GetLootGUID())		if (lguid == guid)        DoLootRelease(lguid);}
开发者ID:Laintime,项目名称:BattleArenas,代码行数:23,


示例13: while

/// %Log the player outvoid WorldSession::LogoutPlayer(bool Save){    // finish pending transfers before starting the logout    while (_player && _player->IsBeingTeleportedFar())        HandleMoveWorldportAckOpcode();    m_playerLogout = true;    m_playerSave = Save;    if (_player)    {        if (uint64 lguid = GetPlayer()->GetLootGUID())            DoLootRelease(lguid);        ///- If the player just died before logging out, make him appear as a ghost        //FIXME: logout must be delayed in case lost connection with client in time of combat        if (_player->GetDeathTimer())        {            _player->getHostileRefManager().deleteReferences();            _player->BuildPlayerRepop();            _player->RepopAtGraveyard();        }        else if (!_player->getAttackers().empty())        {            _player->CombatStop();            _player->getHostileRefManager().setOnlineOfflineState(false);            _player->RemoveAllAurasOnDeath();            // build set of player who attack _player or who have pet attacking of _player            std::set<Player*> aset;            for (Unit::AttackerSet::const_iterator itr = _player->getAttackers().begin(); itr != _player->getAttackers().end(); ++itr)            {                Unit* owner = (*itr)->GetOwner();           // including player controlled case                if (owner && owner->GetTypeId() == TYPEID_PLAYER)                    aset.insert(owner->ToPlayer());                else if ((*itr)->GetTypeId() == TYPEID_PLAYER)                    aset.insert((Player*)(*itr));            }            _player->SetPvPDeath(!aset.empty());            _player->KillPlayer();            _player->BuildPlayerRepop();            _player->RepopAtGraveyard();            // give honor to all attackers from set like group case            for (std::set<Player*>::const_iterator itr = aset.begin(); itr != aset.end(); ++itr)                (*itr)->RewardHonor(_player, aset.size());            // give bg rewards and update counters like kill by first from attackers            // this can't be called for all attackers.            if (!aset.empty())                if (Battleground* bg = _player->GetBattleground())                    bg->HandleKillPlayer(_player, *aset.begin());        }        else if (_player->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))        {            // this will kill character by SPELL_AURA_SPIRIT_OF_REDEMPTION            _player->RemoveAurasByType(SPELL_AURA_MOD_SHAPESHIFT);            _player->KillPlayer();            _player->BuildPlayerRepop();            _player->RepopAtGraveyard();        }        else if (_player->HasPendingBind())        {            _player->RepopAtGraveyard();            _player->SetPendingBind(0, 0);        }        //drop a flag if player is carrying it        if (Battleground* bg = _player->GetBattleground())            bg->EventPlayerLoggedOut(_player);        ///- Teleport to home if the player is in an invalid instance        if (!_player->m_InstanceValid && !_player->isGameMaster())            _player->TeleportTo(_player->m_homebindMapId, _player->m_homebindX, _player->m_homebindY, _player->m_homebindZ, _player->GetOrientation());        sOutdoorPvPMgr->HandlePlayerLeaveZone(_player, _player->GetZoneId());        for (int i=0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; ++i)        {            if (BattlegroundQueueTypeId bgQueueTypeId = _player->GetBattlegroundQueueTypeId(i))            {                _player->RemoveBattlegroundQueueId(bgQueueTypeId);                sBattlegroundMgr->m_BattlegroundQueues[ bgQueueTypeId ].RemovePlayer(_player->GetGUID(), true);            }        }        // Repop at GraveYard or other player far teleport will prevent saving player because of not present map        // Teleport player immediately for correct player save        while (_player->IsBeingTeleportedFar())            HandleMoveWorldportAckOpcode();        ///- If the player is in a guild, update the guild roster and broadcast a logout message to other guild members        if (Guild* guild = sGuildMgr->GetGuildById(_player->GetGuildId()))            guild->HandleMemberLogout(this);        ///- Remove pet        _player->RemovePet(NULL, PET_SAVE_AS_CURRENT, true);//.........这里部分代码省略.........
开发者ID:Arthus,项目名称:TrinityCore,代码行数:101,


示例14: DEBUG_LOG

void WorldSession::HandleLogoutRequestOpcode( WorldPacket & /*recv_data*/ ){    DEBUG_LOG( "WORLD: Recvd CMSG_LOGOUT_REQUEST Message, security - %u", GetSecurity() );    if (ObjectGuid lootGuid = GetPlayer()->GetLootGuid())        DoLootRelease(lootGuid);	uint8 reason = 0;	Player* plr = GetPlayer();	if (!plr)	{		LogoutPlayer(false);		return;	}	if (plr->isInCombat())		reason = 1;	else if (plr->m_movementInfo.HasMovementFlag(MovementFlags(MOVEFLAG_FALLING | MOVEFLAG_FALLINGFAR))) // is jumping or falling		reason = 3;	else if (plr->duel || plr->HasAura(9454)) // is dueling or frozen by GM via freeze command		reason = 2;	if (reason)    {        WorldPacket data( SMSG_LOGOUT_RESPONSE, 1+4 ) ;		data << reason;        data << uint32(0);        SendPacket( &data );        LogoutRequest(0);        return;    }    //instant logout in taverns/cities or on taxi or for admins, gm's, mod's if its enabled in mangosd.conf    if (GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) || GetPlayer()->IsTaxiFlying() ||        GetSecurity() >= (AccountTypes)sWorld.getConfig(CONFIG_UINT32_INSTANT_LOGOUT))	{		WorldPacket data(SMSG_LOGOUT_RESPONSE, 1 + 4);		data << reason;		data << uint32(16777216);		SendPacket(&data);        LogoutPlayer(true);        return;    }    // not set flags if player can't free move to prevent lost state at logout cancel	if (GetPlayer()->CanFreeMove())	{		float height = GetPlayer()->GetMap()->GetHeight(GetPlayer()->GetPositionX(), GetPlayer()->GetPositionY(), GetPlayer()->GetPositionZ());		if ((GetPlayer()->GetPositionZ() < height + 0.1f) && !(GetPlayer()->IsInWater()))			GetPlayer()->SetStandState(UNIT_STAND_STATE_SIT);		GetPlayer()->SetRoot(true);		GetPlayer()->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);	}	WorldPacket data(SMSG_LOGOUT_RESPONSE, 1 + 4);	data << uint8(0);    data << uint32(0);    SendPacket( &data );    LogoutRequest(time(NULL));}
开发者ID:yyhhrr,项目名称:mangospriv,代码行数:61,


示例15: LogoutPlayerBot

/// %Log the player outvoid WorldSession::LogoutPlayer(bool Save){	if (!_player) return;	if (_player->IsMounted()) _player->Unmount();	// PlayerBot mod: log out all playerbots owned by this character	//while(!m_playerBots.empty())	//	LogoutPlayerBot(m_playerBots.begin()->first, Save);	PlayerBotMap m_pBots;	uint8 m_botCount = 0;	for(PlayerBotMap::const_iterator itr = GetPlayerBotsBegin(); itr != GetPlayerBotsEnd(); ++itr)	{		Player *bot = itr->second;		(m_pBots)[itr->first] = bot;		++m_botCount;	}	// Create a solo bind for player if player is currently in group in instance with all bots	Group *m_Group = _player->GetGroup();	bool rebound = false;	if(m_botCount > 0 && m_Group && m_botCount == m_Group->GetMembersCount()-1)		if (InstanceSave *save = sInstanceSaveManager.GetInstanceSave(_player->GetInstanceId()))		{			_player->BindToInstance(save, false);			save->SetCanReset(false);			rebound = true;		}	for(PlayerBotMap::const_iterator itr2 = m_pBots.begin(); itr2 != m_pBots.end(); ++itr2)	{		Player *botPlayer = itr2->second;		if (!botPlayer) continue;		LogoutPlayerBot(botPlayer->GetGUID(), Save);	}	if (rebound)		_player->m_InstanceValid = true;    // finish pending transfers before starting the logout    while (_player && _player->IsBeingTeleportedFar())        HandleMoveWorldportAckOpcode();    m_playerLogout = true;    m_playerSave = Save;    if (_player)    {        sLFGMgr.Leave(_player);        GetPlayer()->GetSession()->SendLfgUpdateParty(LFG_UPDATETYPE_REMOVED_FROM_QUEUE);        GetPlayer()->GetSession()->SendLfgUpdatePlayer(LFG_UPDATETYPE_REMOVED_FROM_QUEUE);        GetPlayer()->GetSession()->SendLfgUpdateSearch(false);        if (uint64 lguid = GetPlayer()->GetLootGUID())            DoLootRelease(lguid);        ///- If the player just died before logging out, make him appear as a ghost        //FIXME: logout must be delayed in case lost connection with client in time of combat        if (_player->GetDeathTimer())        {            _player->getHostileRefManager().deleteReferences();            _player->BuildPlayerRepop();            _player->RepopAtGraveyard();        }        else if (!_player->getAttackers().empty())        {            _player->CombatStop();            _player->getHostileRefManager().setOnlineOfflineState(false);            _player->RemoveAllAurasOnDeath();            // build set of player who attack _player or who have pet attacking of _player            std::set<Player*> aset;            for (Unit::AttackerSet::const_iterator itr = _player->getAttackers().begin(); itr != _player->getAttackers().end(); ++itr)            {                Unit* owner = (*itr)->GetOwner();           // including player controlled case                if (owner)                {                    if (owner->GetTypeId() == TYPEID_PLAYER)              aset.insert(owner->ToPlayer());                }                else                if ((*itr)->GetTypeId() == TYPEID_PLAYER)                    aset.insert((Player*)(*itr));            }            _player->SetPvPDeath(!aset.empty());            _player->KillPlayer();            _player->BuildPlayerRepop();            _player->RepopAtGraveyard();            // give honor to all attackers from set like group case            for (std::set<Player*>::const_iterator itr = aset.begin(); itr != aset.end(); ++itr)                (*itr)->RewardHonor(_player,aset.size());            // give bg rewards and update counters like kill by first from attackers            // this can't be called for all attackers.            if (!aset.empty())                if (BattleGround *bg = _player->GetBattleGround())//.........这里部分代码省略.........
开发者ID:Mferrill,项目名称:BotCore,代码行数:101,


示例16: while

// Log the player outvoid WorldSession::LogoutPlayer(bool Save){    // finish pending transfers before starting the logout    while (_player && _player->IsBeingTeleportedFar())        HandleMoveWorldportAckOpcode();    m_playerLogout = true;    m_playerSave = Save;    if (_player)    {        if (uint64 lguid = GetPlayer()->GetLootGUID())            DoLootRelease(lguid);        // If the player just died before logging out, make him appear as a ghost        // FIXME: logout must be delayed in case lost connection with client in time of combat        if (_player->GetDeathTimer())        {            _player->getHostileRefManager().deleteReferences();            _player->BuildPlayerRepop();            _player->RepopAtGraveyard();        }        else if (!_player->getAttackers().empty())        {            _player->CombatStop();            _player->getHostileRefManager().setOnlineOfflineState(false);            _player->RemoveAllAurasOnDeath();            // build set of player who attack _player or who have pet attacking of _player            std::set<Player*> aset;            for (Unit::AttackerSet::const_iterator itr = _player->getAttackers().begin(); itr != _player->getAttackers().end(); ++itr)            {                Unit* owner = (*itr)->GetOwner();           // including player controlled case                if (owner)                {                    if (owner->GetTypeId() == TYPEID_PLAYER)                        aset.insert(owner->ToPlayer());                }                else                if ((*itr)->GetTypeId() == TYPEID_PLAYER)                    aset.insert((*itr)->ToPlayer());            }            _player->SetPvPDeath(!aset.empty());            _player->KillPlayer();            _player->BuildPlayerRepop();            _player->RepopAtGraveyard();            // give honor to all attackers from set like group case            for (std::set<Player*>::const_iterator itr = aset.begin(); itr != aset.end(); ++itr)                (*itr)->RewardHonor(_player,aset.size());            // give bg rewards and update counters like kill by first from attackers            // this can't be called for all attackers.            if (!aset.empty())                if (BattleGround* bg = _player->GetBattleGround())                    bg->HandleKillPlayer(_player,*aset.begin());        }        else if (_player->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))        {            // this will kill character by SPELL_AURA_SPIRIT_OF_REDEMPTION            _player->RemoveSpellsCausingAura(SPELL_AURA_MOD_SHAPESHIFT);            //_player->SetDeathPvP(*); set at SPELL_AURA_SPIRIT_OF_REDEMPTION apply time            _player->KillPlayer();            _player->BuildPlayerRepop();            _player->RepopAtGraveyard();        }        //drop a flag if player is carrying it        if (BattleGround* bg = _player->GetBattleGround())            bg->EventPlayerLoggedOut(_player);        // Teleport to home if the player is in an invalid instance        if (!_player->m_InstanceValid && !_player->isGameMaster())        {            _player->TeleportToHomebind();            //this is a bad place to call for far teleport because we need player to be in world for successful logout            //maybe we should implement delayed far teleport logout?        }        // FG: finish pending transfers after starting the logout        // this should fix players beeing able to logout and login back with full hp at death position        while (_player->IsBeingTeleportedFar())            HandleMoveWorldportAckOpcode();        sOutdoorPvPMgr.HandlePlayerLeaveZone(_player,_player->GetZoneId());        for (int i=0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; ++i)        {            if (int32 bgTypeId = _player->GetBattleGroundQueueId(i))            {                _player->RemoveBattleGroundQueueId(bgTypeId);                sBattleGroundMgr.m_BattleGroundQueues[ bgTypeId ].RemovePlayer(_player->GetGUID(), true);            }        }        // If the player is in a guild, update the guild roster and broadcast a logout message to other guild members        if (Guild *guild = objmgr.GetGuildById(_player->GetGuildId()))        {            guild->LoadPlayerStatsByGuid(_player->GetGUID());//.........这里部分代码省略.........
开发者ID:Regolan,项目名称:blizzlikecore,代码行数:101,


示例17: while

/// %Log the player outvoid WorldSession::LogoutPlayer(bool Save){    // finish pending transfers before starting the logout    while(_player && _player->IsBeingTeleportedFar())        HandleMoveWorldportAckOpcode();    m_playerLogout = true;    m_playerSave = Save;    if (_player)    {        // Playerbot mod: log out all player bots owned by this toon        if (GetPlayer()->GetPlayerbotMgr())            GetPlayer()->GetPlayerbotMgr()->LogoutAllBots();        sLog.outChar("Account: %d (IP: %s) Logout Character:[%s] (guid: %u)", GetAccountId(), GetRemoteAddress().c_str(), _player->GetName() ,_player->GetGUIDLow());        if (ObjectGuid lootGuid = GetPlayer()->GetLootGuid())            DoLootRelease(lootGuid);        ///- If the player just died before logging out, make him appear as a ghost        //FIXME: logout must be delayed in case lost connection with client in time of combat        if (_player->GetDeathTimer())        {            _player->getHostileRefManager().deleteReferences();            _player->BuildPlayerRepop();            _player->RepopAtGraveyard();        }        else if (!_player->getAttackers().empty())        {            _player->CombatStop();            _player->getHostileRefManager().setOnlineOfflineState(false);            _player->RemoveAllAurasOnDeath();            // build set of player who attack _player or who have pet attacking of _player            std::set<Player*> aset;            for(Unit::AttackerSet::const_iterator itr = _player->getAttackers().begin(); itr != _player->getAttackers().end(); ++itr)            {                Unit* owner = (*itr)->GetOwner();           // including player controlled case                if(owner)                {                    if(owner->GetTypeId()==TYPEID_PLAYER)                        aset.insert((Player*)owner);                }                else if((*itr)->GetTypeId()==TYPEID_PLAYER)                    aset.insert((Player*)(*itr));            }            _player->SetPvPDeath(!aset.empty());            _player->KillPlayer();            _player->BuildPlayerRepop();            _player->RepopAtGraveyard();            // give honor to all attackers from set like group case            for(std::set<Player*>::const_iterator itr = aset.begin(); itr != aset.end(); ++itr)                (*itr)->RewardHonor(_player,aset.size());            // give bg rewards and update counters like kill by first from attackers            // this can't be called for all attackers.            if(!aset.empty())                if(BattleGround *bg = _player->GetBattleGround())                    bg->HandleKillPlayer(_player,*aset.begin());        }        else if(_player->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))        {            // this will kill character by SPELL_AURA_SPIRIT_OF_REDEMPTION            _player->RemoveSpellsCausingAura(SPELL_AURA_MOD_SHAPESHIFT);            //_player->SetDeathPvP(*); set at SPELL_AURA_SPIRIT_OF_REDEMPTION apply time            _player->KillPlayer();            _player->BuildPlayerRepop();            _player->RepopAtGraveyard();        }        else if (_player->HasPendingBind())        {            _player->RepopAtGraveyard();            _player->SetPendingBind(NULL, 0);        }        //drop a flag if player is carrying it        if(BattleGround *bg = _player->GetBattleGround())            bg->EventPlayerLoggedOut(_player);        ///- Teleport to home if the player is in an invalid instance        if(!_player->m_InstanceValid && !_player->isGameMaster())        {            _player->TeleportToHomebind();            //this is a bad place to call for far teleport because we need player to be in world for successful logout            //maybe we should implement delayed far teleport logout?        }        // FG: finish pending transfers after starting the logout        // this should fix players beeing able to logout and login back with full hp at death position        while(_player->IsBeingTeleportedFar())            HandleMoveWorldportAckOpcode();        for (int i=0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; ++i)        {            if(BattleGroundQueueTypeId bgQueueTypeId = _player->GetBattleGroundQueueTypeId(i))            {//.........这里部分代码省略.........
开发者ID:Seehub,项目名称:mangos,代码行数:101,


示例18: while

/// %Log the player outvoid WorldSession::LogoutPlayer(bool save){    // finish pending transfers before starting the logout    while (_player && _player->IsBeingTeleportedFar())        HandleMoveWorldportAckOpcode();    m_playerLogout = true;    m_playerSave = save;    if (_player)    {        if (uint64 lguid = _player->GetLootGUID())            DoLootRelease(lguid);        ///- If the player just died before logging out, make him appear as a ghost        //FIXME: logout must be delayed in case lost connection with client in time of combat        if (_player->GetDeathTimer())        {            _player->getHostileRefManager().deleteReferences();            _player->BuildPlayerRepop();            _player->RepopAtGraveyard();        }        else if (_player->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))        {            // this will kill character by SPELL_AURA_SPIRIT_OF_REDEMPTION            _player->RemoveAurasByType(SPELL_AURA_MOD_SHAPESHIFT);            _player->KillPlayer();            _player->BuildPlayerRepop();            _player->RepopAtGraveyard();        }        else if (_player->HasPendingBind())        {            _player->RepopAtGraveyard();            _player->SetPendingBind(0, 0);        }        //drop a flag if player is carrying it        if (Battleground* bg = _player->GetBattleground())            bg->EventPlayerLoggedOut(_player);        ///- Teleport to home if the player is in an invalid instance        if (!_player->m_InstanceValid && !_player->IsGameMaster())            _player->TeleportTo(_player->m_homebindMapId, _player->m_homebindX, _player->m_homebindY, _player->m_homebindZ, _player->GetOrientation());        sOutdoorPvPMgr->HandlePlayerLeaveZone(_player, _player->GetZoneId());        for (int i=0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; ++i)        {            if (BattlegroundQueueTypeId bgQueueTypeId = _player->GetBattlegroundQueueTypeId(i))            {                _player->RemoveBattlegroundQueueId(bgQueueTypeId);                BattlegroundQueue& queue = sBattlegroundMgr->GetBattlegroundQueue(bgQueueTypeId);                queue.RemovePlayer(_player->GetGUID(), true);            }        }        // Repop at GraveYard or other player far teleport will prevent saving player because of not present map        // Teleport player immediately for correct player save        while (_player->IsBeingTeleportedFar())            HandleMoveWorldportAckOpcode();        ///- If the player is in a guild, update the guild roster and broadcast a logout message to other guild members        if (Guild* guild = sGuildMgr->GetGuildById(_player->GetGuildId()))            guild->HandleMemberLogout(this);        ///- Remove pet        _player->RemovePet(NULL, PET_SAVE_AS_CURRENT, true);        ///- Clear whisper whitelist        _player->ClearWhisperWhiteList();        ///- empty buyback items and save the player in the database        // some save parts only correctly work in case player present in map/player_lists (pets, etc)        if (save)        {            uint32 eslot;            for (int j = BUYBACK_SLOT_START; j < BUYBACK_SLOT_END; ++j)            {                eslot = j - BUYBACK_SLOT_START;                _player->SetUInt64Value(PLAYER_FIELD_VENDORBUYBACK_SLOT_1 + (eslot * 2), 0);                _player->SetUInt32Value(PLAYER_FIELD_BUYBACK_PRICE_1 + eslot, 0);                _player->SetUInt32Value(PLAYER_FIELD_BUYBACK_TIMESTAMP_1 + eslot, 0);            }            _player->SaveToDB();        }        ///- Leave all channels before player delete...        _player->CleanupChannels();        ///- If the player is in a group (or invited), remove him. If the group if then only 1 person, disband the group.        _player->UninviteFromGroup();        // remove player from the group if he is:        // a) in group; b) not in raid group; c) logging out normally (not being kicked or disconnected)        if (_player->GetGroup() && !_player->GetGroup()->isRaidGroup() && m_Socket)            _player->RemoveFromGroup();        //! Send update to group and reset stored max enchanting level        if (_player->GetGroup())//.........这里部分代码省略.........
开发者ID:Viper2209,项目名称:Alive.TC.434,代码行数:101,


示例19: while

/// %Log the player outvoid WorldSession::LogoutPlayer(bool Save){    // fix exploit with Aura Bind Sight    _player->StopCastingBindSight();    _player->StopCastingCharm();    _player->RemoveAurasByType(SPELL_AURA_BIND_SIGHT);    // finish pending transfers before starting the logout    while (_player && _player->IsBeingTeleportedFar())        HandleMoveWorldportAckOpcode();    m_playerLogout = true;    m_playerSave = Save;    if (_player)    {        if (uint64 lguid = _player->GetLootGUID())            DoLootRelease(lguid);        ///- If the player just died before logging out, make him appear as a ghost        //FIXME: logout must be delayed in case lost connection with client in time of combat        if (_player->GetDeathTimer())        {            _player->getHostileRefManager().deleteReferences();            _player->BuildPlayerRepop();            _player->RepopAtGraveyard();        }        else if (!_player->getAttackers().empty())        {            // build set of player who attack _player or who have pet attacking of _player            std::set<Player*> aset;            for (Unit::AttackerSet::const_iterator itr = _player->getAttackers().begin(); itr != _player->getAttackers().end(); ++itr)            {                Unit* owner = (*itr)->GetOwner();           // including player controlled case                if (owner && owner->GetTypeId() == TYPEID_PLAYER)                    aset.insert(owner->ToPlayer());                else if ((*itr)->GetTypeId() == TYPEID_PLAYER)                    aset.insert((Player*)(*itr));            }            // CombatStop() method is removing all attackers from the AttackerSet            // That is why it must be AFTER building current set of attackers            _player->CombatStop();            _player->getHostileRefManager().setOnlineOfflineState(false);            _player->RemoveAllAurasOnDeath();            _player->SetPvPDeath(!aset.empty());            _player->KillPlayer();            _player->BuildPlayerRepop();            _player->RepopAtGraveyard();            // give honor to all attackers from set like group case            for (std::set<Player*>::const_iterator itr = aset.begin(); itr != aset.end(); ++itr)                (*itr)->RewardHonor(_player, aset.size());            // give bg rewards and update counters like kill by first from attackers            // this can't be called for all attackers.            if (!aset.empty())                if (Battleground* bg = _player->GetBattleground())                    bg->HandleKillPlayer(_player, *aset.begin());        }        else if (_player->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))        {            // this will kill character by SPELL_AURA_SPIRIT_OF_REDEMPTION            _player->RemoveAurasByType(SPELL_AURA_MOD_SHAPESHIFT);            _player->KillPlayer();            _player->BuildPlayerRepop();            _player->RepopAtGraveyard();        }        else if (_player->HasPendingBind())        {            _player->RepopAtGraveyard();            _player->SetPendingBind(0, 0);        }        else if (_player->GetVehicleBase() && _player->isInCombat())        {            _player->KillPlayer();            _player->BuildPlayerRepop();            _player->RepopAtGraveyard();        }        else if (_player->isInCombat() && sWorld->getIntConfig(CONFIG_GAME_TYPE) == REALM_TYPE_NORMAL && _player->IsPvP())        {            _player->KillPlayer();            _player->BuildPlayerRepop();            _player->RepopAtGraveyard();        }        //drop a flag if player is carrying it        if (Battleground* bg = _player->GetBattleground())            bg->EventPlayerLoggedOut(_player);        ///- Teleport to home if the player is in an invalid instance        if (!_player->m_InstanceValid && !_player->isGameMaster())            _player->TeleportTo(_player->m_homebindMapId, _player->m_homebindX, _player->m_homebindY, _player->m_homebindZ, _player->GetOrientation());        sOutdoorPvPMgr->HandlePlayerLeaveZone(_player, _player->GetZoneId());        for (int i=0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; ++i)        {            if (BattlegroundQueueTypeId bgQueueTypeId = _player->GetBattlegroundQueueTypeId(i))//.........这里部分代码省略.........
开发者ID:Expery,项目名称:Core,代码行数:101,


示例20: while

/// %Log the player outvoid WorldSession::LogoutPlayer(bool Save){    // finish pending transfers before starting the logout    while(_player && _player->IsBeingTeleported())        HandleMoveWorldportAckOpcode();    m_playerLogout = true;    if (_player)    {        if (uint64 lguid = GetPlayer()->GetLootGUID())            DoLootRelease(lguid);        ///- If the player just died before logging out, make him appear as a ghost        //FIXME: logout must be delayed in case lost connection with client in time of combat        if (_player->GetDeathTimer())        {            _player->getHostilRefManager().deleteReferences();            _player->BuildPlayerRepop();            _player->RepopAtGraveyard();        }        else if (!_player->getAttackers().empty())        {            _player->CombatStop();            _player->getHostilRefManager().setOnlineOfflineState(false);            _player->RemoveAllAurasOnDeath();            // build set of player who attack _player or who have pet attacking of _player            std::set<Player*> aset;            for(Unit::AttackerSet::const_iterator itr = _player->getAttackers().begin(); itr != _player->getAttackers().end(); ++itr)            {                Unit* owner = (*itr)->GetOwner();           // including player controlled case                if(owner)                {                    if(owner->GetTypeId()==TYPEID_PLAYER)                        aset.insert((Player*)owner);                }                else                if((*itr)->GetTypeId()==TYPEID_PLAYER)                    aset.insert((Player*)(*itr));            }            _player->SetPvPDeath(!aset.empty());            _player->KillPlayer();            _player->BuildPlayerRepop();            _player->RepopAtGraveyard();            // give honor to all attackers from set like group case            for(std::set<Player*>::const_iterator itr = aset.begin(); itr != aset.end(); ++itr)                (*itr)->RewardHonor(_player,aset.size());            // give bg rewards and update counters like kill by first from attackers            // this can't be called for all attackers.            if(!aset.empty())                if(BattleGround *bg = _player->GetBattleGround())                    bg->HandleKillPlayer(_player,*aset.begin());        }        else if(_player->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))        {            // this will kill character by SPELL_AURA_SPIRIT_OF_REDEMPTION            _player->RemoveSpellsCausingAura(SPELL_AURA_MOD_SHAPESHIFT);            //_player->SetDeathPvP(*); set at SPELL_AURA_SPIRIT_OF_REDEMPTION apply time            _player->KillPlayer();            _player->BuildPlayerRepop();            _player->RepopAtGraveyard();        }        //drop a flag if player is carrying it        if(BattleGround *bg = _player->GetBattleGround())            bg->EventPlayerLoggedOut(_player);        ///- Teleport to home if the player is in an invalid instance        if(!_player->m_InstanceValid && !_player->isGameMaster())            _player->TeleportTo(_player->m_homebindMapId, _player->m_homebindX, _player->m_homebindY, _player->m_homebindZ, _player->GetOrientation());        for (int i=0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; i++)        {            if(BattleGroundQueueTypeId bgQueueTypeId = _player->GetBattleGroundQueueTypeId(i))            {                _player->RemoveBattleGroundQueueId(bgQueueTypeId);                sBattleGroundMgr.m_BattleGroundQueues[ bgQueueTypeId ].RemovePlayer(_player->GetGUID(), true);            }        }        ///- Reset the online field in the account table        // no point resetting online in character table here as Player::SaveToDB() will set it to 1 since player has not been removed from world at this stage        //No SQL injection as AccountID is uint32        loginDatabase.PExecute("UPDATE account SET online = 0 WHERE id = '%u'", GetAccountId());        ///- If the player is in a guild, update the guild roster and broadcast a logout message to other guild members        Guild *guild = objmgr.GetGuildById(_player->GetGuildId());        if(guild)        {            guild->LoadPlayerStatsByGuid(_player->GetGUID());            guild->UpdateLogoutTime(_player->GetGUID());            WorldPacket data(SMSG_GUILD_EVENT, (1+1+12+8)); // name limited to 12 in character table.            data<<(uint8)GE_SIGNED_OFF;            data<<(uint8)1;            data<<_player->GetName();//.........这里部分代码省略.........
开发者ID:801616,项目名称:mangos,代码行数:101,


示例21: while

/// %Log the player outvoid WorldSession::LogoutPlayer(bool save){    // finish pending transfers before starting the logout    while (_player && _player->IsBeingTeleportedFar())        HandleMoveWorldportAckOpcode();    m_playerLogout = true;    m_playerSave = save;    if (_player)    {        if (uint64 lguid = _player->GetLootGUID())            DoLootRelease(lguid);        ///- If the player just died before logging out, make him appear as a ghost        //FIXME: logout must be delayed in case lost connection with client in time of combat        if (_player->GetDeathTimer())        {            _player->getHostileRefManager().deleteReferences();            _player->BuildPlayerRepop();            _player->RepopAtGraveyard();        }        else if (_player->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))        {            // this will kill character by SPELL_AURA_SPIRIT_OF_REDEMPTION            _player->RemoveAurasByType(SPELL_AURA_MOD_SHAPESHIFT);            _player->KillPlayer();            _player->BuildPlayerRepop();            _player->RepopAtGraveyard();        }        else if (_player->HasPendingBind())        {            _player->RepopAtGraveyard();            _player->SetPendingBind(0, 0);        }        // pussywizard: leave whole bg on logout (character stays ingame when necessary)        // pussywizard: GetBattleground() checked inside        _player->LeaveBattleground();        // pussywizard: checked first time        if (!_player->IsBeingTeleportedFar() && !_player->m_InstanceValid && !_player->IsGameMaster())            _player->RepopAtGraveyard();        sOutdoorPvPMgr->HandlePlayerLeaveZone(_player, _player->GetZoneId());        // pussywizard: remove from battleground queues on logout        for (int i=0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; ++i)            if (BattlegroundQueueTypeId bgQueueTypeId = _player->GetBattlegroundQueueTypeId(i))            {                _player->RemoveBattlegroundQueueId(bgQueueTypeId);                sBattlegroundMgr->GetBattlegroundQueue(bgQueueTypeId).RemovePlayer(_player->GetGUID(), false, i);                // track if player logs out after invited to join BG                if(_player->IsInvitedForBattlegroundInstance() && sWorld->getBoolConfig(CONFIG_BATTLEGROUND_TRACK_DESERTERS))                {                    PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_DESERTER_TRACK);                    stmt->setUInt32(0, _player->GetGUIDLow());                    stmt->setUInt8(1, BG_DESERTION_TYPE_INVITE_LOGOUT);                    CharacterDatabase.Execute(stmt);                }            }        ///- If the player is in a guild, update the guild roster and broadcast a logout message to other guild members        if (Guild* guild = sGuildMgr->GetGuildById(_player->GetGuildId()))            guild->HandleMemberLogout(this);        ///- Remove pet        _player->RemovePet(NULL, PET_SAVE_AS_CURRENT);        // pussywizard: on logout remove auras that are removed at map change (before saving to db)        // there are some positive auras from boss encounters that can be kept by logging out and logging in after boss is dead, and may be used on next bosses        _player->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_CHANGE_MAP);        ///- If the player is in a group (or invited), remove him. If the group if then only 1 person, disband the group.        _player->UninviteFromGroup();        // remove player from the group if he is:        // a) in group; b) not in raid group; c) logging out normally (not being kicked or disconnected)        if (_player->GetGroup() && !_player->GetGroup()->isRaidGroup() && !_player->GetGroup()->isLFGGroup() && m_Socket)            _player->RemoveFromGroup();        // pussywizard: checked second time after being removed from a group        if (!_player->IsBeingTeleportedFar() && !_player->m_InstanceValid && !_player->IsGameMaster())            _player->RepopAtGraveyard();        // Repop at GraveYard or other player far teleport will prevent saving player because of not present map        // Teleport player immediately for correct player save        while (_player && _player->IsBeingTeleportedFar())            HandleMoveWorldportAckOpcode();        ///- empty buyback items and save the player in the database        // some save parts only correctly work in case player present in map/player_lists (pets, etc)        SavingSystemMgr::InsertToSavingSkipListIfNeeded(_player->GetNextSave()); // pussywizard        if (save)        {            uint32 eslot;            for (int j = BUYBACK_SLOT_START; j < BUYBACK_SLOT_END; ++j)            {                eslot = j - BUYBACK_SLOT_START;//.........这里部分代码省略.........
开发者ID:lineagedr,项目名称:azerothcore-wotlk,代码行数:101,



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


C++ DoMeleeAttackIfReady函数代码示例
C++ DoLayout函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。