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: add cheat to jump daily tribute progression by 50-day milestones (#3724)

Adds a new account cheat, incrementDailyTributeBy50, that advances login reward progression to the next 50-day milestone whenever a daily tribute is claimed (e.g. 13->50, 50->100, 100->150). Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/3724 Reviewed-by: Sainan <63328889+sainan@users.noreply.github.com> Co-authored-by: Drake <kuzuriyager@gmail.com> Co-committed-by: Drake <kuzuriyager@gmail.com>

ac61f640
Drake <kuzuriyager@gmail.com>
提交于

代码差异

14 个文件 +25 -5
Modified src/controllers/api/giveLoginRewardController.ts +1 -1
@@ -25,7 +25,7 @@ export const giveLoginRewardController: RequestHandler = async (req, res) => {
25 25 const chosenReward = randomRewards.find(x => x.StoreItemType == body.reward.StoreItemType)!;
26 26 const inventoryChanges = await claimLoginReward(inventory, chosenReward);
27 27
28 setAccountGotLoginRewardToday(account);
28 setAccountGotLoginRewardToday(account, inventory);
29 29 await Promise.all([inventory.save(), account.save()]);
30 30
31 31 sendWsBroadcastTo(account._id.toString(), { update_inventory: true });
Modified src/controllers/api/loginRewardsController.ts +1 -1
@@ -47,7 +47,7 @@ export const loginRewardsController: RequestHandler = async (req, res) => {
47 47 response.DailyTributeInfo.HasChosenReward = true;
48 48 response.DailyTributeInfo.ChosenReward = randomRewards[0];
49 49 response.DailyTributeInfo.NewInventory = await claimLoginReward(inventory, randomRewards[0]);
50 setAccountGotLoginRewardToday(account);
50 setAccountGotLoginRewardToday(account, inventory);
51 51 await Promise.all([inventory.save(), account.save()]);
52 52
53 53 sendWsBroadcastTo(account._id.toString(), { update_inventory: true });
Modified src/controllers/api/loginRewardsSelectionController.ts +1 -1
@@ -35,7 +35,7 @@ export const loginRewardsSelectionController: RequestHandler = async (req, res)
35 35 chosenReward = randomRewards.find(x => x.StoreItemType == body.ChosenReward)!;
36 36 inventoryChanges = await claimLoginReward(inventory, chosenReward);
37 37 }
38 setAccountGotLoginRewardToday(account);
38 setAccountGotLoginRewardToday(account, inventory);
39 39 await Promise.all([inventory.save(), account.save()]);
40 40
41 41 sendWsBroadcastTo(account._id.toString(), { update_inventory: true });
Modified src/models/inventoryModels/inventoryModel.ts +1 -0
@@ -1606,6 +1606,7 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
1606 1606 flawlessRelicsAlwaysGiveSilverReward: Boolean,
1607 1607 radiantRelicsAlwaysGiveGoldReward: Boolean,
1608 1608 disableDailyTribute: Boolean,
1609 incrementDailyTributeBy50: Boolean,
1609 1610 tradesDontTouchInventory: Boolean, // API-only cheat for bot developers
1610 1611
1611 1612 nemesisHenchmenKillsMultiplierGrineer: Number,
Modified src/services/loginRewardService.ts +9 -2
@@ -174,7 +174,14 @@ export const claimLoginReward = async (
174 174 throw new Error(`unknown login reward type: ${reward.RewardType}`);
175 175 };
176 176
177 export const setAccountGotLoginRewardToday = (account: TAccountDocument): void => {
178 account.LoginDays += 1;
177 export const setAccountGotLoginRewardToday = (
178 account: TAccountDocument,
179 inventory: Pick<TInventoryDatabaseDocument, "incrementDailyTributeBy50">
180 ): void => {
181 if (inventory.incrementDailyTributeBy50) {
182 account.LoginDays = Math.max(50, (Math.trunc(account.LoginDays / 50) + 1) * 50);
183 } else {
184 account.LoginDays += 1;
185 }
179 186 account.LastLoginRewardDate = Math.trunc(Date.now() / 86400000) * 86400;
180 187 };
Modified src/types/inventoryTypes/inventoryTypes.ts +1 -0
@@ -78,6 +78,7 @@ export const accountCheatBooleans = [
78 78 "flawlessRelicsAlwaysGiveSilverReward",
79 79 "radiantRelicsAlwaysGiveGoldReward",
80 80 "disableDailyTribute",
81 "incrementDailyTributeBy50",
81 82 "tradesDontTouchInventory" // API-only cheat for bot developers
82 83 ] as const;
83 84 export const accountCheatNumbers = [
Modified static/webui/index.html +4 -0
@@ -1093,6 +1093,10 @@
1093 1093 <input class="form-check-input" type="checkbox" id="disableDailyTribute" />
1094 1094 <label class="form-check-label" for="disableDailyTribute" data-loc="cheats_disableDailyTribute"></label>
1095 1095 </div>
1096 <div class="form-check">
1097 <input class="form-check-input" type="checkbox" id="incrementDailyTributeBy50" />
1098 <label class="form-check-label" for="incrementDailyTributeBy50" data-loc="cheats_incrementDailyTributeBy50"></label>
1099 </div>
1096 1100 <div class="form-check">
1097 1101 <input class="form-check-input" type="checkbox" id="finishInvasionsInOneMission" />
1098 1102 <label class="form-check-label" for="finishInvasionsInOneMission" data-loc="cheats_finishInvasionsInOneMission"></label>
Modified static/webui/translations/de.js +1 -0
@@ -292,6 +292,7 @@ dict = {
292 292 cheats_unlockAllSimarisResearchEntries: `Alle Simaris-Forschungseinträge freischalten`,
293 293 cheats_addMissingDangerRooms: `Fehlende Simulacrum-Szenen hinzufügen`,
294 294 cheats_disableDailyTribute: `Täglicher Tribut deaktivieren`,
295 cheats_incrementDailyTributeBy50: `[UNTRANSLATED] Increment Daily Tribute to Next 50`,
295 296 cheats_spoofMasteryRank: `Gefälschter Meisterschaftsrang (-1 zum deaktivieren)`,
296 297 cheats_dailyTributeRewardMultiplier: `Belohnungsmultiplikator für Täglicher Tribut`,
297 298 cheats_relicRewardItemCountMultiplier: `Belohnungsmultiplikator für Relikte`,
Modified static/webui/translations/en.js +1 -0
@@ -291,6 +291,7 @@ dict = {
291 291 cheats_unlockAllSimarisResearchEntries: `Unlock All Simaris Research Entries`,
292 292 cheats_addMissingDangerRooms: `Add Missing Simulacrum Scenes`,
293 293 cheats_disableDailyTribute: `Disable Daily Tribute`,
294 cheats_incrementDailyTributeBy50: `Increment Daily Tribute to Next 50`,
294 295 cheats_spoofMasteryRank: `Spoofed Mastery Rank (-1 to disable)`,
295 296 cheats_dailyTributeRewardMultiplier: `Daily Tribute Reward Multiplier`,
296 297 cheats_relicRewardItemCountMultiplier: `Relic Reward Item Count Multiplier`,
Modified static/webui/translations/es.js +1 -0
@@ -292,6 +292,7 @@ dict = {
292 292 cheats_unlockAllSimarisResearchEntries: `Desbloquear todas las entradas de investigación de Simaris`,
293 293 cheats_addMissingDangerRooms: `[UNTRANSLATED] Add Missing Simulacrum Scenes`,
294 294 cheats_disableDailyTribute: `Desactivar tributo diario`,
295 cheats_incrementDailyTributeBy50: `[UNTRANSLATED] Increment Daily Tribute to Next 50`,
295 296 cheats_spoofMasteryRank: `Rango de maestría simulado (-1 para desactivar)`,
296 297 cheats_dailyTributeRewardMultiplier: `[UNTRANSLATED] Daily Tribute Reward Multiplier`,
297 298 cheats_relicRewardItemCountMultiplier: `Multiplicador de cantidad de recompensas de reliquia`,
Modified static/webui/translations/fr.js +1 -0
@@ -292,6 +292,7 @@ dict = {
292 292 cheats_unlockAllSimarisResearchEntries: `Débloquer toute les recherches chez Simaris`,
293 293 cheats_addMissingDangerRooms: `Ajouter les simulacres manquants`,
294 294 cheats_disableDailyTribute: `Désactiver la récompense quotidienne de connexion`,
295 cheats_incrementDailyTributeBy50: `[UNTRANSLATED] Increment Daily Tribute to Next 50`,
295 296 cheats_spoofMasteryRank: `Rang de maîtrise personnalisé (-1 pour désactiver)`,
296 297 cheats_dailyTributeRewardMultiplier: `[UNTRANSLATED] Daily Tribute Reward Multiplier`,
297 298 cheats_relicRewardItemCountMultiplier: `Multiplicateur de récompenses de relique`,
Modified static/webui/translations/ru.js +1 -0
@@ -292,6 +292,7 @@ dict = {
292 292 cheats_unlockAllSimarisResearchEntries: `Разблокировать все записи исследований Симэриса`,
293 293 cheats_addMissingDangerRooms: `Добавить отсутвующие сцены Симулякрума`,
294 294 cheats_disableDailyTribute: `Отключить ежедневные награды`,
295 cheats_incrementDailyTributeBy50: `[UNTRANSLATED] Increment Daily Tribute to Next 50`,
295 296 cheats_spoofMasteryRank: `Поддельный ранг мастерства (-1 для отключения)`,
296 297 cheats_dailyTributeRewardMultiplier: `[UNTRANSLATED] Daily Tribute Reward Multiplier`,
297 298 cheats_relicRewardItemCountMultiplier: `Мультипликатор количества предметов награды реликвии`,
Modified static/webui/translations/uk.js +1 -0
Modified static/webui/translations/zh.js +1 -0