Add JSDoc + use locale strings for admin announce

This commit is contained in:
Vortrex
2022-03-25 02:21:50 -05:00
parent 4f605a8745
commit f877235bf8
15 changed files with 1198 additions and 127 deletions

View File

@@ -41,6 +41,15 @@ function loadRadioStationsFromDatabase() {
// ===========================================================================
/**
* This is a command handler function.
*
* @param {string} command - The command name used by the player
* @param {string} params - The parameters/args string used with the command by the player
* @param {Client} client - The client/player that used the command
* @return {bool} Whether or not the command was successful
*
*/
function playStreamingRadioCommand(command, params, client) {
if(areParamsEmpty(params)) {
messagePlayerSyntax(client, getCommandSyntaxText(command));
@@ -145,6 +154,15 @@ function playStreamingRadioCommand(command, params, client) {
// ===========================================================================
/**
* This is a command handler function.
*
* @param {string} command - The command name used by the player
* @param {string} params - The parameters/args string used with the command by the player
* @param {Client} client - The client/player that used the command
* @return {bool} Whether or not the command was successful
*
*/
function setStreamingRadioVolumeCommand(command, params, client) {
if(areParamsEmpty(params)) {
messagePlayerSyntax(client, getCommandSyntaxText(command));
@@ -185,6 +203,15 @@ function getPlayerStreamingRadioVolume(client) {
// ===========================================================================
/**
* This is a command handler function.
*
* @param {string} command - The command name used by the player
* @param {string} params - The parameters/args string used with the command by the player
* @param {Client} client - The client/player that used the command
* @return {bool} Whether or not the command was successful
*
*/
function showRadioStationListCommand(command, params, client) {
let stationList = getServerData().radioStations.map(function(x) { return `{ALTCOLOUR}${toInteger(x.index)+1}: {MAINCOLOUR}${x.name}`; });
@@ -213,13 +240,22 @@ function getRadioStationData(radioStationId) {
// ===========================================================================
/**
* This is a command handler function.
*
* @param {string} command - The command name used by the player
* @param {string} params - The parameters/args string used with the command by the player
* @param {Client} client - The client/player that used the command
* @return {bool} Whether or not the command was successful
*
*/
function reloadAllRadioStationsCommand(command, params, client) {
stopRadioStreamForPlayer(null);
clearArray(getServerData().radioStations);
getServerData().radioStations = loadRadioStationsFromDatabase();
setRadioStationIndexes();
messageAdminAction(`All radio stations have been reloaded by an admin!`);
announceAdminAction(`All radio stations have been reloaded by an admin!`);
}
// ===========================================================================