User:Hunter X/Transit Disruption Plugin

From Minecart Rapid Transit Wiki
Jump to navigation Jump to search

You can view or download the plugin at: http://dev.bukkit.org/bukkit-plugins/transitannounce/

Over the last few days I've been mulling over concepts for an MRT-themed/related/inspired Bukkit plugin that would help in the monitoring of transit service disruptions (similar to the MRT Commuter Alert page on this wiki), without the need for players to wait for a mod to announce the disruption in chat or have to find an obscure notice outside the game. I decided to record my notes here, partly as a way of storing them for later reference and partly to gauge opinions from players who would use such a thing (Disclaimer: If I ever get around to actually coding this plugin and if it turns out to be worth even considering implementing here, such a choice would of course be the decision of the administrators. That being said, I may well code it anyway since I enjoy doing that kind of thing and perhaps some other server may have a use for it at some point. Alternatively, I might decide this idea is rubbish and never speak of it again, but we'll just have to see what happens).

Development Progress

Phase One

  • Adding and removing lines. (Done!)
  • Adding and removing children to and from lines. (Done!)
  • Setting and unsetting alerts for lines. (Done!)
  • Viewing the list of lines, or children of a specified line. (Done!)
  • Checking the number of lines experiencing issues. (Done!)
  • Checking the issues of a specific line. (Done!)
  • Handling command permissions. (Done, albeit not tested using the specific permissions plugin I believe the MRT server uses)
  • Informing users of the number of issues upon connection. (Done!)
  • Broadcasting new alerts to the server when set. (Done!)
  • Saving and loading line information to and from file. (Done!)
  • Anonymous (and opt-out-able) PluginMetrics/MCStats data collection. (Done!)

Phase Two

  • Upload plugin to BukkitDev. (Done!)
  • Submit plugin to the MRT Beta Server for staff approval. (Done - official stance is it will be considered once Multiverse development is a bit further along)

Phase Three

  • Add /transit rename to allow users to change the extended name of a line without having to rename it entirely. Potentially also add a way for the code to be changed (though this might want higher permission settings than just renaming the line). (Coded, needs testing)
  • Implement a reserved code range (most likely beginning with a special character such as an underscore) for special selections of lines, such as all lines (_all) or lines that have an unknown parent code and thus don't show up on /transit list (_badparent), allowing alerts to be set to those selections or to list all the lines they contain. (Partially coded)
  • Modify permissions to create a way for specific users to be able to set alerts on specific lines (so that transit system owners can manage alerts without having to go through a mod or admin every time the status changes).

Basics

Each transit line (be it trains, buses or other forms of transport) or group of lines is represented by a single-word code and an extended name. For example, the Blue Line might have the code B, whilst the entire network of official MRT lines (Red, Blue, Green, Yellow, Orange) might have the code MRT and the extended name MRT Network.

Any line may have any number of 'child' lines, representing grouping of lines into specific networks that might be affected by disruptions simultaneously. Carrying on the previous example, the Red, Blue, Green, Yellow and Orange lines would all be children of the MRT Network line, whilst bus lines would be children of the bus line, player-made transit systems would be grouped by design, etc. This means that some 'lines' within the system would not themselves represent a specific individual line, but I will continue using the term for the sake of continuity.

Once the lines have been recorded on the plugin, alerts can then be set for specific lines describing the nature of the disruption on that line. Alerts set for parent lines filter down into their children lines, so issues that affect an entire design of transit system can be easily handled without having to set the alert for each line individually. Upon joining the server the player would be presented by a brief notice alerting them to the number of lines experiencing issues at present (but without going into detail since this would get messy for large numbers of issues). The player can then use commands to view the alerts for specific lines at their discretion.

Commands

  • /transit add [code] [name] - Add a new line with the specified code and extended name.
  • /transit remove [code] - Remove the specified line.
  • /transit rename [code] [name] - Rename the specified line.
  • /transit child add [parent code] [child code] - Link the specified child to the specified parent.
  • /transit child remove [child code] - Unlink the specified child from its parent.
  • /transit alert set [code] [message] - Set the alert message for the specified line. (Notes: My current design only handles a single alert message for each line, presumably with multiple issues being recorded on the same command. Additionally, it is possible that calling this command (or the unset command) would announce the change to all online members, similar to how mods will announce disruptions at present)
  • /transit alert unset [code] - Clear the alert for the specified line.
  • /transit list - List all of the recorded lines on the plugin, their codes and how many children they have. (Notes: Might need to add a page parameter for large numbers of lines - how to distinguish this from the below command?)
  • /transit list [code] - Identical to the previous command, but only lists the children of the specified line. (Notes: Should the root command list all the sub-lines, or just the top-level lines/parents?)
  • /transit check - Provides a list of lines with alerts currently set.
  • /transit check [code] - Prints the alert for the specified line (if any). Any alerts for parent lines are also printed.

Permissions

  • transit.* - Access to all commands.
  • transit.line.* - Access to the /transit add, /transit remove and /transit rename commands.
  • transit.line.add - Access to the /transit add command.
  • transit.line.remove - Access to the /transit remove command.
  • transit.line.rename - Access to the /transit rename command.
  • transit.child.* - Access to all the /transit child commands.
  • transit.child.add - Access to the /transit child add command.
  • transit.child.remove - Access to the /transit child remove command.
  • transit.alert.* - Access to all the /transit alert commands. (Notes: Possibly add a permission for setting alerts on specific lines, so that transit system designers/transit network owners could set relevant alerts without having to wait for a mod or admin)
  • transit.alert.set - Access to the /transit alert set command.
  • transit.alert.unset - Access to the /transit alert unset command.
  • transit.list - Access to the /transit list command.
  • transit.check - Access to the /transit check command.

Config File

  • joinalert - Inform the user of alerts upon joining the server.
  • broadcast - Broadcast changes to alerts to the entire server.