[ADMN/FIX] WorldList - Multi World Access Control and Rules [1000]

Discussion in 'WIP and Development Status' started by Jacek, Aug 6, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    Jacek

    WorldList - Multi World Access Control and Rules
    Version: 0.1.3


    I made this as a solution to a problem that was not even there, but it may still be useful, the per-world style rules at least. See here for more info http://forums.bukkit.org/threads/ed...rld-management-1000.3707/page-164#post-549339 on that.


    Description

    This is essentially another access control plugin, however, it supports per-world allow and deny lists as well as a per-world /rules command.


    Download

    http://bukkit.jacekk.co.uk/WorldList/WorldList.jar


    Chat Commands

    /rules
    Shows the list of rules for the current world.
    /wl
    Used to add or remove players from the various lists. The syntax is
    /wl [add/remove] [player_name] [world_name] [allow/deny]


    Permissions Nodes

    worldlist.command.* - Allows access to all WorldList commands.
    worldlist.command.wl - Allows the /wl command, defaults to op.
    worldlist.command.rules - Allows the /rules command, defaults to true.
    worldlist.allow-list.global - Allows the user to enter all worlds as long as they are not on the global deny list.
    worldlist.allow-list.[world_name] - Allows the user to enter world_name as long as they are not on the global deny list or the one for that world.


    Huh, Will I be Allowed Into the World or Not ?

    The process for checking if a player is allowed into the world is a little confusing, and is performed in this order.
    1. If the user is on the global blacklist they are kicked.
    2. if the user has the worldlist.allow-list.global permission they are allowed to enter the world
    3. if the global allow list has at least 1 user and the user is on this list, they are allowed to enter the world.
    4. If the user is on the deny list for the world they are sent to a world that they are allowed to enter or kicked if one cannot be found (they will not be sent to a nether world). Unless they are already in the game and trying to teleport, in that case the teleport will be cancelled.
    5. if the user has the permission worldlist.allow-list.[world_name] they are allowed to enter the world.
    6. If the allow list for the world is not empty and the user is on the list they are allowed if not the are relocated or kicked as with #4.
    7. The user is not allowed to enter the world, again they are relocated or kicked.
    And if you prefer to think in code
    Code:
    		// global block.
    		if (globalBlacklist.contains(playerName)){
    			return false;
    		}
    
    		// permissions global allow
    		if (player.hasPermission("worldlist.allow-list.global")){
    			return true;
    		}
    
    		// global allow.
    		if (globalWhitelist.size() > 0 && globalWhitelist.contains(playerName)){
    			return true;
    		}
    
    		// local block.
    		if (worldBlacklist.contains(playerName)){
    			return false;
    		}
    
    		// local permissions allow
    		if (player.hasPermission("worldlist.allow-list." + worldName)){
    			return true;
    		}
    
    		// local allow.
    		if (worldWhitelist.size() > 0 && worldWhitelist.contains(playerName)){
    			return true;
    		}
    
    		return false;

    Config Options

    On first run a config file will be generated with the default settings for each world, this file may look like this
    Code:
    global:
        allow: []
        deny: []
        rules:
        - Real world laws/rules apply
        - Where possible leave the landscape looking natural.
        - All trees must be cut down fully (no floating leaves).
    settings:
        kick-message: Sorry, you are not on the whitelist !
        rules-on-enter: true
    worlds:
        survival_nether:
            allow: []
            deny: []
            rules: []
        survival:
            allow: []
            deny: []
            rules: []
        skylands:
            allow: []
            deny: []
            rules: []
    
    The global section contains settings that will have an effect in all worlds (as described above)

    allow (in all sections)
    This is the allow list, it should contain a list of players with access to the world. If empty (the default) it does nothing.

    deny (in all sections)
    This is the deny list, it should contain a list of players without access to the world. If empty (the default) it does nothing.

    rules (in all sections)
    This is a list of the rules for the world, the ones in the global section apply to all worlds.

    kick-message (settings)
    This is the message that will be shown to the user when kicked.

    rules-on-enter (settings)
    If this is set to true the rules for the world will be shown to the player when they enter the world, the permission for the rules command is not needed for this to work.


    Planned Changes

    • Add a command to add/edit rules.
    • Add a command to view the various lists in game.
    • Have players that are blacklisted (for example) while in game kicked.

    Changelog

    Version 0.1.4
    • Added "softdepend" section to plugin.yml for "Multiverse-Core" so that if Multiverse is installed WorldList will be loaded after it and should pickup the extra worlds.
    • Config is no longer saved on shutdown, as it seems to blank the file if the server had been up for a while.
    Version 0.1.3
    • Made the "is that user allowed there" check work on first login.
    • Cleaned up the code a little.
    Version 0.1.2
    • Another minor tweak to the "is that user allowed there" check.
    Version 0.1.1
    • Minor tweak to the "is that user allowed there" check.
    Version 0.1
    • Initial release.
     
  2. Offline

    blaize9

    hey the download link is down
     
  3. Offline

    Jacek

    Yep, I abandoned this one.
     
  4. Offline

    Jacek

    I just released the per-world rules part of this if that is what you are after :)
     
Thread Status:
Not open for further replies.

Share This Page