[MISC] SleepAnnounce v1.2.2 - Sleep/Awake Announcer/Report [1.4.5-R0.2]

Discussion in 'Inactive/Unsupported Plugins' started by sgtbigman, Mar 25, 2011.

  1. Offline

    sgtbigman

    SleepAnnounce - Sleep/Awake Announcer/Report
    Version: v1.2.2
    PermissionsBukkit, MultiVerse, and DispNameChanger support!

    A simple plugin to check who is asleep or not in your server. Made/updated with the request and great suggestions of JTR1988, further requests of michael05242002, and other great suggestions/tips by others of the bukkit community:cool:. My first plugin.

    Features (open)

    • Configurable sleep/awake announcements.
    • Configurable listing of players asleep/awake.
    • config.yml for easy configurations.
    • Op-only setting if PermissionsBukkit is not detected.


    Commands (open)

    • /sleeping [all|worldname]:
      • Lists players sleeping (and awake if this is set in the config) on current world (all worlds if from command line).
      • <all> or <*> option displays all players in all worlds in the server.
      • <worldname> option. Replace with actual name of world. Displays players in the specified world.
        • Shorthand capability.
      • Aliases:
        • /sl, /slp, /sleep
    • /announce <sleep|awake>:
      • Change whether sleep/awake announcements are displayed.
        • If on, switches to off (and vice versa).
      • Alias:
        • /an


    Permissions (open)

    • sleepannounce.list.default - Allows a player to use /sleeping without [all|world].
    • sleepannounce.list.all - Allows a player to use /sleeping all.
    • sleepannounce.list.world - Allows a player to use /sleeping worldname, where worldname is replaced with the actual name of the world.
    • sleepannounce.announce.sleep - Allows a player to toggle the sleep announcement.
    • sleepannounce.announce.awake - Allows a player to toggle the awake announcement.
    Parent nodes:

    • sleepannounce.list.* - Allows player to use all /sleeping variants.
    • sleepannounce.announce.* - Allows player to use all /announce variants.
    • sleepannounce.* - Allows player to use all SleepAnnounce commands.


    Changelog (open)

    Version 1.2.2
    • Updated code to work with latest build.
    Version 1.2.1
    • Fixed announcement bugs (coloring conflict with DispNameChanger).
    • Added the ability to use shorthand on /slp [worldname] command.
    • Added
    • as an alternative to the [all] in /slp [all].
    Version 1.2.0
    • Added PermissionsBukkit support!
    • Removed Permissions 3.x support.
    • Added DispNameChanger support!
    • Cleaned up code.
    Version 1.1.0

    • Added MultiWorld support!
    • /sleep - now displays only those players in the sender's world (if the sender is a player).
      • If the sender is not a player, /sleep displays all players in all worlds.
    • /sleep all - displays all players in all worlds.
    • /sleep <worldname> - Displays players in specified world.
    Version 1.0.0

    • Added Permissions support!
    • If SleepAnnounce/config.yml does not exist, the .jar creates/fills it now.
    • Add /announce <sleep|awake> command which allows players/admin to change whether sleep/awake announcements are broadcast to the server.
    • Some code cleanup.
    • First "Major" release: Everything requested is in the plugin now.
    • Thank you for your continued help/support!
    Version 0.3.6

    • Changed version format to Major.Minor.Non-critical
    • Fixed spacing between playername1,playername2 to playername1, playername2
    • Also added a comma at end of awake players list before sleeping players list.
    • Tested against latest craftbukkit build (677) - Works.
    • Non-critical update - just fixed a little display error.
    Version 0.35

    • Cleaned/Tidied up the config file for ease of reading/use.
    • Used updated Craftbukkit code which deals directly with beds! (They must have known what I was working on and what you guys wanted). :p
      • This helped with announcements working as they should.
    • Added aliases to the /sleeping command: /sl, /slp, and /sleep.
    • Added an announcement for awaking players (toggable). ({Player} has awoken.)
    Version 0.3

    • Added config file (/SleepAnnounce/config.yml) to allow easy configuration by admins.
    • Updated code to work with config file and work with latest recommended build (617).
    Version 0.2

    • Added ability to turn announcements on/off and check status (on/off).
    • Added ability to display sleeping/awake players in a colored list (red: sleeping/green: awake). If /sleeping color off, default two lists display (sleeping: (names) & awake: (names)).
    Version 0.1

    • Release


    Download SleepAnnounce v1.2.2
    Source Code

    Latest build: Compatible with CB[1.4.5-R0.2].
     
  2. Offline

    BrassDoll

    This is really awesome, and exactly what I was looking for.

    Is there a way to set the display name to a plugin-changed name? We use DispNameChanger on our server, and {Player} doesn't pick up the name. Towny has a feature in that if you change {playername} to {modplayername} you get said result. Seems to be very uncommon for mods to pick it up (Alias/DispNameChanger/etc), actually.
     
  3. Offline

    sgtbigman

    I have both PermissionsBukkit and DispNameChanger support implemented and working. I will release v1.2.0 within 12 hours. Thanks for your suggestions and patience.[gold]

    SleepAnnounce v1.2.0 released! Thanks for your suggestions and support! Enjoy!:cool:

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

    BrassDoll

    Oh, I do love you a lot. Thanks!

    Edit: Not to be a PITA, and not sure if it's my end or not - Currently on sleep it broadcasts "went to sleep" in the name color set (rather than mod colors blue/aqua default) and on awakening it, against, says "went to sleep." still quite functional, I'll edit this block out if I find it's something I've messed up with other mods.

    and once again, thanks for the awesome work :3
     
  5. Offline

    sgtbigman

    hey BrassDoll, could you give me a more detailed scenario of this behavior? I'm not sure I follow you 100%. Thanks!
     
  6. Offline

    BrassDoll


    tl;dr 500 updates/blabbing:
    Show Spoiler

    Prior to the update, going to sleep broadcasts in blue "[playername] went to sleep," and once you get out of bed (manually or morning" it says aqua "[playername] has awoken." Now it says the former on both events. Our players set the name color with
    (Not sure if ColorMe/etc has the same issue - we use the in-command color picking due troubleshooting TownySpout a w)

    Without a color for name set, the blue/aqua (default event colors) trigger as normal, but you still get

    [playername] has went to sleep.
    [playername] has went to sleep.

    on waking up or going to bed.

    The player-color on event itself is actually not so bad, itself. Gunna test ColorMe now.

    Update: ColorMe (opposed to DispNameChanger's on-board coloring coding in the names) only changes the display name in SleepAnnounce's broadcast, but turns the rest of the broadcast white.
    (the "has went to sleep" broadcast still triggers for both events, or without name-changers running.)

    Gunna test more for mod conflict, got sidetracked for a few hours.


    Alright, the problem seems to lie in some conflict between SleepAnnounce and DispNameChanger. Everything works perfectly otherwise.

    summarized:
    DispNameChanger overwrites SleepAnnounce's broadcast colortags (if you use DNC's), and somehow, and for some reason, causes the broadcast "has went to sleep" to trigger on both sleeping and waking.
     
    sgtbigman likes this.
  7. Offline

    sgtbigman

    All right I'll have to try to recreate this behavior and fix the code accordingly. Thanks for finding it.
     
  8. Offline

    Saidy99

    Excellent plugin! Just what I needed and no problems with it!
     
    sgtbigman likes this.
  9. Offline

    sgtbigman

    Glad you like it! Thanks for the support and review. :)

    v1.2.1 is out, fixing the announcement/color bugs mentioned by BrassDoll. Thanks for finding those quickly!

    Also, for /slp <worldname>, you now have the ability to use shorthand.
    Example: You have two maps, Minecraft and Minecraft_nether.
    If you type /slp m, you will see:

    Worlds: Minecraft, Minecraft_nether
    {List of players in these worlds sleeping/awake}

    I also added the ability to replace the 'all' string for the /slp all command with '*'.
    Thus, /slp all and /slp * provide the same behavior.

    Thanks for your continued support. I am always up for more suggestions for this plugin or any new plugins you wish to see.

    Enjoy! :cool:

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

    sgtbigman

    Confirmed - Works with cb build 1185
     
  11. Offline

    Saidy99

    Yay! It was working before I read this but glad it's officially compatible with the RB. <3
     
    sgtbigman likes this.
  12. Offline

    harakiwi

    Is it possible to skip the night with afk players?
    Or some kind of votesystem, for example:
    5 players online; 1 player isn't going to bed and 4 other want so skip the night.
    Kind of a *force-sleep* system ;)
     
  13. Offline

    caitlin

    PermissionsEx support?

    When I add the correct permissions node, I still get "You are not an op and cannot use this command."
     
  14. Will you update this for the latest CB? :)
     
  15. Offline

    harakiwi

    anybody knows a working version / alternate plugin?
     
  16. Offline

    EdGruberman

    harakiwi - You can check out Sleep to see if that meets your needs.
     
    harakiwi likes this.
  17. Offline

    md_5

    Long time no see sgtbigman. You will notice that this thread has now been placed into the Inactive Plugin subforum.
    If you wish to revive this plugin, please ensure that you update and test compatibility with the latest recommended Bukkit build before reporting your original post, asking for it to be moved back to the release forum.

    Thanks for your time.
    md_5
     

Share This Page