ArcanePlugins / SleepFixer

The most robust one-player sleep plugin for your Bukkit server
GNU Affero General Public License v3.0
6 stars 0 forks source link

Feature request: allow players to toggle their ignored status #8

Open dblblaster opened 2 years ago

dblblaster commented 2 years ago

Before finding this plugin I used this AFK plugin that removes AFK users from number required for sleep. It worked well - one goes to bed and others do /afk. However it's still a pain to be asked to go AFK when you're in a middle of something or people toggling on/off by accident so your plugin seems like the obvious solution.

However, what if someone wants the night to stay because he wants to do some hunting? Should he have to depend on goodwill of others or should he have some control? The game intended that everyone has to agree to skip the night. Your plugin makes it so that everyone agrees by default - but it would be nice if they could have the option to disagree i.e. override the ignored status and elect to disagree (until they toggle it or log out and log back in - to avoid having to store their preference).

lokka30 commented 2 years ago

Before finding this plugin I used this AFK plugin that removes AFK users from number required for sleep. It worked well - one goes to bed and others do /afk. However it's still a pain to be asked to go AFK when you're in a middle of something or people toggling on/off by accident so your plugin seems like the obvious solution.

However, what if someone wants the night to stay because he wants to do some hunting? Should he have to depend on goodwill of others or should he have some control? The game intended that everyone has to agree to skip the night. Your plugin makes it so that everyone agrees by default - but it would be nice if they could have the option to disagree i.e. override the ignored status and elect to disagree (until they toggle it or log out and log back in - to avoid having to store their preference).

Hi, thank you for opening a feature request :) this is a brilliant idea.

Shall there be any configurable monetary cost to running this command? Timeouts and warm-up delays?

dblblaster commented 2 years ago

Hi, great to hear, thanks! I don't know about other users but for me it's not necessary. The plugin is very simple which is why I liked it in the first place, a simple ignore toggle command would be enough. Maybe let ops reset everyone's status and change the default status, something like:

This would essentially let ops force skip the night if someone set it to false and went AFK, and let ops toggle the plugin without having to disable the plugin and reset the server.

No need for storing user data, if they leave the game and come back then they'll be set to whatever is the server default.

lokka30 commented 2 years ago

Do you agree that server owners should create their own interface (command/inventory/whatever) if they want it to be user-accessible? This will keep the plugin very simple - no need for warmups/cooldowns/transactions/etc.

In addition, the following behavior will be used:

if any online player has a sleepfix status of false (no sleepfix), then vanilla behavior will be used.

Regardless, the server software does not expose any way of us freezing the sleep process anyhow.

dblblaster commented 2 years ago

Do you agree that server owners should create their own interface (command/inventory/whatever) if they want it to be user-accessible?

I don't know 😅

Regardless, the server software does not expose any way of us freezing the sleep process anyhow.

I did not mean to say to change the sleep process, just to toggle whether some player gets counted or not by exposing toggling the player's setSleepingIgnored through the command (what you're doing already by default for all, but here I'm talking about giving it some granularity), and let the game do its thing as it normally would.

What if there are 20 players with 18 set to ignore. What if any 2 players go to sleep, and what if the 2 non-ignored players go to sleep? Would the game skip the night either way or only if the 2 non-ignored players go to sleep?

lokka30 commented 2 years ago

Do you agree that server owners should create their own interface (command/inventory/whatever) if they want it to be user-accessible?

I don't know 😅

I think I'll make it that way. Will keep the plugin free from bloat :)

What if there are 20 players with 18 set to ignore. What if any 2 players go to sleep, and what if the 2 non-ignored players go to sleep? Would the game skip the night either way or only if the 2 non-ignored players go to sleep?

If a world contains one or more players which have a SleepFixer bypass enabled, then players in that world will be unable to skip the night until they either disable their bypass or all players with the bypass sleep. This behavior is purely vanilla and can be modified using 1.17's (iirc) sleeping players required percentage gamerule.

lokka30 commented 2 years ago

Instead on working on this feature, wouldn't it be better to attack the source issue: AFK users not being ignored? This can be achieved through an EssentialsX integration. It'll be easier to add, easier to use, and lighter for this plugin.

dblblaster commented 2 years ago

I'm now using EssentialsX+SleepFixer and it all works fine. If I don't use your plugin then AFK users will be ignored. If I use your plugin then ALL users will be ignored.

When I opened the issue I was looking for a way to do the opposite, ignore ALL users by default, but have a way for users to decide they shall NOT be ignored temporarily, like if you want to do something in the night and you don't want someone else going to sleep and skipping the night.

lokka30 commented 2 years ago

Ah, so an "afks-only" option?

dblblaster commented 2 years ago

No, all existing afk+sleep plugins work for that, if I wanted just that I have EssentialsX. Yours is great because it doesn't require people to go AFK. I was thinking of a command to toggle your own ignore status like /ignoremeforsleep. Your plugin simply ignores everyone for sleep (required count=1, right?), but if users had a command like that, someone could run /ignoremeforsleep and then nobody can skip the night until that user goes to sleep. But now thinking about it that may be too complex to implement because you can't simply add +1 to the required count since then any 2 other players could go to bed and skip the night.

lokka30 commented 2 years ago

I see what you mean now. Thanks for the explanation. Wouldn't it be better to prevent sleeping entirely whilst a user is online and doesn't want the night to be skipped? Modifying the sleeping ignored count makes no guarantees that players will be prevented from sleeping to skip the night.

dblblaster commented 2 years ago

Oh yeah that would be simpler, could call it /preventsleep. And the prevention could be removed once he does any of the following: leaves the server, or the user who's preventing goes to bed (if there's another preventing he still couldn't actually sleep), or runs the command again to remove himself from sleep-preventing user list.

lokka30 commented 1 month ago

Hi @dblblaster, it has been a long while since we last discussed this idea. I've currently jotted it down as a 'won't fix' since I'd much rather keep the plugin free of commands or any other user interfaces, at least at the moment.

RetroMC is a sever I rarely play on, something interesting on there is they have a day/night vote system, where all online players can vote to skip the night. That might work best for your setup.