返回提交历史
Modified
src/constants/gameToBuildVersion.ts
+1
-0
Modified
src/controllers/api/loginRewardsController.ts
+3
-1
Modified
src/services/loginRewardService.ts
+1
-0
XFEstudio/SpaceNinjaServer
fix: automatically claim login reward for pre-U23.10 clients (#3932)
These clients don't even have the ability to give the server back a selection, so the pick-a-doors are entirely 'rigged' with the reward already being pre-determined. Closes #3916 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/3932 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
7b5aeb77
代码差异
3 个文件
+5
-1
@@ -36,6 +36,7 @@ const gameToBuildVersion = {
36
36
"24.5.1": "2019.03.15.18.11",
37
37
"24.4.0": "2019.03.07.20.21",
38
38
"24.0.0": "2018.11.08.14.45",
39
"23.10.0": "2018.10.11.23.29",
39
40
"23.2.0": "2018.08.01.08.09",
40
41
"22.13.4": "2018.02.22.14.34",
41
42
"22.8.2": "2018.01.04.13.12",
@@ -40,10 +40,12 @@ export const loginRewardsController: RequestHandler = async (req, res) => {
40
40
// https://wiki.warframe.com/w/Login_Rewards
41
41
const is_pre_daily_tribute =
42
42
account.BuildLabel && version_compare(account.BuildLabel, gameToBuildVersion["18.0.2"]) < 0;
43
const is_pre_milestones =
44
account.BuildLabel && version_compare(account.BuildLabel, gameToBuildVersion["23.10.0"]) < 0;
43
45
44
46
if (
45
47
(!isMilestoneDay && randomRewards.length == 1) || // A choice is not needed?
46
is_pre_daily_tribute // Or client is unable to make a choice?
48
is_pre_milestones // Or client is unable to make a choice?
47
49
) {
48
50
response.DailyTributeInfo.HasChosenReward = true;
49
51
response.DailyTributeInfo.ChosenReward = randomRewards[0];
@@ -47,6 +47,7 @@ export interface ILoginReward {
47
47
//CouponSku: number;
48
48
//Rarity: number;
49
49
Transmission: string;
50
HiddenSetIndex?: number; // pre-U23.10, unsure what for
50
51
}
51
52
52
53
const scaleAmount = (day: number, amount: number, scalingMultiplier: number): number => {