Lopaskurwa
Active Member
- Joined
- Oct 6, 2017
- Messages
- 873
- Solutions
- 2
- Reaction score
- 49
Hey
having weird issue so after reaching x amount of kills that are set in config if they pass daily frag limit or week or month they get banned but instead it just kicks them out and removes red skull aswell so its fucked up, pretty sure its this code
having weird issue so after reaching x amount of kills that are set in config if they pass daily frag limit or week or month they get banned but instead it just kicks them out and removes red skull aswell so its fucked up, pretty sure its this code
Code:
if (getPeriodKills(1) >= g_config.getNumber(ConfigManager::KILLS_DAY_BANISHMENT) || getPeriodKills(7) >= g_config.getNumber(ConfigManager::KILLS_WEEK_BANISHMENT) || getPeriodKills(30) >= g_config.getNumber(ConfigManager::KILLS_MONTH_BANISHMENT)) {
Database* db = Database::getInstance();
std::ostringstream ss;
ss << "INSERT INTO `account_bans` (`account_id`, `reason`, `banned_at`, `expires_at`, `banned_by`) VALUES (";
ss << getAccount() << ", ";
ss << db->escapeString("Too many unjustified kills") << ", ";
ss << std::time(nullptr) << ", ";
ss << std::time(nullptr) + g_config.getNumber(ConfigManager::BAN_LENGTH) << ", ";
ss << "1);";
db->executeQuery(ss.str());
g_game.addMagicEffect(getPosition(), CONST_ME_GREEN_RINGS);
g_game.removeCreature(this);
disconnect();
}
}