feat: implement pledging to syndicate (#162)

This commit is contained in:
Sainan 2024-05-06 15:38:10 +02:00 committed by GitHub
parent 36ebc52696
commit fd56203f35
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1,9 @@
import { RequestHandler } from "express";
import { getInventory } from "@/src/services/inventoryService";
export const setSupportedSyndicateController: RequestHandler = async (req, res) => {
const inventory = await getInventory(req.query.accountId as string);
inventory.SupportedSyndicate = req.query.syndicate as string;
await inventory.save();
res.end();
};

View File

@ -645,6 +645,8 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
//Curent trade info Giving or Getting items //Curent trade info Giving or Getting items
PendingTrades: [Schema.Types.Mixed], PendingTrades: [Schema.Types.Mixed],
//Syndicate currently being pledged to.
SupportedSyndicate: String,
//Curent Syndicates rank\exp //Curent Syndicates rank\exp
Affiliations: [affiliationsSchema], Affiliations: [affiliationsSchema],
//Syndicates Missions complate(Navigation->Syndicate) //Syndicates Missions complate(Navigation->Syndicate)

View File

@ -46,6 +46,7 @@ import { addFriendImageController } from "@/src/controllers/api/addFriendImageCo
import { createGuildController } from "@/src/controllers/api/createGuildController"; import { createGuildController } from "@/src/controllers/api/createGuildController";
import { sellController } from "@/src/controllers/api/sellController"; import { sellController } from "@/src/controllers/api/sellController";
import { upgradesController } from "@/src/controllers/api/upgradesController"; import { upgradesController } from "@/src/controllers/api/upgradesController";
import { setSupportedSyndicateController } from "@/src/controllers/api/setSupportedSyndicateController";
const apiRouter = express.Router(); const apiRouter = express.Router();
@ -73,6 +74,7 @@ apiRouter.get("/logout.php", logoutController);
apiRouter.get("/setBootLocation.php", setBootLocationController); apiRouter.get("/setBootLocation.php", setBootLocationController);
apiRouter.get("/setActiveShip.php", setActiveShipController); apiRouter.get("/setActiveShip.php", setActiveShipController);
apiRouter.get("/getGuild.php", getGuildController); apiRouter.get("/getGuild.php", getGuildController);
apiRouter.get("/setSupportedSyndicate.php", setSupportedSyndicateController);
// post // post
// eslint-disable-next-line @typescript-eslint/no-misused-promises // eslint-disable-next-line @typescript-eslint/no-misused-promises

View File

@ -190,6 +190,7 @@ export interface IInventoryResponse {
Boosters: IBooster[]; Boosters: IBooster[];
ActiveDojoColorResearch: string; ActiveDojoColorResearch: string;
SentientSpawnChanceBoosters: ISentientSpawnChanceBoosters; SentientSpawnChanceBoosters: ISentientSpawnChanceBoosters;
SupportedSyndicate?: string;
Affiliations: IAffiliation[]; Affiliations: IAffiliation[];
QualifyingInvasions: any[]; QualifyingInvasions: any[];
FactionScores: number[]; FactionScores: number[];