Skip to content

Commit

Permalink
Merge pull request #19 from totemo/master
Browse files Browse the repository at this point in the history
ModReq 1.7 - Documentation, bug fixes, enhancements (including CommandHelper alias features)
  • Loading branch information
redwallhp committed Nov 16, 2015
2 parents 7f117b3 + 2b50363 commit a47c384
Show file tree
Hide file tree
Showing 10 changed files with 784 additions and 555 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
# various other potential build files
/build
/bin
/classes/
/dist
/manifest.mf

Expand All @@ -28,4 +29,4 @@
*.iml
*.ipr
*.iws
.idea/
.idea/
16 changes: 0 additions & 16 deletions README

This file was deleted.

114 changes: 114 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
ModReq
======
ModReq (**Mod**erator **Req**uest) is a help ticket management system for Minecraft. Players make requests with the `/modreq` command, which saves the coordinates of the requesting player and the request text. Staff can see all requests in a work queue and can select which request to handle next.

Requests can be in one of three states:
* OPEN - The request has been made but is not yet being handled by staff.
* CLAIMED - A staff member has started work on the request. A request can only be claimed by a single staff member at a time.
* CLOSED - The request was completed (or denied). Players can also close their own requests, even if not a staff member.

ModReq supports two tiers of staff permissions: Moderator and Admin. Admins are assumed to have some superset of Moderator permissions. By default, new requests are visible to all staff members (Moderators and Admins). However, requests can be marked as requiring an Admin to handle them using the `/elevate` command. Elevated requests are hidden from Moderators unless using extra options to the `/check` command.


Commands
--------
Note: In the discussion that follows, `#` signifies a number.

Many commands support the use of `-`, instead of a request ID number, to signify the request that was most recently claimed by the staff member.

`/modreq <request>`
* Make a request. The coordinates of the player making the request are saved by the command.

`/check #`
* Retrieve a full description of the request with the specified number.

`/check -`
* Retrieve a full description of the most recently claimed request.

`/check [--page # | -p # | p:#] [--admin | -a] [--search term | -s term]`
* List all open requests matching specified criteria. Requests are grouped into pages of (by default) 5 requests and `/check` only shows one page of requests at a time.
* `/check` on its own lists all requests visible to the player. Non-staff players will only see open requests that they have made themselves. Moderators will see requests by other players, but not those that have been elevated. Admins will see all requests.
* `--page`, `-p` or `p:` select a different page to show. Pages are numbered starting at 1.
* `--admin` or `-a` allow Admin requests to be visible to Moderators. Without one of these options, moderators will only see open requests that have not been elevated.
* `--search` or `-s` allow a search term to be specified. Only requests whose text include the term will be listed.

`/tp-id #` or `/tpid #`
* A staff-only command to teleport to the location of a request.
* `/tp-id -` or `/tpi -` will teleport to the location of the most recently claimed request.

`/claim #`
* A staff-only command to claim exclusive access to a request.
* The request is moved to the CLAIMED state and associated with a staff member.

`/unclaim #`
* Remove your claim on a request that you have previously claimed with `/claim`.
* The request is returned to the OPEN state and not associated with any staff member.
* `/unclaim -` will unclaim the most recently claimed request.

`/done # [message]`
* Mark a request as completed, optionally specifying a message that will be sent to the requesting player.
* The request is moved to the CLOSED state.
* `/done - [message]` closes the most recently claimed request, with an optional close message.

`/reopen #`
* Reopen a closed request.
* The request changes to the OPEN state.
* `/reopen -` attempts to reopen the most recently claimed request.

`/elevate #`
* Mark the request as requiring handling by an Admin.
* If the request is currently claimed by the staff member running the command, it is unclaimed.
* `/elevate -` attempts to unclaim and elevate the most recently claimed request.

`/tpinfo #` or `/tpi #`
* A staff command to teleport to and check the details of a request without claiming it.
* This command is shorthand for `/tp-id #` followed by `/check #`.
* `/tpinfo -` or `/tpi -` will teleport to and check the most recently claimed request.

`/tpc #`
* A staff command that tries to claim a request and, _only if successful_, teleport to and check the details of the request.
* An error message will be shown if another staff member has already claimed or closed the request.
* If you have already claimed the request, the command acts as `/tpi`.
* The command executes `/claim #`, and if successful `/tpi #`.

`/mr-note add # text`
* A staff command to add a note to a request designated by its ID number.
* The first note attached to a request is numbered 1. Subsequent notes attached to the same request have progressively higher numbers.
* Notes are only visible to staff.
* `/mr-note add - text` adds a note to the most recently claimed request.

