• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[TFS 1.3] - Kick player on disconnect

Deepling

Just a spammer
Joined
Jun 29, 2015
Messages
1,835
Solutions
1
Reaction score
555
Location
Poland
Hello
Is it possible to make player kick when he is disconnected from server?

Thx!
 
Last edited:
Hello
Is it possible to make anti kick system for TFS 1.3 client version 10.99?

Thx!
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()));
        }
    }
*/
 
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()));
        }
    }
*/
I meant something like when player is disconnected kick him after 5 seconds or something like that.

Refresh!

Refresh!
 
Last edited by a moderator:
Yes, when player is disconnected it display ip 0.0.0.0
Any idea how to do it? :)
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.
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? :p
 
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.
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? :p
Would help if I'd know how to do it haha
Thanks though
 
Back
Top