XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFESpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 0 Star 0
返回提交历史

XFEstudio/XFESpaceNinjaServer

chore: resolve various eslint complaints (#169)

9f0317fe
Sainan <sainan@calamity.gg>
提交于

代码差异

22 个文件 +22 -30
Modified package.json +1 -0
@@ -8,6 +8,7 @@
8 8 "dev": "ts-node-dev --openssl-legacy-provider -r tsconfig-paths/register src/index.ts ",
9 9 "build": "tsc",
10 10 "lint": "eslint --ext .ts .",
11 "lint:fix": "eslint --fix --ext .ts .",
11 12 "prettier": "prettier --write ."
12 13 },
13 14 "license": "GNU",
Modified src/controllers/api/addFriendImageController.ts +1 -1
@@ -6,7 +6,7 @@ import { getInventory } from "@/src/services/inventoryService";
6 6 const addFriendImageController: RequestHandler = async (req, res) => {
7 7 const accountId = req.query.accountId as string;
8 8 const json = getJSONfromString(req.body.toString()) as IUpdateGlyphRequest;
9 let inventory = await getInventory(accountId);
9 const inventory = await getInventory(accountId);
10 10 inventory.ActiveAvatarImageType = json.AvatarImageType;
11 11 await inventory.save();
12 12 res.json({});
Modified src/controllers/api/claimCompletedRecipeController.ts +1 -1
@@ -1,7 +1,7 @@
1 1 //this is a controller for the claimCompletedRecipe route
2 2 //it will claim a recipe for the user
3 3
4 import { Request, RequestHandler, Response } from "express";
4 import { RequestHandler } from "express";
5 5 import { logger } from "@/src/utils/logger";
6 6 import { getItemByBlueprint, getItemCategoryByUniqueName } from "@/src/services/itemDataService";
7 7 import { IOid } from "@/src/types/commonTypes";
Modified src/controllers/api/createGuildController.ts +3 -3
@@ -5,16 +5,16 @@ import { Guild } from "@/src/models/guildModel";
5 5 import { IGuild, ICreateGuildRequest } from "@/src/types/guildTypes";
6 6
7 7 const createGuildController: RequestHandler = async (req, res) => {
8 let payload: ICreateGuildRequest = getJSONfromString(req.body.toString());
8 const payload: ICreateGuildRequest = getJSONfromString(req.body.toString());
9 9
10 10 // Create guild on database
11 let guild = new Guild({
11 const guild = new Guild({
12 12 Name: payload.guildName
13 13 } satisfies IGuild);
14 14 await guild.save();
15 15
16 16 // Update inventory
17 let inventory = await Inventory.findOne({ accountOwnerId: req.query.accountId });
17 const inventory = await Inventory.findOne({ accountOwnerId: req.query.accountId });
18 18 if (inventory) {
19 19 // Set GuildId
20 20 inventory.GuildId = guild._id;
Modified src/controllers/api/findSessionsController.ts +4 -4
@@ -6,23 +6,23 @@ import { logger } from "@/src/utils/logger";
6 6 const findSessionsController: RequestHandler = (_req, res) => {
7 7 const reqBody = JSON.parse(_req.body);
8 8 logger.debug("FindSession Request ", { reqBody });
9 let req = JSON.parse(_req.body);
9 const req = JSON.parse(_req.body);
10 10 if (req.id != undefined) {
11 11 logger.debug("Found ID");
12 let session = getSession(req.id);
12 const session = getSession(req.id);
13 13
14 14 if (session) res.json({ queryId: req.queryId, Sessions: session });
15 15 else res.json({});
16 16 } else if (req.originalSessionId != undefined) {
17 17 logger.debug("Found OriginalSessionID");
18 18
19 let session = getSession(req.originalSessionId);
19 const session = getSession(req.originalSessionId);
20 20 if (session) res.json({ queryId: req.queryId, Sessions: session });
21 21 else res.json({});
22 22 } else {
23 23 logger.debug("Found SessionRequest");
24 24
25 let session = getSession(_req.body);
25 const session = getSession(_req.body);
26 26 if (session) res.json({ queryId: req.queryId, Sessions: session });
27 27 else res.json({});
28 28 }
Modified src/controllers/api/hostSessionController.ts +1 -1
@@ -6,7 +6,7 @@ import { ISession } from "@/src/types/session";
6 6 const hostSessionController: RequestHandler = (req, res) => {
7 7 const hostSessionRequest = JSON.parse(req.body as string) as ISession;
8 8 logger.debug("HostSession Request", { hostSessionRequest });
9 let session = createNewSession(hostSessionRequest, req.query.accountId as string);
9 const session = createNewSession(hostSessionRequest, req.query.accountId as string);
10 10 logger.debug(`New Session Created`, { session });
11 11
12 12 res.json({ sessionId: { $oid: session.sessionId }, rewardSeed: 99999999 });
Modified src/controllers/api/inventorySlotsController.ts +1 -1
@@ -1,5 +1,5 @@
1 1 import { parseString } from "@/src/helpers/general";
2 import { getInventory, updateCurrency } from "@/src/services/inventoryService";
2 import { updateCurrency } from "@/src/services/inventoryService";
3 3 import { RequestHandler } from "express";
4 4 import { updateSlots } from "@/src/services/inventoryService";
5 5 import { SlotNameToInventoryName } from "@/src/types/purchaseTypes";
Modified src/controllers/api/joinSessionController.ts +2 -2
@@ -5,8 +5,8 @@ import { logger } from "@/src/utils/logger";
5 5 const joinSessionController: RequestHandler = (_req, res) => {
6 6 const reqBody = JSON.parse(_req.body);
7 7 logger.debug(`JoinSession Request`, { reqBody });
8 let req = JSON.parse(_req.body);
9 let session = getSessionByID(req.sessionIds[0]);
8 const req = JSON.parse(_req.body);
9 const session = getSessionByID(req.sessionIds[0]);
10 10 res.json({ rewardSeed: session?.rewardSeed, sessionId: { $oid: session?.sessionId } });
11 11 };
12 12
Modified src/controllers/api/saveLoadout.ts +0 -1
@@ -1,5 +1,4 @@
1 1 import { RequestHandler } from "express";
2 import util from "util";
3 2 import { ISaveLoadoutRequest } from "@/src/types/saveLoadoutTypes";
4 3 import { handleInventoryItemConfigChange } from "@/src/services/saveLoadoutService";
5 4 import { parseString } from "@/src/helpers/general";
Modified src/controllers/api/trainingResultController.ts +0 -1
@@ -1,6 +1,5 @@
1 1 import { parseString } from "@/src/helpers/general";
2 2 import { getJSONfromString } from "@/src/helpers/stringHelpers";
3 import { Inventory } from "@/src/models/inventoryModels/inventoryModel";
4 3 import { getInventory } from "@/src/services/inventoryService";
5 4 import { IMongoDate } from "@/src/types/commonTypes";
6 5 import { RequestHandler } from "express";
Modified src/controllers/api/updateSessionController.ts +0 -1
@@ -1,6 +1,5 @@
1 1 import { RequestHandler } from "express";
2 2 import { updateSession } from "@/src/managers/sessionManager";
3 import { logger } from "@/src/utils/logger";
4 3
5 4 const updateSessionGetController: RequestHandler = (_req, res) => {
6 5 res.json({});
Modified src/controllers/dynamic/worldStateController.ts +0 -1
@@ -1,5 +1,4 @@
1 1 import { RequestHandler } from "express";
2 import config from "@/config.json";
3 2 import worldState from "@/static/fixed_responses/worldState.json";
4 3
5 4 const worldStateController: RequestHandler = (_req, res) => {
Modified src/controllers/stats/viewController.ts +1 -1
Modified src/helpers/purchaseHelpers.ts +0 -1
Modified src/helpers/stringHelpers.ts +1 -1
Modified src/managers/sessionManager.ts +1 -1
Modified src/middleware/middleware.ts +1 -1
Modified src/models/inventoryModels/inventoryModel.ts +1 -1
Modified src/models/shipModel.ts +2 -2
Modified src/services/recipeService.ts +1 -1
Modified src/types/guildTypes.ts +0 -3
Modified src/types/inventoryTypes/inventoryTypes.ts +0 -1