Discussion in 'Plugin Releases' started by EdGruberman, Apr 27, 2011.
Please use the Sleep project page on dev.bukkit.org to interact with this plugin further.
this looks like really nice plugin and i think idea is great cuz sometimes there are some afk on my serv also
Great plugin, very useful ! I'll test it tomorrow thank you
Looks like a great plugin, just downloaded it now!
Sounds incredibly useful.
This is a great idea! Does a player collecting an item such as from a mob trap reset the timer for idling?
In particular this was a big motivation for me writing this plugin in fact. Idling to collect items from a mob grinder/trap/tower or even idling to let grass grow, items smelt, trees grow, etc. is all apart of the game as I see things. No reason to force people to remain directly active while engaging in such purposes and no reason to prevent other players from engaging in sleep either.
Finally someone made this.
this i really what i searched!
how to set which activity the plugin should track? i use bots, and we cant go to sleep because they are count as awake players.
It's currently not configurable on which activities are able to be monitored.
Have you tried this plugin yet? Do your bots do one of the following activities all the time?
PLAYER_JOIN, PLAYER_MOVE, PLAYER_INTERACT, PLAYER_CHAT, PLAYER_DROP_ITEM, PLAYER_TOGGLE_SNEAK, or PLAYER_ITEM_HELD
What If they not afk or mining a far. Can this plug-in force them to enter sleep cycle ?
This plugin is designed to mimic default sleep functionality. Miners should bring portable beds with them!
Further thought on the bot issue makes me think the bot developer should add an option to configure the bots to ignore the sleep cycle. It doesn't make sense to have this plugin compensate for bad bot design.
I've a request, that is somewhat similar to the above, actually. Any chance of a 'toggle' that I can use with my admin player? I tend to keep him stealthed and AFK when he's not needed, and the ability to make him consistently count as being asleep would be the cherry that tops the cake.
I really like the idea of this plugin, but I can't tell if it allows separate sleep cycles for different worlds. With this plugin, if it's night in one world and all active players in that world get in bed will that world transition to day, regardless of what's happening in the other worlds?
@MineralMC - I may add this feature to toggle the ignore state on/off for certain players. I really didn't want to circumvent the default feature of the sleep cycle too much, but I can see such usefulness for administrative players. My goal is to keep this really simple though and not complicate it with a lot of "features". If I add this ability it'd be only for server operators to employ. Would that suffice in your case? I'm also debating making such a feature a completely seperate plugin to avoid complicating this plugin for people that don't need it...
@redsgreens - Theoretically different worlds should work independently. I haven't tested it myself, but basically all this plugin does is set a player's isSleepingIgnored status to true if they are inactive and someone else has entered a bed. If all players are then either in bed or ignoring sleep, the server itself will do it's normal thing for a sleep cycle. My assumption is the server is smart enough to distinguish between worlds and manage them seperately.
Actually as I write that out I realize there is a possible complication I haven't thought of with multiple worlds. It's possible that if in one world a player enters bed in another world if all players are inactive, a sleep cycle will occur for the other world where everyone is inactive. I will update the plugin logic to compensate for this this weekend if not today.
Yep. I'm the sole admin and OP on the server, and my player character has nothing above advanced moderation abilities.
Okay, for all my complaining about bad bot design, when I sat down and spent some time thinking about the logic, I realized I couldn't figure out how to design the logic to compensate properly so it actually makes way more sense to include such a feature in this plugin itself.
I've updated the plugin accordingly. My multi-world testing has been very minimal but I'm fairly confident it should work as expected.
Please let me know if you find any problems and I'll try to fix ASAP.
2011-05-08 22:09:55 [SEVERE] Could not pass event PLAYER_BED_ENTER to SimpleAwaySleep
at edgruberman.bukkit.simpleawaysleep.Main.getIgnored(Unknown Source)
at edgruberman.bukkit.simpleawaysleep.Main.setAsleep(Unknown Source)
at edgruberman.bukkit.simpleawaysleep.PlayerListener.onPlayerBedEnter(Unknown Source)
Here's a new one. CB760, simpleawaysleep v1.1.0. Would explain why it wasn't working earlier, although build doesn't seem to have anything to do with it, as I was getting the same stuff on my 740 test build as well.
Do you have bots also? The only place I think a NPE could be occuring is if there is no last activity recorded based on the events the plugin monitors for. But since it records PLAYER_JOIN as a last activity, all I can think of is some type of player joining for where that doesn't get captured. How do bots work? I've never used them myself. But if a plugin manages the bot, I'm wondering now if they are always "just there".
Let me look at a few updates here shortly. I'm still going to target 740 (the latest RB) for my testing right now though I think.
@MineralMC - Give this beta a try if you don't mind. v1.1.1b2: https://github.com/EdGruberman/SimpleAwaySleep/blob/master/dist/SimpleAwaySleep.jar?raw=true
I've only done a quick brief test with two players, but I think it might solve your problem. Please confirm if you can.
Nice job, Ed. Works a treat. Thank you.
@MineralMC - Can you confirm if you are using bots and what other plugins you where running where this problem occured?
I'm curious how it does happen. I'd hate to cause another problem elsewhere if I don't understand exactly what is going on. I'm still just guessing you have some sort of player entity that does not cause at least a PLAYER_JOIN event. Do you run bots?
Nope! Nothing but human players. Our plugin list is... probably a little bit excessive, to be honest. You can take a peek at it here: http://plugs.failhouse.net
@MineralMC - Wow yeah, that's some dedication to Bukkit... It'll take me some time to cruise through those to figure out the situation... If you have some time, I'd love more detailed logs from your server using SimpleAwaySleep.
In the plugins\SimpleAwaySleep\config.yml file can you change
Then restart your server and see if you can grab me a chunk of the log where a sleeping cycle occurs?
That would help me tremendously.
Phew, busy day/night! Will get this done for you tomorrow, Ed!
Thank you MineralMC!
Also I just tested this with 766 and it seems to not freak out. (both 1.1.0 and 1.1.1b2 for that matter)
Is it possible to set this up so it will toggle a flag for a user when they are away?
I forget which plugin I have that offers it, but there is an /afk setting. So ideally it'd be like this
If the user is detected to be "away" the /afk setting is set to "away" for them, when they move or do something to show that they are not "away" it auto-unsets /afk if a user wants to "go away" to allow others to sleep, they can /afk and make this work...
Perhaps this is already how it works, if not I can be more specific and track down the source of /afk I think it's Essentials (Phoenix) but need to confirm.
EDIT: Yeah it's Essentials (Phoenix) essentials.afk
@ethanrider - I debated such an idea myself. The problem with allowing users to set their AFK status for the purposes of this plugin is it opens up an easy "abuse" possibility. Say a player is out mining and they forgot a bed, so instead of wanting to comply with the standard sleep requirements, they set themselves /afk manually and they don't have to sleep now. Theoretically everyone could just set themselves /afk and it'd only take 1 person to initiate sleep. In such a case there is another plugin that will allow you to do that (AnyoneSleep or something like that.)
Now, it can be argued that even this plugin won't prevent people from disconnecting and reconnecting to simulate the same effect as a manual /afk status. That said, my experience with the disconnect/reconnect process is it still requires interaction and coordination with other players to achieve results. It can fail frequently too (nightmares wake people up, people reconnect too soon, it's a hassle for people so they don't want to comply, etc.). The reconnect solution simply isn't reliable enough to catch on unless it's amongst friends tightly coordinating and usually in such case you might as well just plan to bring a bed as it'd be simpler, LOL.
My goal with this plugin is to keep it true to the original intent of sleep. Everyone has to be in bed in order for it to work. The only exceptions are those people that are honestly AFK.
Got it. I see you posted the source. Would you mind if I investigated setting this up as an admin configurable option?
Separate names with a comma.