You can set this in config.luaHello
Is it possible to make anti kick system for TFS 1.3 client version 10.99?
Thx!
KICK_AFTER_MINUTES = 1440 -- (60 * 24 = 1440) 24 hours
/*
if (!getTile()->hasFlag(TILESTATE_NOLOGOUT) && !isAccessPlayer()) {
idleTime += interval;
const int32_t kickAfterMinutes = g_config.getNumber(ConfigManager::KICK_AFTER_MINUTES);
if (idleTime > (kickAfterMinutes * 60000) + 60000) {
kickPlayer(true);
} else if (client && idleTime == 60000 * kickAfterMinutes) {
std::ostringstream ss;
ss << "You have been idle for " << kickAfterMinutes << " minutes. You will be disconnected in one minute if you are still idle then.";
client->sendTextMessage(TextMessage(MESSAGE_STATUS_WARNING, ss.str()));
}
}
*/
I meant something like when player is disconnected kick him after 5 seconds or something like that.You can set this in config.lua
Lua:KICK_AFTER_MINUTES = 1440 -- (60 * 24 = 1440) 24 hours
Or you can edit or rather comment out this section of the sources to keep the player online but then the player would be able to xlog.
forgottenserver/player.cpp at 5ba1ef3926695237a8da3d969bd99e779a0ae7f1 · otland/forgottenserver · GitHub
C++:/* if (!getTile()->hasFlag(TILESTATE_NOLOGOUT) && !isAccessPlayer()) { idleTime += interval; const int32_t kickAfterMinutes = g_config.getNumber(ConfigManager::KICK_AFTER_MINUTES); if (idleTime > (kickAfterMinutes * 60000) + 60000) { kickPlayer(true); } else if (client && idleTime == 60000 * kickAfterMinutes) { std::ostringstream ss; ss << "You have been idle for " << kickAfterMinutes << " minutes. You will be disconnected in one minute if you are still idle then."; client->sendTextMessage(TextMessage(MESSAGE_STATUS_WARNING, ss.str())); } } */
Yes, when player is disconnected it display ip 0.0.0.0if your server updates the player IP while online, catch players with ip 0.0.0.0 and kick them
the best thing would be if you manage to add a creaturescript in source for like "onPlayerKick" or something, a function that gets called directly when players is kicked, then you wouldn't need the IP at all.Yes, when player is disconnected it display ip 0.0.0.0
Any idea how to do it?
Would help if I'd know how to do it hahathe best thing would be if you manage to add a creaturescript in source for like "onPlayerKick" or something, a function that gets called directly when players is kicked, then you wouldn't need the IP at all.
But as we're doing the IP way, you'd need to make some sort of event, like globalevent, you could like have a globalevent that launches every 30? seconds. 10 mayeb if you want even..
That check each player what their ip address is, and if a match is found it kick the player and continue checking the list of players online
does that help you anything?
Wouldn't this be abused if I know I'll die i push my ethernet cable and my char will be kicked?Would help if I'd know how to do it haha
Thanks though
it sure would, anything to avoid a death now daysWouldn't this be abused if I know I'll die i push my ethernet cable and my char will be kicked?