update 33.6.8 and initial mastery rank

This commit is contained in:
Ordis 2023-09-09 18:44:18 +02:00
parent 3a4d117f62
commit def75cb5de
9 changed files with 1223 additions and 1533 deletions

View File

@ -1,8 +1,8 @@
{ {
"autoCreateAccount": true, "autoCreateAccount": true,
"buildLabel": "2023.08.31.08.49/GF1WtVJD8oH48xuIF4Cm-A", "buildLabel": "2023.08.31.08.49/brZhF2aVfaQsmU9STfvSqQ",
"matchmakingBuildId": "2303555329115379348", "matchmakingBuildId": "5359904157077190191",
"version": "33.6.7", "version": "33.6.8",
"worldSeed": "Y7nz7/N46OXUuG0UFBiaQhuY59a8IR8fIpwPJu3Uw0y0WGqS1BTISQ3FiQ4RV2Q4L19X7rr9864tDFU2xklR+PvdayCI+/+07iHK2LzxoaSRysylW/3U5rINPDLA4akw5LwsMltL3VuEyxvn9MXKamUO27i+lP5Bsg6Fbmx4UwgqOjQaYMjAqPn0yy+VY6vZsQJFCCLM5wDghhpcwDuTFzakKiq4N5nKPc7+VPNDRKE6qlMzPRt9DCzrtpakn6/WdFecmt9Gzl/HFe1fmZSYE1bEbvL93d1Nvi391YZNLIlRqSg/h+Hirbw8pT7xxbgsXVyJo/TbyivwyQt/ay70Vw==", "worldSeed": "Y7nz7/N46OXUuG0UFBiaQhuY59a8IR8fIpwPJu3Uw0y0WGqS1BTISQ3FiQ4RV2Q4L19X7rr9864tDFU2xklR+PvdayCI+/+07iHK2LzxoaSRysylW/3U5rINPDLA4akw5LwsMltL3VuEyxvn9MXKamUO27i+lP5Bsg6Fbmx4UwgqOjQaYMjAqPn0yy+VY6vZsQJFCCLM5wDghhpcwDuTFzakKiq4N5nKPc7+VPNDRKE6qlMzPRt9DCzrtpakn6/WdFecmt9Gzl/HFe1fmZSYE1bEbvL93d1Nvi391YZNLIlRqSg/h+Hirbw8pT7xxbgsXVyJo/TbyivwyQt/ay70Vw==",
"skipStoryModeChoice": true, "skipStoryModeChoice": true,
"skipTutorial": true, "skipTutorial": true,

View File

@ -0,0 +1,14 @@
const millisecondsPerSecond = 1000;
const secondsPerMinute = 60;
const minutesPerHour = 60;
const hoursPerDay = 24;
const unixMinute = secondsPerMinute * millisecondsPerSecond;
const unixHour = unixMinute * minutesPerHour;
const unixDay = hoursPerDay * unixHour;
export const unixTimesInMs = {
minute: unixMinute,
hour: unixHour,
day: unixDay
};

View File

@ -5,7 +5,6 @@ import { Request, RequestHandler, Response } from "express";
import config from "@/config.json"; import config from "@/config.json";
import testMissions from "@/static/fixed_responses/testMissions.json"; import testMissions from "@/static/fixed_responses/testMissions.json";
import testQuestKeys from "@/static/fixed_responses/testQuestKeys.json"; import testQuestKeys from "@/static/fixed_responses/testQuestKeys.json";
import testInventory from "../../../static/testInventory.json";
const inventoryController: RequestHandler = async (request: Request, response: Response) => { const inventoryController: RequestHandler = async (request: Request, response: Response) => {
const accountId = request.query.accountId; const accountId = request.query.accountId;
@ -29,10 +28,6 @@ const inventoryController: RequestHandler = async (request: Request, response: R
if (config.testMission) inventoryResponse.Missions = testMissions; if (config.testMission) inventoryResponse.Missions = testMissions;
if (config.testQuestKey) inventoryResponse.QuestKeys = testQuestKeys; if (config.testQuestKey) inventoryResponse.QuestKeys = testQuestKeys;
const now = Math.floor(Date.now()) - 129600;
const date: string = (now + 24 * 60 * 60 * 1000).toString();
inventoryResponse.TrainingDate = { $date: { $numberLong: "1693769173000" } };
console.log(inventoryResponse.TrainingDate);
response.json(inventoryResponse); response.json(inventoryResponse);
}; };

View File

@ -2,50 +2,43 @@ import { parseString } from "@/src/helpers/general";
import { getJSONfromString } from "@/src/helpers/stringHelpers"; import { getJSONfromString } from "@/src/helpers/stringHelpers";
import { Inventory } from "@/src/models/inventoryModel"; import { Inventory } from "@/src/models/inventoryModel";
import { getInventory } from "@/src/services/inventoryService"; import { getInventory } from "@/src/services/inventoryService";
import { IMongoDate } from "@/src/types/commonTypes";
import { RequestHandler } from "express"; import { RequestHandler } from "express";
import { unixTimesInMs } from "@/src/constants/timeConstants";
interface ITrainingResultsRequest { interface ITrainingResultsRequest {
numLevelsGained: number; numLevelsGained: number;
} }
const epochDay = 86400 * 1000; // in ms interface ITrainingResultsResponse {
const timeNow = Date.now() + epochDay; NewTrainingDate: IMongoDate;
NewLevel: number;
InventoryChanges: any[];
}
// eslint-disable-next-line @typescript-eslint/no-misused-promises // eslint-disable-next-line @typescript-eslint/no-misused-promises
const trainingResultController: RequestHandler = async (req, res): Promise<void> => { const trainingResultController: RequestHandler = async (req, res): Promise<void> => {
console.log(req.body.toString());
const accountId = parseString(req.query.accountId); const accountId = parseString(req.query.accountId);
const trainingResults = getJSONfromString(req.body.toString()) as ITrainingResultsRequest; const trainingResults = getJSONfromString(req.body.toString()) as ITrainingResultsRequest;
const nextTrainingDate = Date.now().toString;
if (trainingResults.numLevelsGained == 0) {
res.json({
NewTrainingDate: {
$date: { $numberLong: nextTrainingDate }
},
NewLevel: 0,
InventoryChanges: []
});
}
const inventory = await getInventory(accountId); const inventory = await getInventory(accountId);
console.log("inventory", inventory.TrainingDate); inventory.TrainingDate = new Date(Date.now() + unixTimesInMs.day);
inventory.TrainingDate = new Date(Date.now() + epochDay * 500);
console.log("inventory after", inventory.TrainingDate);
await inventory.save();
if (trainingResults.numLevelsGained == 1) { if (trainingResults.numLevelsGained == 1) {
inventory.PlayerLevel += 1;
}
const changedinventory = await inventory.save();
res.json({ res.json({
NewTrainingDate: { NewTrainingDate: {
$date: { $numberLong: nextTrainingDate } $date: { $numberLong: changedinventory.TrainingDate.getTime().toString() }
}, },
NewLevel: 1, NewLevel: trainingResults.numLevelsGained == 1 ? changedinventory.PlayerLevel : inventory.PlayerLevel,
InventoryChanges: [] InventoryChanges: []
}); } satisfies ITrainingResultsResponse);
}
}; };
export { trainingResultController }; export { trainingResultController };

View File

@ -3,9 +3,6 @@ import config from "@/config.json";
import worldState from "@/static/fixed_responses/worldState.json"; import worldState from "@/static/fixed_responses/worldState.json";
const worldStateController: RequestHandler = (_req, res) => { const worldStateController: RequestHandler = (_req, res) => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
worldState.WorldSeed = config.worldSeed;
worldState.BuildLabel = config.buildLabel;
res.json(worldState); res.json(worldState);
}; };

View File

@ -9,7 +9,7 @@ import {
IInventoryDatabaseDocument, IInventoryDatabaseDocument,
IInventoryResponseDocument IInventoryResponseDocument
} from "../types/inventoryTypes/inventoryTypes"; } from "../types/inventoryTypes/inventoryTypes";
import { Oid } from "../types/commonTypes"; import { IMongoDate, Oid } from "../types/commonTypes";
import { ISuitDatabase, ISuitDocument } from "@/src/types/inventoryTypes/SuitTypes"; import { ISuitDatabase, ISuitDocument } from "@/src/types/inventoryTypes/SuitTypes";
import { IWeaponDatabase } from "@/src/types/inventoryTypes/weaponTypes"; import { IWeaponDatabase } from "@/src/types/inventoryTypes/weaponTypes";
@ -163,7 +163,7 @@ FlavourItemSchema.set("toJSON", {
} }
}); });
const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>({ const inventorySchema = new Schema<IInventoryDatabaseDocument, InventoryDocumentProps>({
accountOwnerId: Schema.Types.ObjectId, accountOwnerId: Schema.Types.ObjectId,
SubscribedToEmails: Number, SubscribedToEmails: Number,
Created: Schema.Types.Mixed, Created: Schema.Types.Mixed,
@ -336,17 +336,17 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>({
}); });
inventorySchema.set("toJSON", { inventorySchema.set("toJSON", {
transform(_document, returnedObject: IInventoryDatabaseDocument) { transform(_document, returnedObject) {
delete returnedObject._id; delete returnedObject._id;
delete returnedObject.__v; delete returnedObject.__v;
const trainingDate = returnedObject.TrainingDate; const trainingDate = (returnedObject as IInventoryDatabaseDocument).TrainingDate;
(returnedObject as unknown as IInventoryResponse).TrainingDate = { (returnedObject as IInventoryResponse).TrainingDate = {
$date: { $date: {
$numberLong: trainingDate.getTime().toString() $numberLong: trainingDate.getTime().toString()
} }
}; } satisfies IMongoDate;
} }
}); });

View File

@ -2,7 +2,7 @@ export interface Oid {
$oid: string; $oid: string;
} }
export interface BSONDate { export interface IMongoDate {
$date: { $date: {
$numberLong: string; $numberLong: string;
}; };

View File

@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/no-explicit-any */
import { Document, Types } from "mongoose"; import { Document, Types } from "mongoose";
import { Oid, BSONDate } from "../commonTypes"; import { Oid, IMongoDate } from "../commonTypes";
import { AbilityOverride, Color, FocusSchool, Polarity } from "@/src/types/inventoryTypes/commonInventoryTypes"; import { AbilityOverride, Color, FocusSchool, Polarity } from "@/src/types/inventoryTypes/commonInventoryTypes";
import { ISuitDatabase } from "@/src/types/inventoryTypes/SuitTypes"; import { ISuitDatabase } from "@/src/types/inventoryTypes/SuitTypes";
import { OperatorLoadOutSigcol, IWeaponDatabase } from "@/src/types/inventoryTypes/weaponTypes"; import { OperatorLoadOutSigcol, IWeaponDatabase } from "@/src/types/inventoryTypes/weaponTypes";
@ -13,9 +13,10 @@ export interface IInventoryDatabase extends Omit<IInventoryResponse, "TrainingDa
} }
export interface IInventoryResponseDocument extends IInventoryResponse, Document {} export interface IInventoryResponseDocument extends IInventoryResponse, Document {}
export interface IInventoryResponse { export interface IInventoryResponse {
SubscribedToEmails: number; SubscribedToEmails: number;
Created: BSONDate; Created: IMongoDate;
RewardSeed: number; RewardSeed: number;
RegularCredits: number; RegularCredits: number;
PremiumCredits: number; PremiumCredits: number;
@ -59,7 +60,7 @@ export interface IInventoryResponse {
Recipes: Consumable[]; Recipes: Consumable[];
WeaponSkins: WeaponSkin[]; WeaponSkins: WeaponSkin[];
PendingRecipes: PendingRecipe[]; PendingRecipes: PendingRecipe[];
TrainingDate: BSONDate; TrainingDate: IMongoDate;
PlayerLevel: number; PlayerLevel: number;
Upgrades: CrewShipSalvagedWeaponSkin[]; Upgrades: CrewShipSalvagedWeaponSkin[];
EquippedGear: string[]; EquippedGear: string[];
@ -136,7 +137,7 @@ export interface IInventoryResponse {
InvasionChainProgress: InvasionChainProgress[]; InvasionChainProgress: InvasionChainProgress[];
DataKnives: DataKnife[]; DataKnives: DataKnife[];
NemesisHistory: NemesisHistory[]; NemesisHistory: NemesisHistory[];
LastNemesisAllySpawnTime: BSONDate; LastNemesisAllySpawnTime: IMongoDate;
Settings: Settings; Settings: Settings;
PersonalTechProjects: PersonalTechProject[]; PersonalTechProjects: PersonalTechProject[];
CrewShips: CrewShip[]; CrewShips: CrewShip[];
@ -147,7 +148,7 @@ export interface IInventoryResponse {
CrewShipWeapons: CrewShipWeapon[]; CrewShipWeapons: CrewShipWeapon[];
CrewShipSalvagedWeapons: CrewShipWeapon[]; CrewShipSalvagedWeapons: CrewShipWeapon[];
CrewShipWeaponSkins: CrewShipSalvagedWeaponSkin[]; CrewShipWeaponSkins: CrewShipSalvagedWeaponSkin[];
TradeBannedUntil: BSONDate; TradeBannedUntil: IMongoDate;
PlayedParkourTutorial: boolean; PlayedParkourTutorial: boolean;
SubscribedToEmailsPersonalized: number; SubscribedToEmailsPersonalized: number;
MechBin: CrewMemberBinClass; MechBin: CrewMemberBinClass;
@ -155,7 +156,7 @@ export interface IInventoryResponse {
DailyAffiliationNecraloid: number; DailyAffiliationNecraloid: number;
MechSuits: MechSuit[]; MechSuits: MechSuit[];
InfestedFoundry: InfestedFoundry; InfestedFoundry: InfestedFoundry;
BlessingCooldown: BSONDate; BlessingCooldown: IMongoDate;
CrewMemberBin: CrewMemberBinClass; CrewMemberBin: CrewMemberBinClass;
CrewShipHarnesses: CrewShipHarness[]; CrewShipHarnesses: CrewShipHarness[];
CrewShipRawSalvage: Consumable[]; CrewShipRawSalvage: Consumable[];
@ -167,7 +168,7 @@ export interface IInventoryResponse {
NemesisAbandonedRewards: string[]; NemesisAbandonedRewards: string[];
DailyAffiliationKahl: number; DailyAffiliationKahl: number;
LastInventorySync: Oid; LastInventorySync: Oid;
NextRefill: BSONDate; NextRefill: IMongoDate;
ActiveLandscapeTraps: any[]; ActiveLandscapeTraps: any[];
EvolutionProgress: any[]; EvolutionProgress: any[];
RepVotes: any[]; RepVotes: any[];
@ -268,7 +269,7 @@ export interface CrewMember {
ItemType: string; ItemType: string;
NemesisFingerprint: number; NemesisFingerprint: number;
Seed: number; Seed: number;
HireDate: BSONDate; HireDate: IMongoDate;
AssignedRole: number; AssignedRole: number;
SkillEfficiency: SkillEfficiency; SkillEfficiency: SkillEfficiency;
WeaponConfigIdx: number; WeaponConfigIdx: number;
@ -431,7 +432,7 @@ export interface Drone {
ItemType: string; ItemType: string;
CurrentHP: number; CurrentHP: number;
ItemId: Oid; ItemId: Oid;
RepairStart?: BSONDate; RepairStart?: IMongoDate;
} }
export interface EmailItem { export interface EmailItem {
@ -519,7 +520,7 @@ export interface InvasionChainProgress {
export interface KubrowPetEgg { export interface KubrowPetEgg {
ItemType: KubrowPetEggItemType; ItemType: KubrowPetEggItemType;
ExpirationDate: BSONDate; ExpirationDate: IMongoDate;
ItemId: Oid; ItemId: Oid;
} }
@ -572,7 +573,7 @@ export interface KubrowPet {
Polarized?: number; Polarized?: number;
Polarity?: Polarity[]; Polarity?: Polarity[];
Features?: number; Features?: number;
InfestationDate?: BSONDate; InfestationDate?: IMongoDate;
InfestationDays?: number; InfestationDays?: number;
InfestationType?: string; InfestationType?: string;
ItemId: Oid; ItemId: Oid;
@ -592,7 +593,7 @@ export interface Details {
HasCollar: boolean; HasCollar: boolean;
PrintsRemaining: number; PrintsRemaining: number;
Status: Status; Status: Status;
HatchDate: BSONDate; HatchDate: IMongoDate;
DominantTraits: Traits; DominantTraits: Traits;
RecessiveTraits: Traits; RecessiveTraits: Traits;
IsMale: boolean; IsMale: boolean;
@ -735,7 +736,7 @@ export interface Mission {
Completes: number; Completes: number;
Tier?: number; Tier?: number;
Tag: string; Tag: string;
RewardsCooldownTime?: BSONDate; RewardsCooldownTime?: IMongoDate;
} }
export interface MoaPet { export interface MoaPet {
@ -760,7 +761,7 @@ export interface NemesisHistory {
BirthNode: BirthNode; BirthNode: BirthNode;
Rank: number; Rank: number;
k: boolean; k: boolean;
d: BSONDate; d: IMongoDate;
GuessHistory?: number[]; GuessHistory?: number[];
currentGuess?: number; currentGuess?: number;
Traded?: boolean; Traded?: boolean;
@ -809,13 +810,13 @@ export interface OperatorLoadOut {
} }
export interface PendingCoupon { export interface PendingCoupon {
Expiry: BSONDate; Expiry: IMongoDate;
Discount: number; Discount: number;
} }
export interface PendingRecipe { export interface PendingRecipe {
ItemType: string; ItemType: string;
CompletionDate: BSONDate; CompletionDate: IMongoDate;
ItemId: Oid; ItemId: Oid;
} }
@ -874,7 +875,7 @@ export enum GivingSlotOrderInfo {
} }
export interface PeriodicMissionCompletion { export interface PeriodicMissionCompletion {
date: BSONDate; date: IMongoDate;
tag: string; tag: string;
count?: number; count?: number;
} }
@ -893,7 +894,7 @@ export interface PersonalTechProject {
ReqCredits: number; ReqCredits: number;
ItemType: string; ItemType: string;
ReqItems: Consumable[]; ReqItems: Consumable[];
CompletionDate?: BSONDate; CompletionDate?: IMongoDate;
ItemId: Oid; ItemId: Oid;
ProductCategory?: string; ProductCategory?: string;
CategoryItemId?: Oid; CategoryItemId?: Oid;
@ -914,7 +915,7 @@ export interface QuestKey {
unlock?: boolean; unlock?: boolean;
Completed?: boolean; Completed?: boolean;
ItemType: string; ItemType: string;
CompletionDate?: BSONDate; CompletionDate?: IMongoDate;
} }
export interface Progress { export interface Progress {
@ -1091,15 +1092,15 @@ export interface WebFlags {
activeBuyPlat: number; activeBuyPlat: number;
noShow2FA: boolean; noShow2FA: boolean;
Tennocon2018Digital: boolean; Tennocon2018Digital: boolean;
VisitPrimeAccess: BSONDate; VisitPrimeAccess: IMongoDate;
VisitTennocon2019: BSONDate; VisitTennocon2019: IMongoDate;
enteredSC2019: BSONDate; enteredSC2019: IMongoDate;
VisitPrimeVault: BSONDate; VisitPrimeVault: IMongoDate;
VisitBuyPlatinum: BSONDate; VisitBuyPlatinum: IMongoDate;
ClickedSku_640_Page__en_buyplatinum: BSONDate; ClickedSku_640_Page__en_buyplatinum: IMongoDate;
ClickedSku_640_Page__buyplatinum: BSONDate; ClickedSku_640_Page__buyplatinum: IMongoDate;
VisitStarterPack: BSONDate; VisitStarterPack: IMongoDate;
Tennocon2020Digital: boolean; Tennocon2020Digital: boolean;
Anniversary2021: boolean; Anniversary2021: boolean;
HitDownloadBtn: BSONDate; HitDownloadBtn: IMongoDate;
} }

File diff suppressed because it is too large Load Diff