`/mr-note remove # #`
* A staff command to remove a note from a request; the first number is the request ID and the second number is the note ID, which starts at 1.
* Notes are only visible to staff.
* `/mr-note remove - #` removes a note from the most recently claimed request.

`/mr-reset`
* A staff command to reset the database.

`/mr-upgrade`
* A staff command to upgrade the database.


Permissions
-----------
* `modreq.request` - Permission to submit a request (defaults to true).
* `modreq.mod` - All Moderator permissions. Certain administrative commands are excluded.
* `modreq.check` - Staff permission to check requests. Note that players lacking this permission can still check the status of requests they made themselves.
* `modreq.claim` - Staff permission to claim a request.
* `modreq.done` - Staff permission to close a request that belongs to another player. Non-staff can always close their own requests, even without this permission. This permission is also required to `/reopen` requests.
* `modreq.teleport` - Staff permission to teleport to the location the request was made.
* `modreq.notice` - Staff permission to receive broadcast messages about requests, e.g. new requests made.
* `modreq.cleardb` - Admin permission to clear the request database.
* `modreq.upgrade` - Admin permission to upgrade the request database from an older schema.
* `modreq` - All permissions, including Moderator and Admin permssions (use with caution).


Configuration
-------------
* `messages.general.<path>` - Configurable message text sent to ordinary players. Substitution parameters are enclosed in curly braces.
* `messages.mod.<path>` - Configurable message text sent to staff. Substitution parameters are enclosed in curly braces.
* `colour.online` - Colour of online player names in formatted text.
* `colour.offline` - Colour of offline player names in formatted text.
* `max-requests` - The maximum number of open requests an ordinary player can make.
* `page-size` - The number of requests in one page of `/check` output.
* `date-format` - Format specifier for the date and time of a request in `java.text.SimpleDateFormat` syntax.
7 changes: 6 additions & 1 deletion config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ messages:
search-error: "&CYou must specify a search term."
request-number: "&CYou must provide a number for requests."
request-filed: "&ARequest has been filed. Please be patient for a moderator to complete your request."
max-requests: "&CYou already have {max_requests} open requests, please wait for them to be completed."
max-requests: "&CYou already have {max_requests} open requests. Please wait for them to be completed."
request-error: "&AEither that request doesn't exist, or you do not have permission to view it."
no-requests: "&AYou don't have any outstanding requests."
request-taken: "&A{mod} is now handling request {request_id}."
Expand Down Expand Up @@ -36,9 +36,14 @@ messages:
flagged: "&ARequest {request_id} has been flagged for admin."
reset: "&ADatabase has been reset."
already-closed: "&CRequest already closed."
already-claimed: "&CRequest already claimed."
note-added: "&ANote added to request {request_id} successfully."
note-removed: "&ANote removed from request {request_id} successfully."
note-number: "&CYou must specify a number for the note, starting at 1."
note-missing: "&CRequest {request_id} has no note numbered {note_id}."
colour:
online: "&A"
offline: "&C"
max-requests: 5
page-size: 5
date-format: "MMM.d@HH:mm:ss"
11 changes: 11 additions & 0 deletions plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ commands:
usage: |
/<command> [#]: Teleport to a request
aliases: [tpid]
tpinfo:
description: Teleport to and check a request
permission: modreq.teleport
usage: |
/<command> [#]: Teleport to and check a request
aliases: [tpi]
tpc:
description: Teleport to and claim a request
permission: modreq.teleport
usage: |
/<command> [#]: Teleport to and claim a request
claim:
description: Claim a request
permission: modreq.claim
Expand Down
62 changes: 23 additions & 39 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,37 @@
<modelVersion>4.0.0</modelVersion>
<groupId>nu.nerd</groupId>
<artifactId>ModReq</artifactId>
<version>1.6</version>
<version>1.7</version>
<packaging>jar</packaging>
<name>ModReq</name>
<description>Moderator Request Sytem</description>
<url>https://github.com/NerdNu/ModReq</url>
<scm>
<connection>scm:git:https://github.com/NerdNu/ModReq.git</connection>
<developerConnection>scm:git:https://github.com/NerdNu/ModReq.git</developerConnection>
<url>https://github.com/NerdNu/ModReq</url>
</scm>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>znode-releases</id>
<name>znode-releases</name>
<url>http://repo.zno.de/artifactory/libs-release-local</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.7.10-R0.1-SNAPSHOT</version>
<version>1.8.8-R0.1-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
Expand All @@ -23,44 +43,7 @@
<version>0.1</version>
</dependency>
</dependencies>
<distributionManagement>
<repository>
<id>repobo-rel</id>
<name>repo.bukkit.org Releases</name>
<url>http://repo.bukkit.org/content/repositories/releases/</url>
</repository>
<snapshotRepository>
<id>repobo-snap</id>
<name>repo.bukkit.org Snapshots</name>
<url>http://repo.bukkit.org/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>

<repositories>
<repository>
<id>repobo-snap</id>
<url>http://repo.bukkit.org/content/groups/public</url>
</repository>
<repository>
<id>znode-releases</id>
<name>znode-releases</name>
<url>http://repo.zno.de/artifactory/libs-release-local</url>
</repository>
</repositories>

<pluginRepositories>
<pluginRepository>
<id>bukkit-plugins</id>
<url>http://repo.bukkit.org/content/groups/public</url>
</pluginRepository>
</pluginRepositories>
<description>Moderator Request Sytem</description>
<url>https://github.com/NerdNu/ModReq</url>
<scm>
<connection>scm:git:https://github.com/NerdNu/ModReq.git</connection>
<developerConnection>scm:git:https://github.com/NerdNu/ModReq.git</developerConnection>
<url>https://github.com/NerdNu/ModReq</url>
</scm>
<build>
<sourceDirectory>${basedir}/src</sourceDirectory>
<resources>
Expand Down Expand Up @@ -113,6 +96,7 @@
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<shadedArtifactAttached>false</shadedArtifactAttached>
<shadedClassifierName>Bundle</shadedClassifierName>
<artifactSet>
Expand Down
22 changes: 16 additions & 6 deletions src/nu/nerd/modreq/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

public class Configuration {
private ModReq plugin;

public String GENERAL__PAGE_ERROR;
public String GENERAL__SEARCH_ERROR;
public String GENERAL__REQUEST_NUMBER;
Expand Down Expand Up @@ -40,23 +40,28 @@ public class Configuration {
public String MOD__FLAGGED;
public String MOD__RESET;
public String MOD__ALREADY_CLOSED;
public String MOD__ALREADY_CLAIMED;
public String MOD__NOTE_ADDED;
public String MOD__NOTE_REMOVED;
public String MOD__NOTE_NUMBER;
public String MOD__NOTE_MISSING;
public String COLOUR_ONLINE;
public String COLOUR_OFFLINE;
public Integer MAX_REQUESTS;

public int MAX_REQUESTS;
public int PAGE_SIZE;
public String DATE_FORMAT;

public Configuration(ModReq plugin) {
this.plugin = plugin;
}

public void save() {
plugin.saveConfig();
}

public void load() {
plugin.reloadConfig();

GENERAL__REQUEST_NUMBER = plugin.getConfig().getString("messages.general.request-number");
GENERAL__REQUEST_FILED = plugin.getConfig().getString("messages.general.request-filed");
GENERAL__MAX_REQUESTS = plugin.getConfig().getString("messages.general.max-requests");
Expand Down Expand Up @@ -89,10 +94,15 @@ public void load() {
MOD__UNCLAIM = plugin.getConfig().getString("messages.mod.unclaim");
MOD__REQUEST_TAKEN = plugin.getConfig().getString("messages.mod.request-taken");
MOD__ALREADY_CLOSED = plugin.getConfig().getString("messages.mod.already-closed");
MOD__ALREADY_CLAIMED = plugin.getConfig().getString("messages.mod.already-claimed");
MOD__NOTE_ADDED = plugin.getConfig().getString("messages.mod.note-added");
MOD__NOTE_REMOVED = plugin.getConfig().getString("messages.mod.note-removed");
MOD__NOTE_NUMBER = plugin.getConfig().getString("messages.mod.note-number");
MOD__NOTE_MISSING = plugin.getConfig().getString("messages.mod.note-missing");
COLOUR_OFFLINE = plugin.getConfig().getString("colour.offline");
COLOUR_ONLINE = plugin.getConfig().getString("colour.online");
MAX_REQUESTS = plugin.getConfig().getInt("max-requests", 5);
PAGE_SIZE = plugin.getConfig().getInt("page-size", 5);
DATE_FORMAT = plugin.getConfig().getString("date-format");
}
}
Loading

0 comments on commit a47c384

Please sign in to comment.