[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

    Zombiest

    Just realized you could troll someone pretty hard by using a sign to claim their chest and lock them out of it before they do.

    But I can't think of any way to protect against that.
     
  3. Offline

    Kainzo

    I like LWC but its becoming too ... heavy lately - I may have to give this a go.
     
  4. Offline

    Wardogz



    Loaded 335 this Morning, and it is now working, thanks for your help, plugin is working great now :)
     
  5. Offline

    Bakuhatsu

    @Acru "Would protecting doors this way be easy to implement? (Looking into this.)"

    Just wanna give some good tips if you start looking into this, gotta be redstone/button safe, block it stands on gotta be safe, block sign is on gotta be safe.

    And I really would love this, another plugin used that sign way before but has changed into database now which instantly started to bug with losing owner values and such.
     
  6. Offline

    KenRhee

    Updated craftbukkit to 325, and it works now. Thanks Acru got the great mod!
     
  7. Offline

    Acru

    Yes, but presumably you would make a chest private before you put anything valuable in it.
    I am considering hooking into permissions plugin, and via that allowing full-powers admins to break such locks.
    On a more secure server with cuboid-like permission zones, you can prevent placing a sign, however?

    I was thinking either making you place the sign on the block the door stands on or on the door itself. (And protecting the sign, door, and block it stands on.)

    The former might be a problem for blocking redstone, but hidden. The latter would mean the sign would appear to be 'blocking the way' on the lower half of the door, but you can walk through it.

    As redstone can activate any door, it may be required to disable redstone activation, and as iron doors can't be opened manually, it would mean wooden doors only.

    Would you agree?
     
  8. Offline

    Bakuhatsu

    I do agree, that plugin I mentioned only has got wooden locked as well. Whenever you try placing a button, redstone torch etc close to a protected door, it hops instantly back into inventory.
     
  9. Offline

    Acru

  10. I am currently using build #339 and it does not work for me. I went back and tried the 335 and 235 and they dont work either. Please help me! [​IMG]
     
  11. Offline

    Acru

    At first glance, it looks like the plugin wasn't loaded
    Does it say 'Lockette enabled' in the server console? (Any Error messages?)
    Be sure the Lockette.jar is directly in the plugins folder and not a subfolder.
    --- merged: Feb 17, 2011 11:36 PM ---
    Let me know what you think~ :3
     
  12. Offline

    Local_Hostt

    Ok so why there's a need for case insensitive checking? As far as I know, all authentication plugins are case sensitive and we could use that to exploit the plugin.

    Or perhaps I am completely wrong.
     

  13. The Jar file is directly in the /plugins folder. Note: I am running the server off a dedicated server but i dont think that makes a difference. [​IMG]
     
  14. Offline

    Acru

    User names in minecraft are case insensitive unique. They have case but someone can't have the same as you with a different casing. (I checked this by trying to make a new user with the same name as a friend but with different casing.)

    Doing the checks insensitive to case allows you to be more lazy when entering text on signs, so you can type mrbighead instead of MrBigHead.
    --- merged: Feb 18, 2011 12:43 AM ---
    I'll get back to you shortly on this, I'll make an update that puts diagnostics into the server.log file, so we can figure out what is going on. :3
     
  15. Offline

    Kane

    @Acru any news on your next plugin :) My users are getting all excited. A few them told me you checked out our trade hehe :)
     
  16. Offline

    Acru

    I've pritty much decided to go ahead on it, once I decide on a name~
    Something that conveys how it will work, trading a unit quantity of one material for a unit quantity of another...

    UnitTrader? Unity? Hmm~

    (At the moment though, I'm adding a bit more code to Lockette.)
     
  17. Offline

    Kane

    Would have to be UnitTrader or UnityTrader not bad but not Unity because you will get less views. Don't forget you want a name that also sells :)
     
  18. Offline

    JVS

    This plugin is awesome. Now we're talking LIGHTWEIGHT chest protection :p

    Makes me wonder about other uses for this clever technique of yours. Chest shop has been suggested, and that would be sweet.

    But what about zone protection?

    Lets say you have a city, and within that city there are several lots.
    In the center of the city, the mayor would place a sign hidden somewhere with the following text:

    [ProtectionCity]
    BobTheMayor
    100 100 100 100
    64 65

    This would protect 100 blocks in each directions (NESW) from the sign, for a total area of 200x200, from bedrock to sky (64 down 65 up).

    Then within close proximity of the [ProtectionCity] sign, one could add several [More Users] signs to allow for more vice-mayors.

    Now, within the 200x200 protected area the mayor(s) can place signs like this:

    [ProtectionLot]
    JohnTheCitizen
    10 7 10 8
    20 15

    This would allow JohnTheCitizen to build on his private lot (but not in the [ProtectedCity] sourrounding it). His lot size would be 10 blocks north, 10 blocks south from the sign. And 7 blocks east, 8 blocks west, for a total lot size of 20x15. Also he would only be allowed to dig 20 blocks down, and only build 15 up, since he doesn't have permission to the area above and below.

    Using the above [ProtectionLot] sign out in the open (outside the protected city), would still protect John's lot. But not limit him from building larger/deeper/higher, althought that area would not be protected.

    So, Acru, do you think this would be even possible? (not saying you have to do it, just asking if it's doable)

    It sure would make a nice lightweight alternative for zone protection, without the need for database storage :)
     
  19. Offline

    Local_Hostt

    @Acru So I was completely wrong. :D

    Installing and testing right away!
    --- merged: Feb 18, 2011 1:31 AM ---
    @Acru I tought about one more issue. What if we have an username with more chars than the signs char limit?
     
  20. Offline

    Acru

    Can also put 'Trade' as the first word of the description~ Eg;
    Unity - Trade your stuff!

    The plugin will check only the first 15 characters of a user name. I had considered this a possible security issue, though only applying to two people who have 15+ character user names where the first 15 characters are the same.

    Do you consider this acceptable?
    --- merged: Feb 18, 2011 1:50 AM ---
    Unfortunately, the larger the area and the less unique the blocks involved, the more work that the plugin has to do to locate the key signs involved. (By block stepping.)

    For this plugin, that just means keeping an eye on signs, chests, dispensers and furnaces. Lockette knows for certain which sign is related to which container by the direction that the sign is facing, making the search fast and a constant time.

    For areas greater than perhaps 4x4x4, with non-unique blocks, this method becomes impracticable.
    (For unique blocks, this may be closer to 8x8x8)

    I believe that a database is appropriate for larger protection zones.
     
  21. Offline

    JVS

    I see, so I guess there is no way to feed the plugin some coordinates and tell it to ignore which block types is within the area, just protect everything.

    Well, I really like your concept. Thumbs up. Too bad it won't work on a larger scale.
     
  22. Offline

    Kane

    I can't wait for the trade system @Acru , I like your style and your plugins are good for larger servers. So many admins don't understand how much slowdown there is when scanning through a is it an array its called? having 5,000 protected chests ohhh boy I remember I use to report such slow downs in plugins and they all tell me I'm lying haha.

    Anyways I could see a whole series of neat mods coming from you. Id like to see small extensions one for sales one to something like donation chest too [Donate] then iron ore and such and have them for say our public subway system :)
    --- merged: Feb 18, 2011 2:20 AM ---
    I sent you a little again. I just paid my server bill. ddos protection is not fun :(
     
  23. Offline

    Local_Hostt

    @Acru We know nothing is 100% safe, and I think that's acceptable. Once I saw a plugin that locked a chest forever because the username had 17 chars.
    --- merged: Feb 18, 2011 2:53 AM ---
    By the way, the plugin is awesome. Works like a charm.
     
  24. Offline

    Kane

    @Acru I don't know I must have been drunk but could you add permissions or I don't care a config file to add super admins to the list to look and break chests of other peoples. I never even looked maybe this was in already haha.

    I think I'm dumb for not bring this up before its a must have thing to clean up old chests or possible grifed chests.
     
  25. Offline

    Acru

    This has already been mentioned in this thread, planned, and started, hooking to Nijikokun's Permissions plugin so I can tell who are admins and get user groups. :3

    I'm splitting programming time between Lockette and the new plugin, however.

    The version will be 1.2 when I have this and a couple other things in.
     
  26. Offline

    hugoLOST

    Hi,

    The Plugin dosent work.

    [​IMG]
     
  27. Offline

    kreaol

    Agreed, latest version does not work.
     
  28. Offline

    Acru

    You are using a Craftbukkit build between 311 and 318. Build 323 or greater is required!
    Please update your craftbukkit jar file. :3

    More details please, but check what build you are using too~
     
  29. Offline

    hugoLOST

    I use craftbukkit #398
     
  30. Offline

    Acru

  31. Offline

    Kane

    Okay thanks. Looking forward to the new plugin i think this one here is pretty much done anyways soon. Besides the permissions I guess and then maybe permissions one more time for bukkit once it comes out hehe.
     

Share This Page