Giter Club home page Giter Club logo

gallery's Introduction

This plugin allows users to automatically claim areas from a predefined "pool" of areas (galleries). Each such area is then protected so that only the area owner can interact with the area.

Setting up: galleries

Before the plugin can be fully used, the server admin needs to set up the galleries - define the galleries where players are allowed to claim areas. Some other configuration options are available, too. The configuration is read from the Galleries.cfg file located in the same folder as the Cuberite executable. If the file doesn't exist, the plugin outputs a message in the server console and stays inactive. The plugin also creates an example configuration file named Galleries.example.cfg located next to the Cuberite executable. This file contains an example configuration with documentation on all of the used variables. You might want to consult that file while continuing to read this description.

The config file contains settings that are formatted as Lua code. No worries, the code is very easy to understand and modify. There are two sections, Galleries and Config. The Config section allows the admin to change the configuration for the entire plugin, such as the command prefix that the plugin uses, or the database engine to use. The Galleries section contains the definitions for all the galleries.

Each gallery needs to be enclosed in an extra pair of braces. It needs to contain the following values in order to become functional: Name, WorldName, MinX, MinZ, MaxX, MaxZ, FillStrategy and either AreaTemplate or AreaSizeX and AreaSizeZ. There is an optional AreaEdge parameter, too. Note that the plugin will tell you if it detects any problems in the gallery definition.

The Name parameter identifies the gallery. It needs to be unique for each gallery. Note that it cannot contain "funny symbols", stay safe and use only letters, numbers and underscores. Also note that this is the name that the users will type in their "claim" command. Good names are short and descriptive.

The WorldName parameter specifies the world in which the gallery resides. The MinX, MinZ, MaxX anx MaxZ parameters specify the position and dimensions of the gallery in that world. Note that it is a good idea to make the dimensions perfectly divisible by the size of the area, otherwise the gallery will contain empty space where no-one except the server admins will be allowed to build.

The FillStrategy parameter specifies the order in which the areas are claimed within the gallery. The value is a string containing the letters x, z and symbols + and -. The x and z specify the axis and + or - specify the direction on that axis, so "x+" means "along the x axis towards the positive numbers", while "z-" means "along the z axis towards the negative numbers". Two such directions, one for each axis, are joined together to make up the FillStrategy. The first direction is used first, once the areas reach the end of that direction, it is reset back and the second direction is applied. For example, setting the FillStrategy to "z-x+" means that the first area will start at [MinX, MaxZ], the next area claimed will be at [MinX, MaxZ - AreaSizeZ], the third area at [MinX, MaxZ - 2 * AreaSizeZ] etc.; once the Z coord reaches MinZ, the next area will be at [MinX + AreaSizeX, MaxZ].

