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,
"buildLabel": "2023.08.31.08.49/GF1WtVJD8oH48xuIF4Cm-A",
"matchmakingBuildId": "2303555329115379348",
"version": "33.6.7",
"buildLabel": "2023.08.31.08.49/brZhF2aVfaQsmU9STfvSqQ",
"matchmakingBuildId": "5359904157077190191",
"version": "33.6.8",
"worldSeed": "Y7nz7/N46OXUuG0UFBiaQhuY59a8IR8fIpwPJu3Uw0y0WGqS1BTISQ3FiQ4RV2Q4L19X7rr9864tDFU2xklR+PvdayCI+/+07iHK2LzxoaSRysylW/3U5rINPDLA4akw5LwsMltL3VuEyxvn9MXKamUO27i+lP5Bsg6Fbmx4UwgqOjQaYMjAqPn0yy+VY6vZsQJFCCLM5wDghhpcwDuTFzakKiq4N5nKPc7+VPNDRKE6qlMzPRt9DCzrtpakn6/WdFecmt9Gzl/HFe1fmZSYE1bEbvL93d1Nvi391YZNLIlRqSg/h+Hirbw8pT7xxbgsXVyJo/TbyivwyQt/ay70Vw==",
"skipStoryModeChoice": 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 testMissions from "@/static/fixed_responses/testMissions.json";
import testQuestKeys from "@/static/fixed_responses/testQuestKeys.json";
import testInventory from "../../../static/testInventory.json";
const inventoryController: RequestHandler = async (request: Request, response: Response) => {
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.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);
};

View File

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

View File

@ -3,9 +3,6 @@ import config from "@/config.json";
import worldState from "@/static/fixed_responses/worldState.json";
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);
};

View File

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

View File

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

View File

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

File diff suppressed because it is too large Load Diff