当前位置: 首页>>代码示例>>C++>>正文


C++ BattleGround::GetPlayerScoresBegin方法代码示例

本文整理汇总了C++中BattleGround::GetPlayerScoresBegin方法的典型用法代码示例。如果您正苦于以下问题:C++ BattleGround::GetPlayerScoresBegin方法的具体用法?C++ BattleGround::GetPlayerScoresBegin怎么用?C++ BattleGround::GetPlayerScoresBegin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BattleGround的用法示例。


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

示例1: HandleBattleGroundPVPlogdataOpcode

void WorldSession::HandleBattleGroundPVPlogdataOpcode( WorldPacket &recv_data )
{
    sLog.outDebug( "WORLD: Recvd MSG_PVP_LOG_DATA Message");

    if(!GetPlayer()->InBattleGround())
        return;

    BattleGround* bg = sBattleGroundMgr.GetBattleGround(GetPlayer()->GetBattleGroundId());
    if(!bg)
        return;

    WorldPacket data(MSG_PVP_LOG_DATA, (1+4+40*bg->GetPlayerScoresSize()));
    data << uint8(0x0);
    data << uint32(bg->GetPlayerScoresSize());

    for(std::map<uint64, BattleGroundScore>::iterator itr=bg->GetPlayerScoresBegin();itr!=bg->GetPlayerScoresEnd();++itr)
    {
        data << (uint64)itr->first;                         //8
        data << (uint32)itr->second.Rank;                   //4                    //Rank
        data << (uint32)itr->second.KillingBlows;           //4
        data << (uint32)itr->second.Deaths;                 //4
        data << (uint32)itr->second.HonorableKills;         //4
        data << (uint32)itr->second.DishonorableKills;      //4
        data << (uint32)itr->second.BonusHonor;             //4
        data << (uint32)0;
        data << (uint32)0;
        /*data << itr->second.Rank;
        data << itr->second.Unk1;
        data << itr->second.Unk2;
        data << itr->second.Unk3;
        data << itr->second.Unk4;*/
    }
    SendPacket(&data);

    sLog.outDebug( "WORLD: Send MSG_PVP_LOG_DATA Message players:%u", bg->GetPlayerScoresSize());

    //data << (uint8)0; ////Warsong Gulch
    /*data << (uint8)1; //
    data << (uint8)1; //

    //strangest thing 2 different
    data << (uint32)NumberofPlayers;
    for (uint8 i = 0; i < NumberofPlayers; i++)
    {
        data << (uint64)8;//GUID     //8
        data << (uint32)0;//rank
        data << (uint32)0;//killing blows
        data << (uint32)0;//honorable kills
        data << (uint32)0;//deaths
        data << (uint32)0;//Bonus Honor
        data << (uint32)0;//I think Instance
        data << (uint32)0;
        data << (uint32)0;            //8*4 = 32+8=40

        //1 player is 40 bytes
    }
    data.hexlike();
    SendPacket(&data);*/
}
开发者ID:Aion,项目名称:caldari,代码行数:59,代码来源:BattleGroundHandler.cpp


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