From 6a30a77829fb47e11148b5b4d969639f1ee0134a Mon Sep 17 00:00:00 2001 From: wsrvn Date: Sun, 21 Jan 2024 06:16:37 +0300 Subject: [PATCH] successfully fix spelling --- config/Config.js | 4 ++-- plugins/donations/Donations.ts | 6 +++--- plugins/maniakarma/Maniakarma.ts | 2 +- plugins/music/Music.ts | 6 +++--- src/TMXFetcher.ts | 8 ++++---- src/services/AdministrationService.ts | 16 ++++++++-------- src/services/ChatService.ts | 6 +++--- src/services/GameService.ts | 6 +++--- src/services/MapService.ts | 8 ++++---- src/services/PlayerService.ts | 2 +- 10 files changed, 32 insertions(+), 32 deletions(-) diff --git a/config/Config.js b/config/Config.js index f47836fcc..5e6c95af4 100644 --- a/config/Config.js +++ b/config/Config.js @@ -20,7 +20,7 @@ export default { voteOnPublicAdd: true, /** Default amount of maps fetched from the TMX search API */ defaultTMXSearchLimit: 50, - /** Whether to reset Cup mode scores after restarting or skipping a map */ + /** Whether to reset Cup mode scores after a map is skipped or restarted */ resetCupScoreOnSkipAndRestart: true, /** Privilege levels for each of the administrative actions */ privileges: { @@ -36,7 +36,7 @@ export default { /** Whether the maplist gets reloaded on Match Settings updates. * Enable this if you use external tools to modify the Match Settings */ updateMatchSettingsOnChange: false, - /** Point system for rounds and cup gamemode */ + /** Point system for rounds and cup gamemodes */ roundsModePointSystem: [33, 29, 27, 25, 23, 21, 19, 17, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1], /** Default time limit in TimeAttack mode (in miliseconds) */ defaultTimeAttackTimeLimit: 300000, diff --git a/plugins/donations/Donations.ts b/plugins/donations/Donations.ts index e1b2027be..b9fd676b3 100644 --- a/plugins/donations/Donations.ts +++ b/plugins/donations/Donations.ts @@ -52,7 +52,7 @@ tm.addListener('PlayerDataUpdated', (info): void => { /** * Fetches donation info for the player * @param login Player login - * @returns Donation object if successfull, undefined if player is not in the donators database + * @returns Donation object if successful, undefined if player is not in the donators database */ async function getFromDB(login: string): Promise /** @@ -127,7 +127,7 @@ tm.commands.add({ * @param payerLogin Login of the player * @param payerNickname Nickname of the player * @param amount Amount of coppers to donate - * @returns True if successfull, false if player refuses payment, Error if dedicated server call fails + * @returns True if successful, false if player refuses payment, Error if dedicated server call fails */ const donate = async (payerLogin: string, payerNickname: string, amount: number): Promise => { if (amount < config.minimalAmount) { @@ -171,7 +171,7 @@ const donate = async (payerLogin: string, payerNickname: string, amount: number) /** * Gets donation info for the player * @param login Player login - * @returns Donation object if successfull, undefined if player is not in the donators database or is offline + * @returns Donation object if successful, undefined if player is not in the donators database or is offline */ function getDonation(login: string): DonationInfo | undefined /** diff --git a/plugins/maniakarma/Maniakarma.ts b/plugins/maniakarma/Maniakarma.ts index 28c81a9d4..10a45739f 100644 --- a/plugins/maniakarma/Maniakarma.ts +++ b/plugins/maniakarma/Maniakarma.ts @@ -369,7 +369,7 @@ export const maniakarma = { * Adds a callback function to execute when maniakarma votes for new map get fetched * @param callback Function to execute on event. It takes object of votes array and map vote ratio */ - onMapFetch(callback: ((dedis: { votes: MKVote[], ratio: number, karma: MKMapVotes }) => void)) { + onMapFetch(callback: ((data: { votes: MKVote[], ratio: number, karma: MKMapVotes }) => void)) { mapFetchListeners.push(callback) }, diff --git a/plugins/music/Music.ts b/plugins/music/Music.ts index 7f226e245..c4e3108f7 100644 --- a/plugins/music/Music.ts +++ b/plugins/music/Music.ts @@ -55,7 +55,7 @@ export const music = { * @param author Song author * @param url Song url (link to an .ogg file) * @param caller Caller player object - * @returns True if successfull, error message otherwise + * @returns True if successful, error message otherwise */ addSong(name: string, author: string, url: string, caller?: Caller): true | 'name taken' | 'invalid file extension' { if (!(url.endsWith('.ogg') || url.endsWith('.mux'))) { @@ -106,7 +106,7 @@ export const music = { * Add a song to the song queue * @param songName Song name * @param caller Caller player object - * @returns Song object if it got added, error message if unsuccessfull + * @returns Song object if it got added, error message if unsuccessful */ addSongToQueue(songName: string, caller?: Caller): Readonly | 'already queued' | 'not in songlist' | 'no privilege' { @@ -314,7 +314,7 @@ function addToQueue(songName: string, emitEvents: boolean, caller?: Caller): * Removes a song from the song queue * @param songName Song name * @param caller Caller player object - * @returns Song object if it got removed, error message if unsuccessfull + * @returns Song object if it got removed, error message if unsuccessful */ function removeFromQueue(name: string, caller?: Caller): Readonly | 'not queued' { if (!queue.filter(a => a.isJuked === true).some(a => a.name === name)) { return 'not queued' } diff --git a/src/TMXFetcher.ts b/src/TMXFetcher.ts index ddef28e00..c98967e28 100644 --- a/src/TMXFetcher.ts +++ b/src/TMXFetcher.ts @@ -71,14 +71,14 @@ export abstract class TMXFetcher { /** * Fetches map file from TMX via its UID. * @param mapId Map UID - * @returns Object containing map name and file content, or Error if unsuccessfull + * @returns Object containing map name and file content, or Error if unsuccessful */ static async fetchMapFile(mapId: string): Promise<{ name: string, content: Buffer } | Error> /** * Fetches map file from TMX via its TMX ID. * @param tmxId Map TMX ID * @param site Optional TMX site (TMNF by default) - * @returns Object containing map name and file content, or Error if unsuccessfull + * @returns Object containing map name and file content, or Error if unsuccessful */ static async fetchMapFile(tmxId: number, site?: tm.TMXSite): Promise<{ name: string, content: Buffer } | Error> static async fetchMapFile(id: number | string, site: tm.TMXSite = 'TMNF'): Promise<{ name: string, content: Buffer } | Error> { @@ -199,7 +199,7 @@ export abstract class TMXFetcher { * @param author Map author to look for * @param site TMX Site to fetch from * @param count Number of maps to fetch - * @returns An array of searched map objects or Error if unsuccessfull + * @returns An array of searched map objects or Error if unsuccessful */ static async searchForMap(query?: string, author?: string, site: tm.TMXSite = 'TMNF', count: number = config.defaultTMXSearchLimit): Promise { @@ -268,7 +268,7 @@ export abstract class TMXFetcher { /** * Fetches a random map file from TMX. * @param site Optional TMX site (TMNF by default) - * @returns Object containing map name and file content, or Error if unsuccessfull + * @returns Object containing map name and file content, or Error if unsuccessful */ static async fetchRandomMapFile(site: tm.TMXSite = 'TMNF'): Promise<{ name: string, content: Buffer } | Error> { const prefix = this.siteToPrefix(site) diff --git a/src/services/AdministrationService.ts b/src/services/AdministrationService.ts index 899c17a2c..cc3a7af46 100644 --- a/src/services/AdministrationService.ts +++ b/src/services/AdministrationService.ts @@ -338,7 +338,7 @@ export class AdministrationService { * @param nickname Optional player nickname * @param reason Optional ban reason * @param expireDate Optional ban expire date - * @returns True if successfull, false if caller privilege is too low or if it's not higher than target privilege + * @returns True if successful, false if caller privilege is too low or if it's not higher than target privilege */ static async ban(ip: string, login: string, caller: { login: string, privilege: number, nickname: string }, nickname?: string, reason?: string, expireDate?: Date): Promise { @@ -386,7 +386,7 @@ export class AdministrationService { * from banlist table * @param login Player login * @param caller Caller player object - * @returns True if successfull, false if caller privilege is too low + * @returns True if successful, false if caller privilege is too low * 'Player not banned' if player was not banned, Error if dedicated server call fails */ static async unban(login: string, caller?: { login: string, privilege: number, nickname: string }): @@ -426,7 +426,7 @@ export class AdministrationService { * @param nickname Optional player nickname * @param reason Optional blacklist reason * @param expireDate Optional blacklist expire date - * @returns True if successfull, false if caller privilege is too low or if it's not higher than target privilege, + * @returns True if successful, false if caller privilege is too low or if it's not higher than target privilege, * Error if dedicated server call fails */ static async addToBlacklist(login: string, caller: { login: string, privilege: number, nickname: string }, @@ -470,7 +470,7 @@ export class AdministrationService { * Unblacklists a player if he is not banned and deletes him from blacklist table. Saves the server blacklist * @param login Player login * @param caller Caller player object - * @returns True if successfull, false if caller privilege is too low + * @returns True if successful, false if caller privilege is too low * 'Player not blacklisted' if player was not blacklisted, Error if dedicated server call fails */ static async unblacklist(login: string, caller?: { login: string, privilege: number, nickname: string }): @@ -502,7 +502,7 @@ export class AdministrationService { * @param nickname Optional player nickname * @param reason Optional mute reason * @param expireDate Optional mute expire date - * @returns True if successfull, false if caller privilege is too low + * @returns True if successful, false if caller privilege is too low */ static async mute(login: string, caller: { login: string, privilege: number, nickname: string }, nickname?: string, reason?: string, expireDate?: Date): Promise { @@ -545,7 +545,7 @@ export class AdministrationService { * Unmutes a player and deletes him from mutelist table * @param login Player login * @param caller Caller player object - * @returns True if successfull, false if caller privilege is too low + * @returns True if successful, false if caller privilege is too low * 'Player not muted' if player was not muted, Error if dedicated server call fails */ static async unmute(login: string, caller?: { login: string, privilege: number, nickname: string }): @@ -579,7 +579,7 @@ export class AdministrationService { * @param login Player login * @param caller Caller player object * @param nickname Optional player nickname - * @returns True if successfull, false if caller privilege is too low, + * @returns True if successful, false if caller privilege is too low, * 'Already guest' if player was already in the guestlist, Error if server call fails */ static async addGuest(login: string, caller: { login: string, privilege: number, nickname: string }, nickname?: string): @@ -606,7 +606,7 @@ export class AdministrationService { * Removes a player from server guestlist, saves it and deletes him from guestlist table * @param login Player login * @param caller Caller player object - * @returns True if successfull, false if caller privilege is too low + * @returns True if successful, false if caller privilege is too low * 'Player not in guestlist' if player was not in the guestlist, Error if dedicated server call fails */ static async removeGuest(login: string, caller?: { login: string, privilege: number, nickname: string }): diff --git a/src/services/ChatService.ts b/src/services/ChatService.ts index cb6a9fe93..6b2ad0553 100644 --- a/src/services/ChatService.ts +++ b/src/services/ChatService.ts @@ -122,11 +122,11 @@ export abstract class ChatService { break case 'time': const timeOrError = Utils.parseTimeString(params[i]) - if(timeOrError instanceof RangeError) { + if (timeOrError instanceof RangeError) { this.sendErrorMessage(Utils.strVar(messages.timeTooBig, { name: param.name }), info.login) return - } else if(timeOrError instanceof TypeError) { + } else if (timeOrError instanceof TypeError) { this.sendErrorMessage(Utils.strVar(messages.notTime, { name: param.name }), info.login) return @@ -192,7 +192,7 @@ export abstract class ChatService { * Adds message to the database and runtime memory * @param login Player login * @param text Message text - * @returns Message object or Error if unsuccessfull + * @returns Message object or Error if unsuccessful */ static async add(login: string, text: string): Promise { const player: tm.Player | undefined = PlayerService.get(login) diff --git a/src/services/GameService.ts b/src/services/GameService.ts index 6d190deac..66186c809 100644 --- a/src/services/GameService.ts +++ b/src/services/GameService.ts @@ -210,7 +210,7 @@ export class GameService { } /** - * Adds remaining race time. This method works only if + * Adds time to the timer. This method works only if * dynamic timer is enabled and server is in 'race' state. * @param milliseconds Amount of time to add in milliseconds * @returns Boolean indicating whether the time got added @@ -223,8 +223,8 @@ export class GameService { } /** - * Subtracts remaining race time. If the time is lower than - * "dynamicTimerSubtractionLimit" from config + * Subtracts time from the timer. If the time is lower than + * "dynamicTimerSubtractionLimit" from Config.js * it will be set to it. This method works only if * dynamic timer is enabled and server is in 'race' state. * @param milliseconds Amount of time to subtract in milliseconds diff --git a/src/services/MapService.ts b/src/services/MapService.ts index df1fb5663..1ece1ee25 100644 --- a/src/services/MapService.ts +++ b/src/services/MapService.ts @@ -121,7 +121,7 @@ export class MapService { i-- } } - if(addedMaps.length === 0 && removedMaps.length === 0) { + if (addedMaps.length === 0 && removedMaps.length === 0) { return } const addedMapObjects = [] @@ -275,7 +275,7 @@ export class MapService { * @option `dontJuke` - If true the map doesn't get enqueued, false by default * @option `cancelIfAlreadyAdded` - If the map was already on the server returns from the function without searching for the map object. * If that happens the map in returned object will be undefined. - * @returns Error if unsuccessfull, object containing map object and boolean indicating whether the map was already on the server + * @returns Error if unsuccessful, object containing map object and boolean indicating whether the map was already on the server */ static async writeFileAndAdd(fileName: string, file: Buffer, caller?: { nickname: string, login: string }, @@ -425,8 +425,8 @@ export class MapService { * Remove a map from the queue * @param mapId Map UID * @param caller Object containing login and nickname of player removing the map - * @param jukebox report as removed from jukebox - * @returns The index of the removed map + * @param jukebox If true, only removes the map if it is in the jukebox + * @returns The boolean representing whether the map was removed */ static async removeFromQueue(mapId: string, caller?: { login: string, nickname: string }, jukebox: boolean = true): Promise { if (jukebox && !this._queue.filter(a => a.isForced).some(a => a.map.id === mapId)) { return false } diff --git a/src/services/PlayerService.ts b/src/services/PlayerService.ts index 9367ad0ca..59ed0c302 100644 --- a/src/services/PlayerService.ts +++ b/src/services/PlayerService.ts @@ -288,7 +288,7 @@ export class PlayerService { /** * Sets spectator status, player slot and team in the player object. * @param info Player login - * @returns True if successfull, false if the player is not in the runtime memory + * @returns True if successful, false if the player is not in the runtime memory */ static setPlayerInfo(info: tm.InfoChangedInfo): boolean { const player: tm.Player | undefined = this._players.find(a => a.login === info.login)