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

XFESpaceNinjaServer

A simple server for a small space ninja game

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

XFEstudio/XFESpaceNinjaServer

fix: login failure on U16 (#1991)

Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1991 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>

460deed3
Sainan <63328889+Sainan@users.noreply.github.com>
提交于

代码差异

2 个文件 +11 -8
Modified src/controllers/api/loginController.ts +6 -3
@@ -41,7 +41,7 @@ export const loginController: RequestHandler = async (request, response) => {
41 41 email: loginRequest.email,
42 42 password: loginRequest.password,
43 43 DisplayName: name,
44 CountryCode: loginRequest.lang.toUpperCase(),
44 CountryCode: loginRequest.lang?.toUpperCase() ?? "EN",
45 45 ClientType: loginRequest.ClientType == "webui-register" ? "webui" : loginRequest.ClientType,
46 46 CrossPlatformAllowed: true,
47 47 ForceLogoutVersion: 0,
@@ -91,7 +91,7 @@ export const loginController: RequestHandler = async (request, response) => {
91 91
92 92 account.ClientType = loginRequest.ClientType;
93 93 account.Nonce = nonce;
94 account.CountryCode = loginRequest.lang.toUpperCase();
94 account.CountryCode = loginRequest.lang?.toUpperCase() ?? "EN";
95 95 account.BuildLabel = buildLabel;
96 96 }
97 97 await account.save();
@@ -107,10 +107,13 @@ const createLoginResponse = (myAddress: string, account: IDatabaseAccountJson, b
107 107 AmazonAuthToken: account.AmazonAuthToken,
108 108 AmazonRefreshToken: account.AmazonRefreshToken,
109 109 Nonce: account.Nonce,
110 IRC: config.myIrcAddresses ?? [myAddress],
111 110 NRS: config.NRS,
112 111 BuildLabel: buildLabel
113 112 };
113 if (version_compare(buildLabel, "2015.05.14.16.29") >= 0) {
114 // U17 and up
115 resp.IRC = config.myIrcAddresses ?? [myAddress];
116 }
114 117 if (version_compare(buildLabel, "2018.11.08.14.45") >= 0) {
115 118 // U24 and up
116 119 resp.ConsentNeeded = account.ConsentNeeded;
Modified src/types/loginTypes.ts +5 -5
@@ -35,11 +35,11 @@ export interface ILoginRequest {
35 35 email: string;
36 36 password: string;
37 37 time: number;
38 s: string;
39 lang: string;
38 s?: string;
39 lang?: string;
40 40 date: number;
41 ClientType: string;
42 PS: string;
41 ClientType?: string;
42 PS?: string;
43 43 kick?: boolean;
44 44 }
45 45
@@ -51,7 +51,7 @@ export interface ILoginResponse extends IAccountAndLoginResponseCommons {
51 51 platformCDNs?: string[];
52 52 NRS?: string[];
53 53 DTLS?: number;
54 IRC: string[];
54 IRC?: string[];
55 55 HUB?: string;
56 56 }
57 57