The idea is to create two functions to kick/ban someone without him knowing exactly when the kick/ban was decided. It will be useful if you have an anti-multi account system, an anticheat system, for new .kick delay/.ban delay commands or even for Warden actions with new config options.
The best example is when a cheater is testing what he can do or can not do. If you kick him instantly, he will understand what got him detected. That applies to a kick made by a GM too.
PSEUDO CODE:
Two functions that are wrappers around the original Kick and Ban functions (well, I guess they will be wrappers, i haven't checked the original functions). They should be in the same file as kick and ban functions, of course (unless proven otherwise).
delayedKick(145, "Our systems have detected that you are cheating.")
delayedKick(user_id, message = FALSE, min_random_duration = 1min, max_random_duration = 6min)
{
waiting_time = random(min_random_duration, max_random_duration);
// wait before kicking
sleep(waiting_time);
// optional: put the player into a phase so he is harmless to other players? (not sure)
// send red notification + message in chat in yellow from Admin or from something else
if (message)
sendMessageIngame(message)
sendMail(message)
sleep(10seconds);
kick(user_id);
}
delayedBan(145, "Our systems have detected that you are a recurring cheater. You are banned.")
delayedBan(user_id, message = FALSE, min_random_duration = 1min, max_random_duration = 6min, ban_ip = FALSE)
{
waiting_time = random(min_random_duration, max_random_duration);
// wait before banning
sleep(waiting_time);
// optional: put the player into a phase so he is harmless to other players? (not sure)
// send red notification + message in chat in yellow from Admin or from something else
if(message)
sendMessageIngame(message)
sleep(10seconds);
// ban account, if ban_ip = TRUE, then ban by IP
if (ban_ip)
banIp(user_id);
else
banAccount(user_id);
}
Can even deduplicate code with a subfunction for shared code (the waiting time etc)
---
Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/91347809-2-new-functions-delayedkick-delayedban?utm_campaign=plugin&utm_content=tracker%2F40032087&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F40032087&utm_medium=issues&utm_source=github).
The idea is to create two functions to kick/ban someone without him knowing exactly when the kick/ban was decided. It will be useful if you have an anti-multi account system, an anticheat system, for new
.kick delay
/.ban delay
commands or even for Warden actions with new config options. The best example is when a cheater is testing what he can do or can not do. If you kick him instantly, he will understand what got him detected. That applies to a kick made by a GM too.PSEUDO CODE:
Two functions that are wrappers around the original Kick and Ban functions (well, I guess they will be wrappers, i haven't checked the original functions). They should be in the same file as kick and ban functions, of course (unless proven otherwise).
Can even deduplicate code with a subfunction for shared code (the waiting time etc)