[MISC] Sleep v7.0.0 - Multi-Player Sleep Management (Idle, Notifications, Force) [1.5.1]

Discussion in 'Archived: Plugin Releases' started by EdGruberman, Apr 26, 2011.

  1. Offline

    EdGruberman

    harakiwi, Glaze, Frogging101 and 2 others like this.
  2. Offline

    maltazar1

    this looks like really nice plugin and i think idea is great cuz sometimes there are some afk on my serv also :p
     
  3. Offline

    Pomme72

    Great plugin, very useful ! I'll test it tomorrow :D thank you
     
  4. Offline

    VitaExdet

    Looks like a great plugin, just downloaded it now! :D
     
  5. Offline

    Celtic Minstrel

    Sounds incredibly useful.
     
  6. Offline

    xorvious

    This is a great idea! Does a player collecting an item such as from a mob trap reset the timer for idling?
     
  7. Offline

    EdGruberman

    No.

    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.
     
  8. Offline

    hi00ih

    Finally someone made this.
     
  9. Offline

    blutherz

    this i really what i searched!
     
  10. Offline

    Kuja_Diartua

    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.
     
  11. Offline

    EdGruberman

    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
     
  12. Offline

    LawrenceCraft

    What If they not afk or mining a far. Can this plug-in force them to enter sleep cycle ?
     
  13. Offline

    EdGruberman

    No.
    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.
     
  14. Offline

    MineralMC

    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. :)
     
  15. Offline

    redsgreens

    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?
     
  16. Offline

    EdGruberman

    @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.
     
  17. Offline

    MineralMC

    Yep. I'm the sole admin and OP on the server, and my player character has nothing above advanced moderation abilities.
     
  18. Offline

    EdGruberman

    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.
     
  19. Offline

    MineralMC

    2011-05-08 22:09:55 [SEVERE] Could not pass event PLAYER_BED_ENTER to SimpleAwaySleep
    java.lang.NullPointerException
    at edgruberman.bukkit.simpleawaysleep.Main.getIgnored(Unknown Source)
    at edgruberman.bukkit.simpleawaysleep.Main.setAsleep(Unknown Source)
    at edgruberman.bukkit.simpleawaysleep.PlayerListener.onPlayerBedEnter(Unknown Source)
    at org.bukkit.plugin.java.JavaPluginLoader$22.execute(JavaPluginLoader.java:358)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:59)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:289)
    at net.minecraft.server.EntityHuman.a(EntityHuman.java:580)
    at net.minecraft.server.EntityPlayer.a(EntityPlayer.java:234)
    at net.minecraft.server.BlockBed.interact(SourceFile:56)
    at net.minecraft.server.ItemInWorldManager.interact(ItemInWorldManager.java:215)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:521)
    at net.minecraft.server.Packet15Place.a(SourceFile:57)
    at net.minecraft.server.NetworkManager.a(NetworkManager.java:196)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:74)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:370)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:285)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)

    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.
     
  20. Offline

    EdGruberman

    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.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 14, 2016
  21. Offline

    MineralMC

  22. Offline

    EdGruberman

    @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?
     
  23. Offline

    MineralMC

    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
     
  24. Offline

    EdGruberman

    @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
    Code:
    level:
        log: CONFIG
    
    to
    
    Code:
    level:
        log: ALL
    
    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.
     
  25. Offline

    MineralMC

    Phew, busy day/night! Will get this done for you tomorrow, Ed!
     
  26. Offline

    EdGruberman

    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)
     
  27. Offline

    ethanrider

    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
     
  28. Offline

    EdGruberman

    @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.
     
    xorvious likes this.
  29. Offline

    ethanrider

    Got it. I see you posted the source. Would you mind if I investigated setting this up as an admin configurable option?
     
  30. Offline

    EdGruberman

    No problem at all. This is why I shared the source. Please fork and modify or copy/paste as you see fit for whatever you want. It's how I learn and I hope I can help others learn and enjoy this game as they want also! :)
     

Share This Page