Resolves ESLint Naming Convention Issues

This commit is contained in:
Refringe 2023-11-16 10:09:01 -05:00
parent 0ac9e147cb
commit 00be492d5e
No known key found for this signature in database
GPG Key ID: 64E03E5F892C6F9E
10 changed files with 16 additions and 8 deletions

View File

@ -688,7 +688,7 @@ export class RagfairController
const pmcData = this.saveServer.getProfile(sessionID).characters.pmc;
const offers = pmcData.RagfairInfo.offers;
const index = offers.findIndex((offer) => offer._id === info.offerId);
const secondsToAdd = info.renewalTime * TimeUtil.oneHourAsSeconds;
const secondsToAdd = info.renewalTime * TimeUtil.ONE_HOUR_AS_SECONDS;
if (index === -1)
{

View File

@ -485,6 +485,7 @@ export class BotWeaponGenerator
// Define min/max of how many grenades bot will have
const ubglMinMax: GenerationData = {
// eslint-disable-next-line @typescript-eslint/naming-convention
weights: { "1": 1, "2": 1 },
whitelist: [],
};

View File

@ -279,7 +279,7 @@ export class RagfairOfferGenerator
if (this.ragfairServerHelper.isPlayer(userID))
{
// Player offer
return this.timeUtil.getTimestamp() + Math.round(12 * TimeUtil.oneHourAsSeconds);
return this.timeUtil.getTimestamp() + Math.round(12 * TimeUtil.ONE_HOUR_AS_SECONDS);
}
if (this.ragfairServerHelper.isTrader(userID))

View File

@ -43,7 +43,7 @@ export class DialogueHelper
if (maxStoreTime)
{
result.maxStorageTime = maxStoreTime * TimeUtil.oneHourAsSeconds;
result.maxStorageTime = maxStoreTime * TimeUtil.ONE_HOUR_AS_SECONDS;
}
return result;

View File

@ -57,6 +57,7 @@ export class HttpServerHelper
public sendTextJson(resp: any, output: any): void
{
// eslint-disable-next-line @typescript-eslint/naming-convention
resp.writeHead(200, "OK", { "Content-Type": this.mime.json });
resp.end(output);
}

View File

@ -566,7 +566,10 @@ export class RagfairOfferHelper
return false;
}
if (searchRequest.oneHourExpiration && offer.endTime - this.timeUtil.getTimestamp() > TimeUtil.oneHourAsSeconds)
if (
searchRequest.oneHourExpiration
&& offer.endTime - this.timeUtil.getTimestamp() > TimeUtil.ONE_HOUR_AS_SECONDS
)
{
// offer doesnt expire within an hour
return false;

View File

@ -302,6 +302,7 @@ export class TraderHelper
*/
public addTraderPurchasesToPlayerProfile(
sessionID: string,
// eslint-disable-next-line @typescript-eslint/naming-convention
newPurchaseDetails: { items: { item_id: string; count: number; }[]; tid: string; },
): void
{

View File

@ -167,12 +167,14 @@ export class AkiHttpListener implements IHttpListener
public sendJson(resp: ServerResponse, output: string, sessionID: string): void
{
// eslint-disable-next-line @typescript-eslint/naming-convention
resp.writeHead(200, "OK", { "Content-Type": "application/json", "Set-Cookie": `PHPSESSID=${sessionID}` });
resp.end(output);
}
public sendZlibJson(resp: ServerResponse, output: string, sessionID: string): void
{
// eslint-disable-next-line @typescript-eslint/naming-convention
resp.writeHead(200, "OK", { "Content-Type": "application/json", "Set-Cookie": `PHPSESSID=${sessionID}` });
zlib.deflate(output, (_, buf) => resp.end(buf));
}

View File

@ -205,8 +205,8 @@ export class InsuranceService
const insuranceReturnTimeBonusPercent = 1.0
- (insuranceReturnTimeBonus ? Math.abs(insuranceReturnTimeBonus.value) : 0) / 100;
const traderMinReturnAsSeconds = trader.insurance.min_return_hour * TimeUtil.oneHourAsSeconds;
const traderMaxReturnAsSeconds = trader.insurance.max_return_hour * TimeUtil.oneHourAsSeconds;
const traderMinReturnAsSeconds = trader.insurance.min_return_hour * TimeUtil.ONE_HOUR_AS_SECONDS;
const traderMaxReturnAsSeconds = trader.insurance.max_return_hour * TimeUtil.ONE_HOUR_AS_SECONDS;
const randomisedReturnTimeSeconds = this.randomUtil.getInt(traderMinReturnAsSeconds, traderMaxReturnAsSeconds);
// Current time + randomised time calculated above

View File

@ -7,7 +7,7 @@ import { injectable } from "tsyringe";
@injectable()
export class TimeUtil
{
public static readonly oneHourAsSeconds = 3600; // Number of seconds in one hour.
public static readonly ONE_HOUR_AS_SECONDS = 3600; // Number of seconds in one hour.
/**
* Pads a number with a leading zero if it is less than 10.
@ -106,6 +106,6 @@ export class TimeUtil
*/
public getHoursAsSeconds(hours: number): number
{
return hours * TimeUtil.oneHourAsSeconds;
return hours * TimeUtil.ONE_HOUR_AS_SECONDS;
}
}