[SEC] Lockette - Simple chest and door lock, no databases! [Moved to BukkitDev]

Discussion in 'Inactive/Unsupported Plugins' started by Acru, Feb 14, 2011.

  1. Offline

    Acru

    Lockette - The sign-based container and door lock for Bukkit! - by Acru Jovian

    ElgarL has been assigned as the current maintainer of this project, please forward any important issues to him as well. This post is abandoned, but proceed to BukkitDev for updates.

    Download it at BukkitDev! (Alternate) (JAR) (Source), also view the Change Log on BukkitDev.



    Supported external plugins:
    • Permissions - Permissions/Groups
    • GroupManager - Permissions/Groups
    • PermissionsBukkit - SuperPerms/Groups
    • PermissionsEx - SuperPerms/Groups
    • bPermissions- SuperPerms/Groups
    • Towny - Groups/Zones
    • SimpleClans - Groups
    • mcMMO - Groups (Disabled by default now, due to issues.)
    • Factions - Groups
    • LWC - Zones
    • Register - Economy
    Alternate languages included:
    Confirmed compatible plugins: ColorSign, SpeedSign.
    Conflicting plugins: ChestShop, Most sign editors!


    The active Lockette information page will commute to BukkitDev soon, but the forum thread is still the best place for discussion.



    Overview:

    The purpose of this plugin is to restrict access to the contents of chests, dispensers, furnaces, and doors without the use of a database to track containers.

    To use, simply place a signpost on the floor directly beside a chest or other container to be locked. Enter [Private] as the first line. Your own name will automatically be entered on line 2 as the chest owner. Optionally type in the full names of two other users allowed to access the chest's inventory on lines 3 and 4.

    When done correctly, the sign will automatically fix itself to the side the target chest, protecting it from unauthorized access! Only the chest's owner can then break the sign or chest. (Warning: Anyone with permission to use WorldEdit commands or similar can circumvent the protection by removing the sign.)

    [​IMG]

    Additionally, you can enter [Everyone] on lines 3 or 4 instead of a user name to allow everyone access to the contents of a private container, or [Operators] to allow ops access. If a Permissions plugin is available, you can use groups like [Moderator] or [Admins] or others as defined in the Permissions settings files.

    The owner of a container can add more users by placing additional signs beside the container with the heading [More Users], where lines 2-4 specify the names of the additional users. You can edit the users on previously placed signs by right clicking the sign, and using the command '/lockette <line number> <text>' to change it.


    Working with Doors:

    To protect a door, you can use the same method as protecting a container, the sign will attach to the door automatically. In addition, you can attach a [Private] wall sign to any side of the blocks just above or just below a door. For double doors only one side needs a sign. Door support is enabled by default in the config file.

    Once a door is protected it will only open for someone listed as a user, and will not respond to redstone power or switches unless [Everyone] is listed as a user. Iron doors which usually won't open from clicking will work just as wooden doors. In addition, double doors will open together automatically!

    You can also use [More Users] signs as with containers, with the caveat that the sign cannot be placed on the block above the door if the [Private] sign is not above the door as well! (This is done to prevent a security uncertainty issue.)

    Protected doors will be closed automatically if a timer is set. A timer can be set globally with a configuration option, or individually for each door by using the tag [Timer: #] on line 3 or 4 of the [Private] sign, where # is the number of seconds that the door should remain open. If the timer is set to 0, this means the door will never automatically close. If no timer is specified, protected doors will use a global timer set in the configuration file. If the server is shut down cleanly any open doors will be closed, but in the event of a server crash while a door is open, it may remain so. Note that the initial state of a door is assumed to be closed.

    Care must me taken to place protected doors on a stable block. Building a door on sand, gravel, leaves, TNT and et cetera are allowed by the plugin, but cannot be secured fully. :3 Additionally, it should be noted that most status messages still refer to locked blocks as containers, so for the purpose of simplicity, doors should be considered as a type of container.


    Features:
    • No passwords or databases needed!
    • Permission checks run in constant time, no matter how many protected containers.
      • One owner and up to 11 additional users supported. (17 for double chests!)
      • Allows access to [Everyone] while still protecting the container from vandalism.
      • Allows group names in conjunction with many other plugins.
    • Special powers for ops or admins, configurable with permissions.
      • Reports when an admin does something naughty.
    • Protects single and double chests, dispensers, and furnaces.
      • Explosion and block-break protection for the protected container and sign.
        • Option to protect all containers from explosions.
    • Full support for doors, both wooden and iron!
      • Double doors are handled automatically, with no redstone.
      • Doors can be set to close automatically, via a timer setting.
      • Redstone hacking is disabled for protected doors.
    • Prevents creation of chests larger than 2 blocks.
    • Informative or helpful messages when interacting with containers.
      • The first time a chest is placed, a help message will be shown.
      • Types of messages shown are configurable in settings.
      • Additional language support.

    Advanced Setup (Permissions) (open)

    Advanced Setup:
    There are a few things you can now customize in the configuration files for the plugin, found in the plugins/Lockette folder. After running the plugin for the first time, two files will be created, config.yml and strings.yml. The first holds the following settings:
    • enable-permissions - Allows the use of permission nodes to specify who can do what. If this is disabled, groups will still be used but admin status is taken from the ops file. Defaults to false.
    • enable-messages-* - Enables or disables groups of messages listed in the strings.yml file. Not counting the broadcast ones.
    • broadcast-*-target - Sets the group or player that specific broadcast messages should be sent to. This can be set to "" for no one.
    • explosion-protection-all - Enabling this extends explosion protection to all containers on the server, not just [Private] ones. Default is disabled.
    • allow-admin-bypass - Allows admins to go though any protected door. Default is true.
    • allow-admin-snoop - Allows admins to peek into chests owned by other people. Default is false, and this setting is recommended! A broadcast message will be sent each time an admin snoops in a protected container where the admin doesn't have permission to. The message will be sent to a player or group as specified in another option. Admins can still break protection on chests if this is disabled, however.
    • enable-protection-doors - Enables support for private doors, defaults to true.
    • default-door-timer - Sets the door closing timer for all protected doors on the server, unless overridden by a specific sign. Defaults to 0, which disables the door closing timer.
    In the strings.yml file, you can set alternate language tags for [Private] and such, in ANSI format. If you need characters not in ANSI then you might try UTF-8 format, though it seems bugged tight now. The default alternate tags are in French, but server ops are free to translate the whole file into the language of their choice. If you do this, please share it back to me~ :3 If you want to disable only a specific message, you can set it to "", the empty string. Admins can use the command '/lockette reload' after editing the configuration files, to reload them.

    If a Permissions plugin is not available or the enable-permissions option is set to false, Lockette will use the ops file to determine who are admins. Admins can break the protection on any chest, and look inside protected chests (only if the related option is set), as well as reload the plugins configuration files. All non-ops will be able to create protected containers for themselves.

    If a Permissions plugin is available and the enable-permissions option is set to true, the following nodes will be used instead of the ops file and are included by default in the '*' node:
    • lockette.user.create.* - Permission required to create a protected container or door. Possible sub-nodes include chest, dispenser, furnace, and door. (The permission lockette.create.all is still supported, but obsolete.)
    • lockette.admin.create.* - Allows admins to create containers and doors for other users. Possible sub-nodes include chest, dispenser, furnace, and door. Leave line 2 blank for the default behavior or enter the name of your choice. Capitalization matters.
    • lockette.admin.break - Allows breaking protection on containers.
    • lockette.admin.bypass - Allows opening of any locked door.
    • lockette.admin.snoop - Allows peeking in protected containers. (The setting allow-admin-snoop must be true.)
    • lockette.admin.reload - Allows use of the reload command.

    Technical Information (open)

    Technical Information:

    This plugin has been tested and shown to be working for many builds of CraftBucket though a number of the more recent builds had a serious issue, so I'm suggesting a minimum build of 561 now. If you update past what is listed in the post's title and the plugin seems to break, it is probably not my fault. Post a note anyway and I'll see about fixing. I'll try and keep up with the new recommended build system, but for latest builds that break things, you should expect some time to pass before I take care of the issue, as this plugin is now mature. :3

    If there are multiple containers by the placed sign, the plugin will use the NESW rule to choose the first container that is not yet private. To elaborate, the plugin will check to the north of the sign first, and if no container or door is available to the north, it will continue checking clockwise around the sign.

    Due to the current implementation of the explosion event, this plugin will cancel all explosions that would damage the container or sign, rather than just remove the container and sign from the blocks to be damaged. Canceled explosions still knock signs off the walls. Canceled explosions leave signs looking blank, but this is just a graphic glitch, reconnect to fix.

    Bonus: This plugin will prevent chests bigger than 2 blocks from being created via glitches. (Again, this could be circumvented using WorldEdit commands, so take care who has access to such a plugin.)

    This plugin was inspired by the old hmod plugins Lock by Roman "kingseta" Pramberger and ChestCapsule by Fernando "Fergo".

    Hooking into Lockette (open)

    Hooking into Lockette:

    If you are a plugin author and want to connect to Lockette, you can use a public static function to get information about the protected status of a block.

    More info later, perhaps, but if you need the details now then go poke through the source~

    Future Possibilities:

    There are a number of things that have been suggested, and they tend to be added to the list below if I think they might be a good idea. However, some sort of locked container limit is requested often but this is not possible without a database to track the number of locked containers someone has. All things considered, this will not be supported. On the up side, without a database you can have literally millions of locked containers without any sort of lag, and there are permissions to restrict who can create locked chests. Perhaps only allow Moderators to create locked chests for other users, if you don't want to allow infinite locked chests.

    Aside what has already been implemented, the following may or may not appear in future versions:
    • Furnace/dispenser clusters, protected by a single sign.
    • [Log] sign to list recent users of a container or door.
    • iConomy fee for protecting containers/doors.
    • Worldguard connection.
    • [Protected] tag for viewing only.
    • Specific time range that doors can be opened.
    • DataLog plugin support.
    • More types of protected blocks, such as brewing stands.
    If you want any of the above features sooner than never, let me know! However, I currently see Lockette as functionally complete, for the most part, in that it already has all the functionality it needs. Future updates will mostly be to account for changes in Minecraft and Bukkit.


    Final Note:

    Please leave a reply if there are any bugs or suggestions, and if you like this plugin you can click the like button at the bottom of this post~ Thanks to those few that have donated! [​IMG]
     
  2. Offline

    G1R Productions

    I have a double chest in the corner of a room, the walls are Log and i place the sign on the front of the chest closest to the wall. I then log into another account and go and hit the sign until it pops off the chest. It then re-appears on the log wall next to the chest and then i am able to open the chest.
     
  3. Offline

    connor yates

    Ok i added the permissions but now when I place a sign nothing happens. :(

    What now?
     
  4. Offline

    Tendonsie

    Very good plugin. Works great with 670!
     
  5. Offline

    mistresswitch

    Hi Acru,
    Awesome plugin, will be a saviour to our server.

    We are currently running Group Manager (as installed with Essentials Plugin 2.1) and we will be setting up sub-groups (user classes). Will the container protect be protected per sub-group, or only the parent group.

    [group] Explorers
    [sub-group/class] Map builders

    Sign: [Private]
    Admin Name
    [Explorers][Map Builders]

    Although, just reading the Group Manager plugin info - sub-classes/groups seem to not be treated as independantly as I thought. So we may need to just have more standard groups, which then negates my question. *sighs*. I do admin, not tech stuff. :)

    Regards,

    MW
     
  6. Offline

    Mark PROT

  7. Offline

    JeffBobbo

    Sorry, these have probably been suggested before. But can you make it optional to keep Redstone activity for Iron doors? I like my automated doors. :p

    Or maybe you can make it so you can lock redstone wires/pressure plates. For wires, the entity, could be X blocks from it. So if it had a range of 5, I could have a pressure plate on the ground, with then a redstone wire which is protected under that. Would be really awesome, or otherwise, what you posted in the OP would be nice, automatic closing of the doors after X time (stop them Creepers getting in when you make the rush back to home! >_>)

    Other than that, bloody awesome! :D
     
  8. Offline

    ChristianxUSAF

    When I put it in front of a chest or door all it says on the sign when i press enter is [?]
     
  9. Offline

    ZachBora

    I did get this problem reported to me too. It appears to be based on location, I have no idea why it happens. It was popping that it didnt find anything to lock nearby, even though it was on the block next to the chest. If I did the SAME setup 4 blocks next to it, it would work. I have a video proof but I dont know how it could help.

    Tell me if you want and i'll upload it. Doupt you can gain anything from it.
     
  10. Offline

    MintTheFox

    i was wondering what the memory footprint of this plugin is, im trying to minimize memory usage since i have been running into memory problems recently
     
  11. Offline

    Bakuhatsu

    I have no idea if this is requested yet but... what about an autoclose timer of doors? Like.. all doors? Etc after 5 min a door closes itself~
     
  12. Offline

    ZachBora

    How do you define that a door is in the close position?
    Would it be that the position at which you placed it that would stand for closed? How would you track this? What if the door is opened and server crashes, will it stay open afterward?

    I've had problems with double doors where one of the 2 was open when I placed down the lockette sign. When I'd open one it closed the other. I don't know if it's the expected behavior.
     
  13. Offline

    RyanTheLeach

    well a door that is open is in a position such as a player can walk through, a door can be in 2 positions either the player can walk through it or they cant depending on surrounding blocks. surely this is a non issue?

    also your problem sounds like a redstone or a minecraft problem
     
  14. Offline

    ZachBora

    There's actually some locations where I've set doors into an L shape passage.
    Code:
     |
     V
    X X
    X XX
    XO  <--
    XXXX
    
    X = wall
    O = door
    As for the opening doors that's lockette, no redstone involved. Lockette opens both double doors if you lock one.
     
  15. Offline

    MattFielding

    Hey

    I installed Lockette last night and it hasn't been working correctly. I am currently running CB 670.

    When I place a sign with the [Private] tag on the first line, I get the following message appearing in console:

    Code:
    12:01:32 [SEVERE] Could not pass event SIGN_CHANGE to Lockette
    java.lang.NoSuchMethodError: org.anjocaido.groupmanager.GroupManager.getWorldsHolder()Lorg/anjocaido/groupmanager/dataholder/worlds/WorldsHolder;
        at org.yi.acru.bukkit.Lockette.Lockette.hasPermission(Lockette.java:809)
        at org.yi.acru.bukkit.Lockette.LocketteBlockListener.onSignChange(LocketteBlockListener.java:735)
        at org.bukkit.plugin.java.JavaPluginLoader$28.execute(JavaPluginLoader.java:368)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:59)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:255)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:819)
        at net.minecraft.server.Packet130UpdateSign.a(SourceFile:39)
        at net.minecraft.server.NetworkManager.a(NetworkManager.java:198)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:72)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:368)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:283)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:375)
    When I then try to delete this, I get another message in the console:
    Code:
    12:02:38 [SEVERE] Could not pass event BLOCK_BREAK to Lockette
    java.lang.NoSuchMethodError: org.anjocaido.groupmanager.GroupManager.getWorldsHolder()Lorg/anjocaido/groupmanager/dataholder/worlds/WorldsHolder;
        at org.yi.acru.bukkit.Lockette.Lockette.hasPermission(Lockette.java:809)
        at org.yi.acru.bukkit.Lockette.LocketteBlockListener.onBlockBreak(LocketteBlockListener.java:310)
        at org.bukkit.plugin.java.JavaPluginLoader$32.execute(JavaPluginLoader.java:392)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:59)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:255)
        at net.minecraft.server.ItemInWorldManager.d(ItemInWorldManager.java:157)
        at net.minecraft.server.ItemInWorldManager.a(ItemInWorldManager.java:45)
        at net.minecraft.server.EntityPlayer.f_(EntityPlayer.java:80)
        at net.minecraft.server.World.a(World.java:983)
        at net.minecraft.server.WorldServer.a(WorldServer.java:52)
        at net.minecraft.server.World.f(World.java:965)
        at net.minecraft.server.World.e(World.java:942)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:365)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:283)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:375)
    If somebody tries to open a protected door, the following error occurs in console and they are able to open the door:
    Code:
    12:03:06 [SEVERE] Could not pass event PLAYER_INTERACT to Lockette
    java.lang.NoSuchMethodError: org.anjocaido.groupmanager.GroupManager.getWorldsHolder()Lorg/anjocaido/groupmanager/dataholder/worlds/WorldsHolder;
        at org.yi.acru.bukkit.Lockette.Lockette.hasPermission(Lockette.java:809)
        at org.yi.acru.bukkit.Lockette.LocketteBlockListener.canInteract(LocketteBlockListener.java:1240)
        at org.yi.acru.bukkit.Lockette.LocketteBlockListener.rightclickDoor(LocketteBlockListener.java:527)
        at org.yi.acru.bukkit.Lockette.LockettePlayerListener.onPlayerInteract(LockettePlayerListener.java:261)
        at org.bukkit.plugin.java.JavaPluginLoader$9.execute(JavaPluginLoader.java:252)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:59)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:255)
        at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:162)
        at net.minecraft.server.ItemInWorldManager.a(ItemInWorldManager.java:64)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:356)
        at net.minecraft.server.Packet14BlockDig.a(SourceFile:42)
        at net.minecraft.server.NetworkManager.a(NetworkManager.java:198)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:72)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:368)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:283)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:375)

    Do you have any idea what the problem could be? I am using GroupManager for my permissions and have it set for admin-only at the moment.

    Matt
     
  16. Offline

    RyanTheLeach

    @Zach good point, i've got no idea how it should behave, maybe it could save some data in the sign somehow like
    [Private]-o
    Acru
    for open and

    [Private]-c
    Acru
    for closed?
     
  17. Offline

    fefect

    I will LOVE YOU
    if you can also make it on a lever
     
  18. Offline

    Maxis010

    All redstone (inc levers, buttons etc) are blocked as you can't see who activated it, I think (don't quote me) that is the door is [Everyone] then it works with redstone
     
  19. Offline

    DemonCraft

    I don't have a permission Plug-In.
    I only have GroupManager.
    Everytime I try to place a sign with, "[Private]" it goes to a ? in the middle and says, "Lockette:permission to lock containers denied."
     
  20. Offline

    ZachBora

    do you have permission lockette.create.*
     
  21. Offline

    Acru

    I still need the information: bukkit build, other plugins used and versions, any messages in console. I can't help you in the slightest without knowing your setup...

    Nothing at all? You sure you didn't remove Lockette as well? There should always be some sort of message, unless disabled. :3

    Thanks for the positive feedback.
    It helps when coming back to a dozen posts, if at least one isn't someone complaining or asking for help. ^.^;
    Still quite a few left this time... On to the next.

    Lockette askes the group plugin if a user is in a group, and gets back whatever it says is the answer, presumably including inheritance. :3

    Ah, nice video, though I'm afraid my french is nearly all forgotten by this point~ ^.^*
    Note that you can use [Privé] as well by default, btw.

    You can use [Everyone] as a user to enable redstone, at the expense of security.
    There is no way to tell who it is applying power to a door, so this is the only viable option.
    As for automatic doors, I'm looking into it.

    You should either get a 'permission denied' message or a 'container not found' error? If its the first, your problem is not having the lockette.create.* permission. If it is the latter, it is probably a buggy version of craftbukkit, see the recommended build list.

    If it goes away after restarting the server, it was probably craftbukkit's fault. Someone mentioned there was a new ghosting bug prior to build 670?

    Memory used is nearly non-existent.
    Perhaps under 100 bytes, plus a list relating users to signs being edited, that is trimmed as users quit.
    Another benefit of no database. :3

    It is on the list, yes. :3 (And see next bit.)

    I believe the initial position of the doors would be the closed position. I'd track it by using a temporary list, adding when a door opens and removing from the list on door close, unless the door is closed manually first.

    If the server would happen to crash while the door was open, however, yes the door would be forgotten and stay open, so it would be a good idea to set a short open-time. If the server was shut down more cleanly though, I could make sure all doors are closed first, I believe.

    Yes that is the expected behavior with double doors, be sure doors are in sync before placing the sign. :3 You could also use a third door in the right place to toggle just one door, to fix.

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

    ZachBora

    I don't remember how I fixed this door but it probably involved breaking something :p
    I'll verify that if it happens again. I didnt note the coordinates where the problem happened so I couldnt go there and retry it.
     
  23. Offline

    Acru

    All the errors you listed are in groupmanager, and apparently an old version of it that doesn't have the getWorldsHolder() method.
    What version of GM does it say it is in the console? I only have a copy of version 1a5 to test with, at the moment.

    I am quoting you, as you are correct. :3

    GroupManager is a permission plugin as well. (Both GM and Permissions do both permissions and groups.)
    If you are using a permissions plugin, you need to give everyone the lockette.create.* permission.
     
  24. Offline

    MattFielding

    That would probably be why... I just realized I'm using a very old version (0.99c). I'll upgrade to the newest version ASAP.

    Thanks!
     
  25. Offline

    MintTheFox

    alright thanks, ill be using your plugin rather then lwc
     
  26. Offline

    JeffBobbo

    Surely if you can limit access to doors, chests and furnaces. You can limit what blocks can receive/transmit power? No? Can't be that hard to check what entity is standing on a pressure plate can it? I don't really know, java aint my thing.

    Although, if they everyone tag lets everyone opens it... What's the difference between that and it not being restricted? (apart for double doors opening automatically, and iron doors being click to open)
     
  27. Offline

    RazorFlint

    Amazing :D , I See all big servers have this :) Good Work.
     
  28. Offline

    DemonCraft

    How do I give permissions for GroupManager then?
     
  29. Offline

    Plague

    Do not use a plus sign in the RB version, you should state the latest tested version.
     
  30. Offline

    Acru

    Goodgood~ :3

    To the former, many sources of power don't have any entitiy associated, such as if someone places a redstone torch by the door. Bukkit doesn't tell plugins what the source of the power is either, just that there is a change in the power level, and for bukkit to do this would be impossible in many cases as well, what with the complexity of redstone circuitry. The difference is that it is an indirect activation of the door, and anonymous.

    There might be a possible workaround by 'faking' the input from a directly connected pressure plate etc, but this would require a fair bit of work for it to be reliable.

    To the latter question, the door is still damage protected as well.

    Thank you, and they do? Nice to know~ :3

    Best to read how in the GroupManager thread, but basically you edit your groups.yml.
    Every group that is allowed to lock should have the following:

    permissions:
    - lockette.create.*

    As you seem to have told everyone this, I'll drop the +, but I'm keeping the supported build range. :3
    Recommended builds are listed separately within the thread.

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

    RazorFlint

    Play.kreatious.com Big server 200+
     

Share This Page