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 in U5 (#3626)

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

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

代码差异

3 个文件 +10 -5
Modified src/constants/gameToBuildVersion.ts +2 -1
@@ -58,6 +58,7 @@ const gameToBuildVersion = {
58 58 "10.3.3": "2013.10.11.17.01",
59 59 "9.1.2": "2013.07.15.20.46",
60 60 "8.3.0": "2013.07.04.20.17",
61 "8.0.0": "2013.05.23.16.06"
61 "8.0.0": "2013.05.23.16.06",
62 "7.3.0": "2013.03.25.11.45"
62 63 } as const;
63 64 export default gameToBuildVersion as Record<keyof typeof gameToBuildVersion, string>;
Modified src/controllers/api/loginController.ts +7 -3
@@ -159,9 +159,11 @@ const createLoginResponse = (request: Request, account: IDatabaseAccountJson, bu
159 159 const resp: ILoginResponse = {
160 160 id: account.id,
161 161 DisplayName: account.DisplayName,
162 Nonce: account.Nonce,
163 BuildLabel: buildLabel
162 Nonce: account.Nonce
164 163 };
164 if (version_compare(buildLabel, gameToBuildVersion["7.3.0"]) >= 0) {
165 resp.BuildLabel = buildLabel; // U5 no likey
166 }
165 167 if (version_compare(buildLabel, gameToBuildVersion["13.0.0"]) >= 0) {
166 168 // U13 and up
167 169 resp.CountryCode = account.CountryCode;
@@ -169,7 +171,9 @@ const createLoginResponse = (request: Request, account: IDatabaseAccountJson, bu
169 171 // U12 and down
170 172 resp.NatHash =
171 173 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
172 resp.SteamId = "0";
174 if (version_compare(buildLabel, gameToBuildVersion["7.3.0"]) >= 0) {
175 resp.SteamId = "0"; // U5 no likey
176 }
173 177 }
174 178 if (version_compare(buildLabel, gameToBuildVersion["15.14.1"]) >= 0) {
175 179 resp.NRS = [(config.nrsAddress || "%THIS_MACHINE%").split("%THIS_MACHINE%").join(myAddress)];
Modified src/types/loginTypes.ts +1 -1
@@ -63,7 +63,7 @@ export interface ILoginRequest {
63 63 export interface ILoginResponse extends IAccountAndLoginResponseCommons {
64 64 id: string;
65 65 Groups?: IGroup[];
66 BuildLabel: string;
66 BuildLabel?: string;
67 67 MatchmakingBuildId?: string;
68 68 platformCDNs?: string[];
69 69 NRS?: string[];