Esempio n. 1
0
void BanExpiryHandler(boost::system::error_code const& error)
{
    if (!error)
    {
        LoginDatabase.Execute(LoginDatabase.GetPreparedStatement(LOGIN_DEL_EXPIRED_IP_BANS));
        LoginDatabase.Execute(LoginDatabase.GetPreparedStatement(LOGIN_UPD_EXPIRED_ACCOUNT_BANS));

        _banExpiryCheckTimer->expires_from_now(boost::posix_time::seconds(_banExpiryCheckInterval));
        _banExpiryCheckTimer->async_wait(BanExpiryHandler);
    }
}
Esempio n. 2
0
void Log::outDB(LogTypes type, const char * str)
{
    if (!str || type >= MAX_LOG_TYPES)
         return;

    std::string logStr(str);
    if (logStr.empty())
        return;
    PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_ADD_LOG);

    stmt->setInt32(0, realm);
    stmt->setInt32(1, type);
    stmt->setString(2, logStr);

    LoginDatabase.Execute(stmt);
}