Match Management System
The goal is to replace the existing /countdown and /gameover commands with a more unified matching system.
The current system suffers from a number of weaknesses, including;
- Requiring everyone to leave the server to reset after a match.
- Little to no user control over who can and can not play.
- No method of reporting matches to the server owner or other authority.
- Inconstancy in command names.
The core concept is to remove the /countdown and /gameover commands and replace them with a new single "/match" command. The match command will handle all the match related features. All match related permissions will be folded into a single "MATCH" permission.
The /match command will take the following options.
- Start <duration>: Begins a timed match. If the optional duration is specified it will be used instead of the default.
- End <reason>: Ends a timed match, broadcasting the reason if specified. Triggers a log entry in the server reports file with the match results and the reason.
- Pause <duration>: If the game is not paused, pauses the match. If the duration is specified the pause will automatically resume after the specified time unless manually resumed. If the game is paused the command will resume the match. If a duration is specified then the match will resume after the specified time. When games are paused, players will not be able to move or shoot.
- Substitute <playerA> <playerB>: Swaps observer player A for player B. If the command is given by a playing player, playerB is inferred. If the command is given by an admin both players must be specified. The score of playerB is applied to playerA. PlayerB must also be ether dead, paused, or NR.
- No Option: If no options are specified then the command will report the current status of the match.
The match command will automatically report results to the report channel. If the server is setup to log these to a file they will be logged with it.
API hooks will be added for each of the events, including the report event. This can allow for plug-ins to be made to report to websites or other reporting systems.
Match Sample Flow
An example of how a match may go would be;
- User calls /match start.
- Server announces that a timed match will begin in _matchPregameTime and does a countdown.
- Server waits for _matchPregameTime, then clears all scores, despawns all players, and resets all flags.
- Server announces that the match is starting, and spawns all players.
- Match game plays out. if _matchDisallowJoins is true then new joining players will forced to observer.
- When match time reaches _matchEndCountdown from the end duration the server will begin an end countdown.
- When match reaches its duration the server will print out a notification, and report the results to everyone and the report channel.
- All players will be prevented from moving or shooting for _matchResetTime.
- When _matchResetTime has passed, all scores will be reset, and all players despawned, and can respawn as desired.
This breaks the game up into 3 major sections. Pregame, Game, and Postgame. The match can only be paused during the Game section. It can be ended early during the Pregame and Game sections. A new game can only be started during the Postgame section.