TFS 1.2 / Nostalrius 7.72.
Good afternoon guys. After a Redskull kills 6 times (which would result in a temporary ban from the killer) on my server, I'm getting this error:
The killer simply disconnects, but is not banned as he should.
Does anyone know what I need to do in this case?
When I copied I received warnings. Can it be related?
TKS!
In my player.cpp I found:
Good afternoon guys. After a Redskull kills 6 times (which would result in a temporary ban from the killer) on my server, I'm getting this error:
Lua:
- [Error - mysql_real_query] Query: INSERT INTO account_bans (account_id, reason, banned_at, expires_at, banned_by) VALUES (24174074, 'Too many unjustified kills', 1608230975, 1608490175, 1);
2020-12-17 18:49:35 - Message: Cannot add or update a child row: a foreign key constraint fails (worldteste.account_bans, CONSTRAINT account_bans_ibfk_2 FOREIGN KEY (banned_by) REFERENCES players (id) ON DELETE CASCADE ON UPDATE CASCADE)
The killer simply disconnects, but is not banned as he should.
Does anyone know what I need to do in this case?
When I copied I received warnings. Can it be related?
TKS!
Post automatically merged:
In my player.cpp I found:
Lua:
// banishment for too many unjustified kills
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();
}
}
}
Last edited: