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(webui): max rank all intrinsics (#1230)

Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1230

2334e764
Sainan <sainan@calamity.inc>
提交于

代码差异

10 个文件 +38 -4
Modified src/controllers/api/playerSkillsController.ts +1 -1
@@ -6,7 +6,7 @@ import { RequestHandler } from "express";
6 6
7 7 export const playerSkillsController: RequestHandler = async (req, res) => {
8 8 const accountId = await getAccountIdForRequest(req);
9 const inventory = await getInventory(accountId);
9 const inventory = await getInventory(accountId, "PlayerSkills");
10 10 const request = getJSONfromString<IPlayerSkillsRequest>(String(req.body));
11 11
12 12 const oldRank: number = inventory.PlayerSkills[request.Skill as keyof IPlayerSkills];
Added src/controllers/custom/unlockAllIntrinsicsController.ts +19 -0
@@ -0,0 +1,19 @@
1 import { getInventory } from "@/src/services/inventoryService";
2 import { getAccountIdForRequest } from "@/src/services/loginService";
3 import { RequestHandler } from "express";
4
5 export const unlockAllIntrinsicsController: RequestHandler = async (req, res) => {
6 const accountId = await getAccountIdForRequest(req);
7 const inventory = await getInventory(accountId, "PlayerSkills");
8 inventory.PlayerSkills.LPS_PILOTING = 10;
9 inventory.PlayerSkills.LPS_GUNNERY = 10;
10 inventory.PlayerSkills.LPS_TACTICAL = 10;
11 inventory.PlayerSkills.LPS_ENGINEERING = 10;
12 inventory.PlayerSkills.LPS_COMMAND = 10;
13 inventory.PlayerSkills.LPS_DRIFT_COMBAT = 10;
14 inventory.PlayerSkills.LPS_DRIFT_RIDING = 10;
15 inventory.PlayerSkills.LPS_DRIFT_OPPORTUNITY = 10;
16 inventory.PlayerSkills.LPS_DRIFT_ENDURANCE = 10;
17 await inventory.save();
18 res.end();
19 };
Modified src/routes/custom.ts +2 -0
@@ -8,6 +8,7 @@ import { deleteAccountController } from "@/src/controllers/custom/deleteAccountC
8 8 import { getNameController } from "@/src/controllers/custom/getNameController";
9 9 import { renameAccountController } from "@/src/controllers/custom/renameAccountController";
10 10 import { ircDroppedController } from "@/src/controllers/custom/ircDroppedController";
11 import { unlockAllIntrinsicsController } from "@/src/controllers/custom/unlockAllIntrinsicsController";
11 12
12 13 import { createAccountController } from "@/src/controllers/custom/createAccountController";
13 14 import { createMessageController } from "@/src/controllers/custom/createMessageController";
@@ -30,6 +31,7 @@ customRouter.get("/deleteAccount", deleteAccountController);
30 31 customRouter.get("/getName", getNameController);
31 32 customRouter.get("/renameAccount", renameAccountController);
32 33 customRouter.get("/ircDropped", ircDroppedController);
34 customRouter.get("/unlockAllIntrinsics", unlockAllIntrinsicsController);
33 35
34 36 customRouter.post("/createAccount", createAccountController);
35 37 customRouter.post("/createMessage", createMessageController);
Modified static/webui/index.html +5 -3
@@ -562,8 +562,11 @@
562 562 <div class="card mb-3">
563 563 <h5 class="card-header" data-loc="cheats_account"></h5>
564 564 <div class="card-body">
565 <p><button class="btn btn-primary" onclick="doUnlockAllFocusSchools();" data-loc="cheats_unlockAllFocusSchools"></button></p>
566 <button class="btn btn-primary" onclick="doHelminthUnlockAll();" data-loc="cheats_helminthUnlockAll"></button>
565 <div class="mb-2 d-flex flex-wrap gap-2">
566 <button class="btn btn-primary" onclick="doUnlockAllFocusSchools();" data-loc="cheats_unlockAllFocusSchools"></button>
567 <button class="btn btn-primary" onclick="doHelminthUnlockAll();" data-loc="cheats_helminthUnlockAll"></button>
568 <button class="btn btn-primary" onclick="doIntrinsicsUnlockAll();" data-loc="cheats_intrinsicsUnlockAll"></button>
569 </div>
567 570 <form class="mt-2" onsubmit="doChangeSupportedSyndicate(); return false;">
568 571 <label class="form-label" for="changeSyndicate" data-loc="cheats_changeSupportedSyndicate"></label>
569 572 <div class="input-group">
@@ -578,7 +581,6 @@
578 581 <button class="btn btn-primary" onclick="doQuestUpdate('completeAllUnlocked');" data-loc="cheats_quests_completeAllUnlocked"></button>
579 582 <button class="btn btn-primary" onclick="doQuestUpdate('ResetAll');" data-loc="cheats_quests_resetAll"></button>
580 583 <button class="btn btn-primary" onclick="doQuestUpdate('giveAll');" data-loc="cheats_quests_giveAll"></button>
581
582 584 </div>
583 585 </div>
584 586 </div>
Modified static/webui/script.js +6 -0
@@ -1053,6 +1053,12 @@ function doHelminthUnlockAll() {
1053 1053 });
1054 1054 }
1055 1055
1056 function doIntrinsicsUnlockAll() {
1057 revalidateAuthz(() => {
1058 $.get("/custom/unlockAllIntrinsics?" + window.authz);
1059 });
1060 }
1061
1056 1062 function doAddAllMods() {
1057 1063 let modsAll = new Set();
1058 1064 for (const child of document.getElementById("datalist-mods").children) {
Modified static/webui/translations/de.js +1 -0
@@ -123,6 +123,7 @@ dict = {
123 123 cheats_account: `Account`,
124 124 cheats_unlockAllFocusSchools: `Alle Fokus-Schulen freischalten`,
125 125 cheats_helminthUnlockAll: `Helminth vollständig aufleveln`,
126 cheats_intrinsicsUnlockAll: `[UNTRANSLATED] Max Rank All Intrinsics`,
126 127 cheats_changeSupportedSyndicate: `Unterstütztes Syndikat`,
127 128 cheats_changeButton: `Ändern`,
128 129 cheats_none: `Keines`,
Modified static/webui/translations/en.js +1 -0
@@ -122,6 +122,7 @@ dict = {
122 122 cheats_account: `Account`,
123 123 cheats_unlockAllFocusSchools: `Unlock All Focus Schools`,
124 124 cheats_helminthUnlockAll: `Fully Level Up Helminth`,
125 cheats_intrinsicsUnlockAll: `Max Rank All Intrinsics`,
125 126 cheats_changeSupportedSyndicate: `Supported syndicate`,
126 127 cheats_changeButton: `Change`,
127 128 cheats_none: `None`,
Modified static/webui/translations/fr.js +1 -0
@@ -123,6 +123,7 @@ dict = {
123 123 cheats_account: `Compte`,
124 124 cheats_unlockAllFocusSchools: `Débloquer toutes les écoles de focus`,
125 125 cheats_helminthUnlockAll: `Helminth niveau max`,
126 cheats_intrinsicsUnlockAll: `[UNTRANSLATED] Max Rank All Intrinsics`,
126 127 cheats_changeSupportedSyndicate: `Allégeance`,
127 128 cheats_changeButton: `Changer`,
128 129 cheats_none: `Aucun`,
Modified static/webui/translations/ru.js +1 -0
@@ -123,6 +123,7 @@ dict = {
123 123 cheats_account: `Аккаунт`,
124 124 cheats_unlockAllFocusSchools: `Разблокировать все школы фокуса`,
125 125 cheats_helminthUnlockAll: `Полностью улучшить Гельминта`,
126 cheats_intrinsicsUnlockAll: `[UNTRANSLATED] Max Rank All Intrinsics`,
126 127 cheats_changeSupportedSyndicate: `Поддерживаемый синдикат`,
127 128 cheats_changeButton: `Изменить`,
128 129 cheats_none: `Отсутствует`,
Modified static/webui/translations/zh.js +1 -0
@@ -123,6 +123,7 @@ dict = {
123 123 cheats_account: `账户`,
124 124 cheats_unlockAllFocusSchools: `解锁所有专精学派`,
125 125 cheats_helminthUnlockAll: `完全升级Helminth`,
126 cheats_intrinsicsUnlockAll: `[UNTRANSLATED] Max Rank All Intrinsics`,
126 127 cheats_changeSupportedSyndicate: `支持的集团`,
127 128 cheats_changeButton: `更改`,
128 129 cheats_none: `无`,