map初始化定時器

來源:互聯網
上載者:User

標籤:style   blog   color   os   ar   art   div   log   sp   

init_timer();    //各種定時器的初始化void Map::init_timer(){    //auto tf = GetPlug(TimerFactory);    auto tf = m_spTimerFactory;    m_updateMovePosTimer.reset(tf->createTimer());    m_updateMovePosTimer->setInterval(50);    m_updateMovePosTimer->regTimer(std::bind(&Map::updateMovePosTimer, this));//這個是最重要的定時跟新所有NCP的位置資訊,50ms是相當快的    m_updateMovePosTimer->start();    //單人組隊定時    m_updateTeamTimer.reset(tf->createTimer());    m_updateTeamTimer->setInterval(15 * 1000);    m_updateTeamTimer->regTimer(std::bind(&Map::updateTeamTimer, this));    m_updateTeamTimer->start();    //寶物限時消失    //m_checkPropExistTimer.reset(tf->createTimer());    //m_checkPropExistTimer->setInterval(10 * 6000);    //m_checkPropExistTimer->regTimer(std::bind(&Map::checkPropExistTimer, this));    ////m_checkPropExistTimer->start();    //定時器監視buff    m_updateStatTimer.reset(tf->createTimer());    m_updateStatTimer->setInterval(1000);    m_updateStatTimer->regTimer(std::bind(&Map::updateStatTimer, this));    m_updateStatTimer->start();    //壓測複活    m_checkRebornTimer.reset(tf->createTimer());    m_checkRebornTimer->setInterval(2000);    m_checkRebornTimer->regTimer(std::bind(&Map::checkRebornTimer, this));    m_checkRebornTimer->start();    //Item 消失    m_updateItemDisappearTimer.reset(tf->createTimer());    m_updateItemDisappearTimer->setInterval(2000);    m_updateItemDisappearTimer->regTimer(std::bind(&Map::updateItemDisappearTimer, this));    m_updateItemDisappearTimer->start();    //Spell消失(因玩家而定) + 施法    m_updateSpellWorkTimer.reset(tf->createTimer());    m_updateSpellWorkTimer->setInterval(500);    m_updateSpellWorkTimer->regTimer(std::bind(&Map::updateSpellWorkTimer, this));    m_updateSpellWorkTimer->start();}//-------------------這所有的定時器都是map線程驅動的--------------------------

 

map初始化定時器

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.