Shadowed players do not get kicked when idle
fghsgh opened this issue ยท 2 comments
I am trying to set up a server and I'd like to give players the ability to shadow themselves for AFK farming purposes. I achieve this using a Scarpet script (as the actual /player
command is too powerful). However, it would be preferable if these shadowed players were still able to be kicked by the player-idle-timeout
setting in server.properties
. Otherwise, they could stay connected for multiple weeks at a time, which makes it seem too OP.
As it is now, idle shadowed players do not get kicked. This doesn't make sense, not even for fake players (a distinction already made by the query(player(),'player_type')
command in Scarpet):
- If the server does not allow AFK, there is no reason why they would allow fake AFK players.
- If it allows unlimited AFK, the
player-idle-timeout
should be set to0
anyway, not letting real players be kicked either. - If it allows limited AFK, like in my case (where the timeout would be set to e.g. 4 hours), it would be preferable to have both shadowed players and real players be kicked after these 4 hours.
The only cases in which not kicking shadowed players does make sense:
- If the server owner wants to conserve bandwidth, they could limit real player AFK time, but let fake players AFK for longer. In most cases (on small servers with practically unlimited bandwidth) this is not a concern. As there are more small servers than large servers (according to Zipf's law), it would be preferable to cater to small servers as well.
- If using fake players, it could be preferable to have these fake players never be kicked, however shadowed players should still be kicked in this case.
Possible solutions I see are:
- The ideal solution would be to add a carpet setting that sets the fake/shadowed player idle time separately from the real player idle time. However as it is I don't see a reason why fake/shadowed players should be an exception to the idle time rule.
- The alternative solution would be to have
player-idle-timeout
inserver.properties
affect fake players as well. - Otherwise, whether fake/shadowed players get kicked could also be a boolean setting.
well, idling is the only reason players are disconnected that is not suspected cheating on the client side, and fake players have that explicitly disabled. Also not sure how this would affect situations where player could would set their players to jump continuously and then shadow - performing of any action resets that timeout.
If you already have a script for that - and you want to kick out fake players that has been sitting too long, you can just check their last position and if they don't change them for X amount of time - kick them off.
Having said that - allowing to have more parameters returned via entity API, i.e. in this case - last_action_ticks - would be good to have.
Also not sure how this would affect situations where player could would set their players to jump continuously and then shadow - performing of any action resets that timeout.
In my case, the plan was to just not allow them to do this. Hence "as the actual /player
command is too powerful" in my original post.
If you already have a script for that - and you want to kick out fake players that has been sitting too long, you can just check their last position and if they don't change them for X amount of time - kick them off.
This was what I was trying initially, but the problem is that it is hard to detect if they log back in and then shadow themselves again, except by setting up an event listener, but then I'd have to cancel a schedule()
and get data structures involved... At that point I realized that the player-idle-timeout
setting should be a built-in solution exactly for this problem and discovered that it didn't work.
In any case, thanks for your prompt response.