Areas can be either left as the world generator generates them, or the plugin can fill them with a predefined "image" loaded from a .schematic file. To leave the world as it was generated, fill in the AreaSizeX and AreaSizeZ values. These indicate how large each area will be. On the other hand, if the AreaTemplate parameter is specified, the image is loaded from the given file and its size is used for AreaSizeX and AreaSizeZ (so there's no need to specify those when using AreaTemplate), and the image is pasted onto the area when it is claimed.

The AreaEdge parameter allows you to specify that each area should have an "edge" where even its owner cannot build. This is useful for templates that include paths along the template's border. The value represents the number of blocks from each of the area's boundaries that are unbuildable.

The Config section can contain the value CommandPrefix. Other values, such as for specifying the DB storage engine, are planned but not yet implemented.

The CommandPrefix specifies the common part of the in-game commands that the users and admins use with this plugin. If not specified, the plugin uses "/gallery" as its value; this would make it register the commands "/gallery claim", "/gallery info", "/gallery my" etc. Changing the value to "/gal", for example, would make the plugin register "/gal claim", "/gal info", "/gal my" and so on.

Setting up: permissions

Caution! Pay attention when setting up permissions, since giving someone the wrong permissions could allow them to wreck entire galleries for everyone.

The permissions system specifies which users are allowed to interact with what level of the gallery plugin. There are basically four levels, each comprising a group of commands that can be used. The first level is "normal users". Users with this level of access can claim areas and build stuff in their owned areas. This is the level where you want most of your users. Second level is "restricted users", these don't have any permissions and thus cannot interact with the Gallery plugin at all, thus they cannot claim areas. Consider this level a "punishment" level. The third level is "VIPs", player with these permissions can view information about other players' areas, can list and teleport to other players' areas by their name. The highest level, "admins", can rename anyone's areas, build and destroy anywhere, transfer or remove area ownership and reset anyone's area.

Note that most admin-level permissions need their non-admin-level permissions in order to work. If you give someone "gallery.admin.goto" but not "gallery.goto", they will not be able to use the goto command at all.

Commands

General

Command Permission Description
/gallery allow gallery.allow allows a friend to build at your area
/gallery claim gallery.claim claims a new area
/gallery deny gallery.deny denies a friend the build permissions for your area
/gallery fork gallery.fork copy-and-claims an area
/gallery goto gallery.goto teleports you to specified gallery area
/gallery help gallery.help prints detailed help for the subcommand
/gallery info gallery.info prints information on the area you're currently standing at
/gallery list gallery.list lists all available galleries
/gallery lockarea gallery.admin.lockarea locks an area so that even the owner can't build there
/gallery my gallery.my lists all your areas
/gallery name gallery.name renames the area you're currently standing at
/gallery remove gallery.admin.remove removes the area you're standing on from its owner
/gallery reset gallery.reset resets the area you're standing on to its original state
/gallery select gallery.select selects the entire area you're standing in.
/gallery stats gallery.stats shows statistics about the galleries on this server
/gallery template gallery.admin.template creates new .schematic template based on your selection
/gallery unclaim gallery.unclaim removes your claim on the area you're standing in
/gallery unlockarea gallery.admin.unlockarea unlocks a previously locked area
/gallery visit gallery.visit teleports you to the specified gallery

Permissions

Permissions Description Commands Recommended groups
gallery.admin.buildanywhere Build in other people's areas and the public sidewalks. admins, mods
gallery.admin.buildanywhere. Build in other people's areas and the public sidewalks in the specific gallery. local admins, local mods
gallery.admin.goto Teleport to any player's area. /gallery goto @PlayerName AreaName, /gallery goto, /gallery goto @PlayerName AreaName VIPs
gallery.admin.info View information on any area. /gallery info VIPs
gallery.admin.lockarea Lock an area so that not even the owner can build in there. /gallery lockarea admins
gallery.admin.my View list of areas for other players, using the "/gallery my @playername []" form. /gallery my @PlayerName, /gallery my @PlayerName GalleryName, /gallery my, /gallery my @PlayerName, /gallery my @PlayerName GalleryName VIPs
gallery.admin.name Rename any area for any player. /gallery name NewName, /gallery name @PlayerName OldName NewName, /gallery name, /gallery name NewName, /gallery name @PlayerName OldName NewName admins, mods
gallery.admin.overridelocked Allows a player to build in areas that have been locked. The player still needs to have access to the area - either ownership or by allowance. admins
gallery.admin.remove /gallery remove
gallery.admin.template Create a .schematic file out of an in-game cuboid. /gallery template admins
gallery.admin.unlockarea Unlock a previously locked area. See also "gallery.admin.lock." /gallery unlockarea admins
gallery.admin.worldedit Allows the use of worldedit anywhere in the gallery. admins
gallery.allow Allow another player to build in your area. /gallery allow normal users
gallery.claim Claim an area in any gallery. /gallery claim normal users
gallery.deny Deny another player to build in your area. /gallery deny normal users
gallery.fork /gallery fork
gallery.goto Teleport to any player's area. /gallery goto @PlayerName AreaName, /gallery goto, /gallery goto @PlayerName AreaName VIPs
gallery.help Display help for subcommands. /gallery help everyone
gallery.info View information on an area owned by self. /gallery info normal users
gallery.list List available gallery. /gallery list normal users
gallery.my View list of areas for other players, using the "/gallery my @playername []" form. /gallery my @PlayerName, /gallery my @PlayerName GalleryName, /gallery my, /gallery my @PlayerName, /gallery my @PlayerName GalleryName VIPs
gallery.name Rename any area for any player. /gallery name NewName, /gallery name @PlayerName OldName NewName, /gallery name, /gallery name NewName, /gallery name @PlayerName OldName NewName admins, mods
gallery.reset /gallery reset
gallery.select /gallery select
gallery.stats /gallery stats
gallery.unclaim /gallery unclaim
gallery.visit Teleport to any gallery. /gallery visit normal users
gallery.worldedit Allows the use of WorldEdit within each individual area. normal users

gallery's People

Contributors

12xx12 avatar ajusa avatar bitdeli-chef avatar madmaxoft avatar mathiascode avatar nilspace avatar seadragon91 avatar tonitch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gallery's Issues

Use standardized Info.lua

Use the Info.lua file (being newly standardized) to store plugin information and (multi-)command bindings

Add interoperability with WorldEdit plugin

The WorldEdit plugin currently knows nothing about the galleries, so it allows players with WE rights edit any area.
The basic requirement would be to disable WorldEdit for entire galleries. If it is possible / reasonable, per-player allowed regions would be better.

Allow players to name their areas

This should provide better experience. Consider: "/gal goto fountain" vs "/gal goto Village 1453".
Names should be at least world-unique; questionable if globally unique.

Add allowances

Add a command to let players allow other friends to build in their areas.

Add extended help system

Some commands have multiple forms available, and even the admin overrides, so it would be good to have a help system that would list all the available forms for the user.
The idea is to define an array of help items, each containing the permission needed, the params and the action performed; then provide a /gal help command that would process these and output the proper help to the user.

Add admin function to create area template schematic

Admins are quite unlikely to have a .schematic file laying around that they'd want to use as a template for the areas. Rather, they are likely to build an area themselves and then use it as the template. The plugin should provide an easy method for doing this.
Workflow:

  1. The admin builds the area template
  2. They issue a /gal template FileName command
  3. The plugin instructs them what to do next - left-click and right-click opposite corners of the area
  4. The admin left-clicks and right-clicks the opposite corners of the template
  5. The plugin saves the template into the "FileName.schematic" file. Both clicked corners are included in the area.

Allow only limited number of areas per player

To help battle abuse, the plugin should allow players to claim only a limited number of areas. Once they hit the limit, they will not be allowed to claim new areas. Admins can enlarge the limit for individual players.
Questions:

  • global limit, or per-gallery limit?
  • total limit, or time-based limit (5 areas per hour) ?
  • default limit dependent on user's group (how? what with multiple groups?)

Can we detect if the player has modified an area "enough" to consider it a unique area? That way, normal happy users won't ever reach the limit, because once they build something, it is excluded from their limit, yet it would still eliminate malicious abusers trying to claim too many areas.

"Buddy" system

Let players decide they are buddies, so they automatically share all their areas, can build on one another's areas, allow or deny friends etc.

Q.: Do we make the buddy relation symmetrical, or not?
Symmetrical is more "brotherly", but requires acceptance from the other player (otherwise anyone could buddy an admin). Single-direction ("I trust him, so I give him my areas") would be easier to implement.

Allow users to turn auto-teleport on claim on / off

The auto-teleport after claiming an area seemed like a good idea, but in reality it feels kinda weird. It would make sense to allow users to be able to turn it on or off by themselves. The state should be persisted to the DB. Use a syntax for the command that assumes further similar settings will be made available soon(ish).

Workflow:
1, Issue command /gal set teleport-on-claim false
2, The teleport is switched off for this player
3, Issue command /gal set teleport-on-claim true
4, The teleport is switched on for this player

Add administrative-level overrides

Most commands and actions require that the user is the owner of the area. However, admins should be allowed some control, too. For example, admins should be able to name users' areas, or modify their contents. Power-users may be allowed to use "goto" to any area, not only their owned.

Snow glitch

You can place snow on other people's claims. Not the block, just regular snow. It sends the "You are not allowed to build here" message but still places the snow. You can not go over 1 block height while placing the snow. This glitch only works if there is already one blanket of snow on the ground.

Generating hooks affect all worlds

When multiple worlds are set up in Cuberite, the Gallery's generator hooks are fired for all such worlds, generating gallery-areas in worlds where they don't belong.

Fix rclk templating with BLOCK_FACE_NONE

When templating, right-clicking a block under a torch while holding a placeable block results in selecting {-1, -1}. That is because the client sends BLOCK_FACE_NONE coords, since the placement is invalid in such a place. Either don't select such coords, or use line block tracer to calculate the real coords.

All area objects should come from a global cache for easier updates

Currently each call to the DB to load an area produces a new instance of the area object table; it is then rather difficult to track these for multiple players and update when needed (removal, locking). It'd be much better to make an "area cache" that would return the same object for the same area. Updates would then mean just modifying a single object instance.

Templates missing their metas

When exporting the template using '/gal template', the blocks' metadata is lost. The exported schematic contains metas all zero.
This may be a MCServer bug, but needs to be investigated first

Add area removal

Admins should be allowed to "revoke" areas, mainly meant for dealing with trolls claiming and then not using areas. Such a revoked area should be made available for new claims.

Error when placing blocks in a second world

Have two worlds on the server, one of them has Galleries defined in it. The player is in the other world (the default world). Whenever the player places a block, an error is output to the console:

[13:55:36] LUA: Plugins/Gallery/Gallery.lua:320: attempt to index field '?' (a nil value)
[13:55:36] Stack trace:
[13:55:36]   Plugins/Gallery/Gallery.lua(320): GetPlayerAreas
[13:55:36]   Plugins/Gallery/Gallery.lua(532): FindPlayerAreaByCoords
[13:55:36]   Plugins/Gallery/HookHandlers.lua(62): (no name)
[13:55:36] Stack trace end

Backup an area before a reset

When using the /gal reset command, the area's contents should get backed up to a file before being erased. Just in case.

Allow config to specify area teleport offset

When using the goto command, the players should be teleported to Area.MinX + Gallery.TeleportOffsetX, Area.MinZ + Gallery.TeleportOffsetZ; the Y coord might be settable, too.

Lock approved areas

The areas that have been approved should be locked even for their original authors, to prevent malicious authors to grief MCS's generator by building stuff that gets approved and then destroying the built area.

Add per-gallery biome imprinting

Some galleries may need setting proper biome in order to become useful. If there's a desert-themed gallery and it's assigned the Plains biome by default, then it rains there, which feels weird.

Add maintenance console command: CheckIndices

Command syntax:
gallery maintenance CheckIndices <AdminPlayerName>

This command should walk each gallery and for each area from the first index to the end index check that the area is either claimed or in the RemovedAreas table. Areas that are not found in either should be marked as claimed by the admin player, given as a parameter to the command.

Add CompositeChat messaging support

This would benefit players with newer clients - they could for example list areas and teleport to them simply by clicking the names in the list.

Add area info command

The command will print information on the area that the player is standing on.

For regular players, only their areas can be info-ed. For admins, any area can be info-ed, possibly showing more information.

Add "area forking"

Add a new claiming method that would claim a new area and copy contents of another area into it. Only areas in the same gallery may be forked.

Add player statistics

Add a command to display the players with the most claimed areas and the most claimed areas approved by admins.

Idea: Messaging

It would be nice to be able to leave a message for players, associated with a specific area of theirs - for example "Fix the missing corner" etc. Such messages should be stored until the player connects, then displayed to them using a somewhat interactive menu, allowing the player to replay the message, delete it, go to the associated area etc. The messages should be announced when the player connects, so that they get a notification.

Major Issue: Claiming areas in unloaded chunks.

Claiming only works if the area is in a chunk that is currently loaded. If the chunk is not loaded, the area template schematic will not be written to it. This needs to be solved properly. Not sure if there is a way to solve this completely in the current API, though.

Add area abandoning

Users may decide to abandon an area, make it possible for them to specify this, with other users possibly adopting the abandoned area later.

Although theoretically possible, reusing abandoned areas for new area claims is a bad idea, because that would effectively destroy the area's contents, which may already be something valuable.

Coop with world generator

The plugin should cooperate with the world generator - if a chunk is being generated that is intersecting a gallery, the chunk should receive the gallery template.

Add area reset command

This will allow players to reset their area to the original state. Only useful if the area comes from a schematic template.

Add config option to block WorldEdit outside galleries

Some servers might want to block WorldEdit usage outside the galleries; since only the Gallery plugin knows about galleries, it's logical that it should be the one responsible for that.

Add a configuration option that specifies whether WorldEdit is allowed outside the galleries.

Enable downloading a specific area via RCON

A feature minor to normal server admins, but crucial to using Gallery for MCServer's own generator-template management, is to allow RCON usage and especially allow "downloading" individual areas through RCON.
The idea is that the plugin would register a console command that would handle the queries, return the metadata (possibly in a Lua / JSON format), and one special command would make it output a .schematic file for the specified area as the command output.

Add filtering for "/gal my"

Use the syntax /gal my <filterpattern> and /gal my @<playername> <filterpattern>, so that player can view only areas they're interested in. Use Lua pattern matching.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.