chore(resources): General Linting

This commit is contained in:
Taso committed 2021-06-08 12:36:10 -04:00
1 parent 457926263d
commit f1012958e2
15 files changed
+25 -34

No files matched your search

@@ -1,9 +1,8 @@
import { getSource } from '../utils/miscUtils';
import PlayerService from './player.service';
import { config, ESX } from '../server';
import { config } from '../server';
import { PlayerAddData } from './player.interfaces';
import { playerLogger } from './player.utils';
import { XPlayer } from 'esx.js/@types/server';
/**
* Essentially this whole file acts as a controller layer
@@ -28,7 +27,7 @@ on('playerDropped', () => {
try {
PlayerService.handleUnloadPlayerEvent(src, true);
} catch (e) {
playerLogger.debug(`${src} failed to unload, likely was never loaded in the first place.`)
playerLogger.debug(`${src} failed to unload, likely was never loaded in the first place.`);
}
});
+3 -3
View File
@@ -188,7 +188,8 @@ class _PlayerService {
* @param fetch Whether or not to query the database if a given player is offline
**/
async getIdentifierByPhoneNumber(phoneNumber: string, fetch?: boolean): Promise<string | null> {
for (const [source, player] of this.playersBySource) {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
for (const [_, player] of this.playersBySource) {
if (player.getPhoneNumber() === phoneNumber) return player.getIdentifier();
}
// Whether we fetch from database if not found in online players
@@ -200,9 +201,8 @@ class _PlayerService {
/**
* Unload event handler
* @param src - Source of player being unloaded
* @param playerDropped - Whether the player disconnected or is being unloaded for multichar
**/
handleUnloadPlayerEvent(src: number, playerDropped?: boolean) {
handleUnloadPlayerEvent(src: number) {
this.deletePlayerFromMaps(src);
playerLogger.info(`Unloaded NPWD Player, source: (${src})`);