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


C++ Battlefield类代码示例

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


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

示例1: HandleBattlefieldTimer

    static bool HandleBattlefieldTimer(ChatHandler* handler, const char* args)
    {
        uint32 battleid = 0;
        uint32 time = 0;
        char* battleid_str = strtok((char*)args, " ");
        if (!battleid_str)
            return false;
        char* time_str = strtok(NULL, " ");
        if (!time_str)
            return false;

        battleid = atoi(battleid_str);

        time = atoi(time_str);

        Battlefield* bf = sBattlefieldMgr->GetBattlefieldByBattleId(battleid);

        if (!bf)
            return false;

        bf->SetTimer(time * IN_MILLISECONDS);
        bf->SendInitWorldStatesToAll();
        if (battleid == 1)
            handler->SendGlobalGMSysMessage("Wintergrasp (Command timer used)");

        return true;
    }
开发者ID:AvariusProject,项目名称:AvariusCore,代码行数:27,代码来源:cs_bf.cpp

示例2: TC_LOG_ERROR

//Send by client on clicking in accept or refuse of invitation windows for join game
void WorldSession::HandleBfEntryInviteResponse(WorldPacket& recvData)
{
    uint8 accepted;
    ObjectGuid guid;

    guid[0] = recvData.ReadBit();
    guid[7] = recvData.ReadBit();
    accepted = recvData.ReadBit();
    guid[4] = recvData.ReadBit();
    guid[3] = recvData.ReadBit();
    guid[1] = recvData.ReadBit();
    guid[6] = recvData.ReadBit();
    guid[2] = recvData.ReadBit();
    guid[5] = recvData.ReadBit();

    recvData.ReadByteSeq(guid[1]);
    recvData.ReadByteSeq(guid[6]);
    recvData.ReadByteSeq(guid[2]);
    recvData.ReadByteSeq(guid[5]);
    recvData.ReadByteSeq(guid[3]);
    recvData.ReadByteSeq(guid[4]);
    recvData.ReadByteSeq(guid[7]);
    recvData.ReadByteSeq(guid[0]);

    TC_LOG_ERROR("misc", "HandleBattlefieldInviteResponse: GUID:"UI64FMTD" Accepted:%u", (uint64)guid, accepted);

    Battlefield* bf = sBattlefieldMgr->GetBattlefieldByGUID(guid);
    if (!bf)
        return;

    if (accepted)
        bf->PlayerAcceptInviteToWar(_player);
    else if (_player->GetZoneId() == bf->GetZoneId())
        bf->KickPlayerFromBattlefield(_player->GetGUID());
}
开发者ID:kenjilee,项目名称:SkyFire_5xx-1,代码行数:36,代码来源:BattlefieldHandler.cpp

示例3: BattlefieldWG

void BattlefieldMgr::InitBattlefield()
{
    Battlefield* wg = new BattlefieldWG();
    // respawn, init variables
    if (!wg->SetupBattlefield())
    {
        TC_LOG_INFO("bg.battlefield", "Battlefield: Wintergrasp init failed.");
        delete wg;
    }
    else
    {
        _battlefieldSet.push_back(wg);
        TC_LOG_INFO("bg.battlefield", "Battlefield: Wintergrasp successfully initiated.");
    }

    /*
    For Cataclysm: Tol Barad
    Battlefield* tb = new BattlefieldTB;
    // respawn, init variables
    if (!tb->SetupBattlefield())
    {
        TC_LOG_DEBUG("bg.battlefield", "Battlefield: Tol Barad init failed.");
        delete tb;
    }
    else
    {
        _battlefieldSet.push_back(tb);
        TC_LOG_DEBUG("bg.battlefield", "Battlefield: Tol Barad successfully initiated.");
    }
    */
}
开发者ID:Palabola,项目名称:WoD,代码行数:31,代码来源:BattlefieldMgr.cpp

示例4: InitBattlefield

void BattlefieldMgr::InitBattlefield()
{
    Battlefield* pBf = new BattlefieldWG;
    // respawn, init variables
    if (!pBf->SetupBattlefield())
    {
        sLog->outString();
        sLog->outString("Battlefield : Wintergrasp init failed.");
        delete pBf;
    }
    else
    {
        m_BattlefieldSet.push_back(pBf);
        sLog->outString();
        sLog->outString("Battlefield : Wintergrasp successfully initiated.");
    }

    /* For Cataclysm: Tol Barad
       pBf = new BattlefieldTB;
       // respawn, init variables
       if(!pBf->SetupBattlefield())
       {
       ;//sLog->outDebug(LOG_FILTER_BATTLEFIELD, "Battlefield : Tol Barad init failed.");
       delete pBf;
       }
       else
       {
       m_BattlefieldSet.push_back(pBf);
       ;//sLog->outDebug(LOG_FILTER_BATTLEFIELD, "Battlefield : Tol Barad successfully initiated.");
       } */
}
开发者ID:boom8866,项目名称:azerothcore-wotlk,代码行数:31,代码来源:BattlefieldMgr.cpp

