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


C++ IntervalTimer::SetInterval方法代码示例

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


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

示例1: OnConfigLoad

    void OnConfigLoad(bool /*reload*/)
    {
        ExternalMail            = ConfigMgr::GetBoolDefault("ExternalMail", false);

        if (!ExternalMail)
            return;

        ExternalMailInterval    = ConfigMgr::GetIntDefault("ExternalMailInterval", 1);

        extmail_timer.SetInterval(ExternalMailInterval * MINUTE * IN_MILLISECONDS);
        extmail_timer.Reset();
    }
开发者ID:lemex,项目名称:TrinityNya,代码行数:12,代码来源:mod_ExternalMail.cpp

示例2: main


//.........这里部分代码省略.........
    {
        sLog.outError("No valid realms specified.");
        Log::WaitBeforeContinueIfNeed();
        return 1;
    }

    // cleanup query
    // set expired bans to inactive
    LoginDatabase.BeginTransaction();
    LoginDatabase.Execute("UPDATE account_banned SET active = 0 WHERE unbandate<=UNIX_TIMESTAMP() AND unbandate<>bandate");
    LoginDatabase.Execute("DELETE FROM ip_banned WHERE unbandate<=UNIX_TIMESTAMP() AND unbandate<>bandate");
    LoginDatabase.CommitTransaction();

    ///- Launch the listening network socket
    ACE_Acceptor<AuthSocket, ACE_SOCK_Acceptor> acceptor;

    uint16 rmport = sConfig.GetIntDefault("RealmServerPort", DEFAULT_REALMSERVER_PORT);
    std::string bind_ip = sConfig.GetStringDefault("BindIP", "0.0.0.0");

    ACE_INET_Addr bind_addr(rmport, bind_ip.c_str());

    if(acceptor.open(bind_addr, ACE_Reactor::instance(), ACE_NONBLOCK) == -1)
    {
        sLog.outError("MaNGOS realmd can not bind to %s:%d", bind_ip.c_str(), rmport);
        Log::WaitBeforeContinueIfNeed();
        return 1;
    }

    // FG: "bad points" system related
    uint32 badPointsDropInterval = sConfig.GetIntDefault("BadPoints.DropInterval", HOUR);
    uint32 badPointsDropAmount = sConfig.GetIntDefault("BadPoints.DropAmount", 1);
    uint32 badPointsDropWaitTime = sConfig.GetIntDefault("BadPoints.WaitTime", WEEK); 
    IntervalTimer badPointsTimer;
    badPointsTimer.SetInterval(badPointsDropInterval * IN_MILLISECONDS);

    ///- Catch termination signals
    HookSignals();

    ///- Handle affinity for multiple processors and process priority on Windows
    #ifdef WIN32
    {
        HANDLE hProcess = GetCurrentProcess();

        uint32 Aff = sConfig.GetIntDefault("UseProcessors", 0);
        if(Aff > 0)
        {
            ULONG_PTR appAff;
            ULONG_PTR sysAff;

            if(GetProcessAffinityMask(hProcess,&appAff,&sysAff))
            {
                ULONG_PTR curAff = Aff & appAff;            // remove non accessible processors

                if(!curAff )
                {
                    sLog.outError("Processors marked in UseProcessors bitmask (hex) %x not accessible for realmd. Accessible processors bitmask (hex): %x",Aff,appAff);
                }
                else
                {
                    if(SetProcessAffinityMask(hProcess,curAff))
                        sLog.outString("Using processors (bitmask, hex): %x", curAff);
                    else
                        sLog.outError("Can't set used processors (hex): %x", curAff);
                }
            }
            sLog.outString();
开发者ID:Wisznu,项目名称:mangos,代码行数:67,代码来源:Main.cpp

示例3: DonationScript

 DonationScript():WorldScript("DonationScript"){
     m_rewardTimer.SetCurrent(0);
     m_rewardTimer.SetInterval(30000);
 }
开发者ID:Nedj,项目名称:CG-Blizzlike,代码行数:4,代码来源:donations.cpp


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