feat: playedParkourTutorial #1579
							
								
								
									
										9
									
								
								src/controllers/api/playedParkourTutorialController.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								src/controllers/api/playedParkourTutorialController.ts
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,9 @@
 | 
			
		||||
import { Inventory } from "@/src/models/inventoryModels/inventoryModel";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
export const playedParkourTutorialController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
    await Inventory.updateOne({ accountOwnerId: accountId }, { PlayedParkourTutorial: true });
 | 
			
		||||
    res.end();
 | 
			
		||||
};
 | 
			
		||||
@ -85,6 +85,7 @@ import { modularWeaponSaleController } from "@/src/controllers/api/modularWeapon
 | 
			
		||||
import { nameWeaponController } from "@/src/controllers/api/nameWeaponController";
 | 
			
		||||
import { nemesisController } from "@/src/controllers/api/nemesisController";
 | 
			
		||||
import { placeDecoInComponentController } from "@/src/controllers/api/placeDecoInComponentController";
 | 
			
		||||
import { playedParkourTutorialController } from "@/src/controllers/api/playedParkourTutorialController";
 | 
			
		||||
import { playerSkillsController } from "@/src/controllers/api/playerSkillsController";
 | 
			
		||||
import { postGuildAdvertisementController } from "@/src/controllers/api/postGuildAdvertisementController";
 | 
			
		||||
import { projectionManagerController } from "@/src/controllers/api/projectionManagerController";
 | 
			
		||||
@ -177,6 +178,7 @@ apiRouter.get("/logout.php", logoutController);
 | 
			
		||||
apiRouter.get("/marketRecommendations.php", marketRecommendationsController);
 | 
			
		||||
apiRouter.get("/marketSearchRecommendations.php", marketRecommendationsController);
 | 
			
		||||
apiRouter.get("/modularWeaponSale.php", modularWeaponSaleController);
 | 
			
		||||
apiRouter.get("/playedParkourTutorial.php", playedParkourTutorialController);
 | 
			
		||||
apiRouter.get("/queueDojoComponentDestruction.php", queueDojoComponentDestructionController);
 | 
			
		||||
apiRouter.get("/removeFromAlliance.php", removeFromAllianceController);
 | 
			
		||||
apiRouter.get("/setActiveQuest.php", setActiveQuestController);
 | 
			
		||||
 | 
			
		||||
@ -177,7 +177,9 @@ export const addStartingGear = async (
 | 
			
		||||
        combineInventoryChanges(inventoryChanges, inventoryDelta);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    inventory.PlayedParkourTutorial = true;
 | 
			
		||||
    if (inventory.ReceivedStartingGear) {
 | 
			
		||||
        logger.warn(`account already had starting gear but asked for it again?!`);
 | 
			
		||||
    }
 | 
			
		||||
    inventory.ReceivedStartingGear = true;
 | 
			
		||||
 | 
			
		||||
    return inventoryChanges;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user