示例5: TC_LOG_ERROR

//Send by client when he click on accept for queue
void WorldSession::HandleBfQueueInviteResponse(WorldPacket& recvData)
{
    uint8 accepted;
    ObjectGuid guid;

    guid[2] = recvData.ReadBit();
    guid[0] = recvData.ReadBit();
    guid[4] = recvData.ReadBit();
    guid[3] = recvData.ReadBit();
    guid[5] = recvData.ReadBit();
    guid[7] = recvData.ReadBit();
    accepted = recvData.ReadBit();
    guid[1] = recvData.ReadBit();
    guid[6] = recvData.ReadBit();

    recvData.ReadByteSeq(guid[1]);
    recvData.ReadByteSeq(guid[3]);
    recvData.ReadByteSeq(guid[2]);
    recvData.ReadByteSeq(guid[4]);
    recvData.ReadByteSeq(guid[6]);
    recvData.ReadByteSeq(guid[7]);
    recvData.ReadByteSeq(guid[0]);
    recvData.ReadByteSeq(guid[5]);

    TC_LOG_ERROR(LOG_FILTER_GENERAL, "HandleQueueInviteResponse: GUID:"UI64FMTD" Accepted:%u", (uint64)guid, accepted);

    Battlefield* bf = sBattlefieldMgr->GetBattlefieldByGUID(guid);
    if (!bf)
        return;

    if (accepted)
        bf->PlayerAcceptInviteToQueue(_player);
}
开发者ID:AnthoDevMoP,项目名称:Mists_of_pandaria_5.0.5_16135b,代码行数:34,代码来源:BattlefieldHandler.cpp

示例6: TC_LOG_ERROR

/**
 * @fn void WorldSession::HandleBfExitRequest(WorldPacket& recvData)
 *
 * @brief Send by client when exited battlefield
 */
void WorldSession::HandleBfExitRequest(WorldPacket& recvData)
{
    ObjectGuid guid;

    guid[2] = recvData.ReadBit();
    guid[0] = recvData.ReadBit();
    guid[3] = recvData.ReadBit();
    guid[7] = recvData.ReadBit();
    guid[4] = recvData.ReadBit();
    guid[5] = recvData.ReadBit();
    guid[6] = recvData.ReadBit();
    guid[1] = recvData.ReadBit();

    recvData.ReadByteSeq(guid[5]);
    recvData.ReadByteSeq(guid[2]);
    recvData.ReadByteSeq(guid[0]);
    recvData.ReadByteSeq(guid[1]);
    recvData.ReadByteSeq(guid[4]);
    recvData.ReadByteSeq(guid[3]);
    recvData.ReadByteSeq(guid[7]);
    recvData.ReadByteSeq(guid[6]);

    TC_LOG_ERROR("misc", "HandleBfExitRequest: GUID: %s", guid.ToString().c_str());

    Battlefield* bf = sBattlefieldMgr->GetBattlefieldByGUID(guid);
    if (!bf)
        return;

    bf->AskToLeaveQueue(_player);
}
开发者ID:DrYaling,项目名称:eluna-wod,代码行数:35,代码来源:BattlefieldHandler.cpp

示例7: OnConditionCheck

 bool OnConditionCheck(Condition const* /* condition */, ConditionSourceInfo& /* sourceInfo */)
 {
     Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG);
     if (wintergrasp->IsEnabled() && wintergrasp->GetDefenderTeam() == TEAM_ALLIANCE)
         return true;
     return false;
 }
开发者ID:fatalaim,项目名称:TrinityCore,代码行数:7,代码来源:zone_wintergrasp.cpp

示例8: HandleBattlefieldEnable

    static bool HandleBattlefieldEnable(ChatHandler* handler, const char* args)
    {
        uint32 battleid = 0;
        char* battleid_str = strtok((char*)args, " ");
        if (!battleid_str)
            return false;

        battleid = atoi(battleid_str);

        Battlefield* bf = sBattlefieldMgr->GetBattlefieldByBattleId(battleid);

        if (!bf)
            return false;

        if (bf->IsEnabled())
        {
            bf->ToggleBattlefield(false);
            if (battleid == 1)
                handler->SendGlobalGMSysMessage("Wintergrasp is disabled");
        }
        else
        {
            bf->ToggleBattlefield(true);
            if (battleid == 1)
                handler->SendGlobalGMSysMessage("Wintergrasp is enabled");
        }

        return true;
    }
