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

SpaceNinjaServer

A simple server for a small space ninja game

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

XFEstudio/SpaceNinjaServer

feat: mastery rank up inbox message (#1206)

Closes #1203 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1206 Co-authored-by: Sainan <sainan@calamity.inc> Co-committed-by: Sainan <sainan@calamity.inc>

b4da4575
Sainan <sainan@calamity.inc>
提交于

代码差异

2 个文件 +22 -2
Modified src/controllers/api/trainingResultController.ts +20 -0
@@ -5,6 +5,7 @@ import { IMongoDate } from "@/src/types/commonTypes";
5 5 import { RequestHandler } from "express";
6 6 import { unixTimesInMs } from "@/src/constants/timeConstants";
7 7 import { IInventoryChanges } from "@/src/types/purchaseTypes";
8 import { createMessage } from "@/src/services/inboxService";
8 9
9 10 interface ITrainingResultsRequest {
10 11 numLevelsGained: number;
@@ -26,6 +27,25 @@ const trainingResultController: RequestHandler = async (req, res): Promise<void>
26 27 if (trainingResults.numLevelsGained == 1) {
27 28 inventory.TrainingDate = new Date(Date.now() + unixTimesInMs.hour * 23);
28 29 inventory.PlayerLevel += 1;
30
31 await createMessage(accountId, [
32 {
33 sndr: "/Lotus/Language/Menu/Mailbox_WarframeSender",
34 msg: "/Lotus/Language/Inbox/MasteryRewardMsg",
35 arg: [
36 {
37 Key: "NEW_RANK",
38 Tag: inventory.PlayerLevel
39 }
40 ],
41 att: [
42 `/Lotus/Types/Items/ShipDecos/MasteryTrophies/Rank${inventory.PlayerLevel.toString().padStart(2, "0")}Trophy`
43 ],
44 sub: "/Lotus/Language/Inbox/MasteryRewardTitle",
45 icon: "/Lotus/Interface/Icons/Npcs/Lotus_d.png",
46 highPriority: true
47 }
48 ]);
29 49 }
30 50
31 51 const changedinventory = await inventory.save();
Modified src/models/inboxModel.ts +2 -2
@@ -40,7 +40,7 @@ export interface IMessage {
40 40
41 41 export interface Arg {
42 42 Key: string;
43 Tag: string;
43 Tag: string | number;
44 44 }
45 45
46 46 //types are wrong
@@ -99,7 +99,7 @@ const messageSchema = new Schema<IMessageDatabase>(
99 99 type: [
100 100 {
101 101 Key: String,
102 Tag: String,
102 Tag: Schema.Types.Mixed,
103 103 _id: false
104 104 }
105 105 ],