开发者ID:AvariusProject,项目名称:AvariusCore,代码行数:29,代码来源:cs_bf.cpp

示例9: HandlePeriodicDummy

 void HandlePeriodicDummy(AuraEffect const*  /*aurEff*/)
 {
     Unit* target = GetTarget();
     Battlefield* Bf = sBattlefieldMgr->GetBattlefieldToZoneId(target->GetZoneId());
     bool enable = !Bf || !Bf->IsWarTime();
     target->SetPhaseMask(enable ? 1 : 512, true);
     PreventDefaultAction();
 }
开发者ID:Matt-One,项目名称:azerothcore-wotlk,代码行数:8,代码来源:zone_wintergrasp.cpp

示例10: OnCheck

    bool OnCheck(Player*  /*source*/, Unit*  /*target*/)
    {
        Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG);
        if (!wintergrasp)
            return false;

        return wintergrasp->GetTimer() >= (20 * MINUTE * IN_MILLISECONDS);
    }
开发者ID:Matt-One,项目名称:azerothcore-wotlk,代码行数:8,代码来源:zone_wintergrasp.cpp

示例11: HandleBfQueueExitRequest

/**
 * @fn void WorldSession::HandleBfExitRequest(WorldPackets::Battlefield::BFMgrQueueExitRequest& bfMgrQueueExitRequest)
 *
 * @brief Send by client when exited battlefield
 */
void WorldSession::HandleBfQueueExitRequest(WorldPackets::Battlefield::BFMgrQueueExitRequest& bfMgrQueueExitRequest)
{
    Battlefield* bf = sBattlefieldMgr->GetBattlefieldByQueueId(bfMgrQueueExitRequest.QueueID);
    if (!bf)
        return;

    bf->AskToLeaveQueue(_player);
}
开发者ID:Carbenium,项目名称:TrinityCore,代码行数:13,代码来源:BattlefieldHandler.cpp

示例12: HandleBfExitRequest

void WorldSession::HandleBfExitRequest(WorldPacket& recvData)
{
    sLog->outError(LOG_FILTER_GENERAL, "HandleBfExitRequest");

    Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(_player->GetZoneId());
    if (bf)
        bf->KickPlayerFromBattlefield(_player->GetGUID());
}
开发者ID:Expery,项目名称:Core,代码行数:8,代码来源:BattlefieldHandler.cpp

示例13: HandleBfQueueInviteResponse

/**
 * @fn void WorldSession::HandleBfQueueInviteResponse(WorldPackets::Battlefield::BFMgrQueueInviteResponse& bfMgrQueueInviteResponse)
 *
 * @brief Send by client when he click on accept for queue.
 */
void WorldSession::HandleBfQueueInviteResponse(WorldPackets::Battlefield::BFMgrQueueInviteResponse& bfMgrQueueInviteResponse)
{
    Battlefield* bf = sBattlefieldMgr->GetBattlefieldByQueueId(bfMgrQueueInviteResponse.QueueID);
    if (!bf)
        return;

    if (bfMgrQueueInviteResponse.AcceptedInvite)
        bf->PlayerAcceptInviteToQueue(_player);
}
开发者ID:Carbenium,项目名称:TrinityCore,代码行数:14,代码来源:BattlefieldHandler.cpp

示例14: HandleScript

            void HandleScript(SpellEffIndex effIndex)
            {
                PreventHitDefaultEffect(effIndex);
                Player* target = GetHitPlayer();
                Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG);
                if (!wintergrasp || !target || target->getLevel() < 75 || (wintergrasp->GetDefenderTeam() != target->GetTeamId()))
                    return;

                target->CastSpell(target, SPELL_TELEPORT_TO_FORTRESS, true);
            }
开发者ID:Matt-One,项目名称:azerothcore-wotlk,代码行数:10,代码来源:zone_wintergrasp.cpp

示例15: HandleBfExitRequest

void WorldSession::HandleBfExitRequest(WorldPacket & recv_data)
{
    uint32 BattleId;

    recv_data >> BattleId;
    sLog->outDebug(LOG_FILTER_BATTLEFIELD, "HandleBfExitRequest: BattleID:%u ", BattleId);
    Battlefield* Bf = sBattlefieldMgr->GetBattlefieldByBattleId(BattleId);
    if (!Bf)
        return;

    Bf->AskToLeaveQueue(_player);
}
开发者ID:DaShutok,项目名称:TrinityCore,代码行数:12,代码来源:BattlefieldHandler.cpp


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