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

chore: update for bootstrapper 0.13.2 (#3595)

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

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

代码差异

3 个文件 +10 -6
Modified src/controllers/api/loginController.ts +2 -5
@@ -226,11 +226,8 @@ const createLoginResponse = (request: Request, account: IDatabaseAccountJson, bu
226 226 decodeURIComponent(clientMod).startsWith("OpenWF Bootstrapper v") &&
227 227 version_compare(decodeURIComponent(clientMod).substring(21), "0.12.0") >= 0
228 228 ) {
229 const tunables = getTunablesForClient((request.socket.address() as AddressInfo).address, myAddress);
230 if (version_compare(buildLabel, gameToBuildVersion["16.5.5"]) < 0) {
231 tunables.irc = (config.ircAddress || "%THIS_MACHINE%").split("%THIS_MACHINE%").join(myAddress);
232 }
233 raw += "\t" + JSON.stringify(tunables);
229 raw +=
230 "\t" + JSON.stringify(getTunablesForClient((request.socket.address() as AddressInfo).address, myAddress));
234 231 }
235 232 return raw;
236 233 };
Modified src/services/tunablesService.ts +7 -1
@@ -18,7 +18,13 @@ export const getTokenForClient = (clientAddress: string): string => {
18 18 };
19 19
20 20 export const getTunablesForClient = (clientAddress: string, reflexiveAddress: string): ITunables => {
21 const tunables: ITunables = {};
21 const tunables: ITunables = {
22 // To successfully update the NRS address for pre-U15.14 clients, this needs to be set before login.
23 nrs: (config.nrsAddress || "%THIS_MACHINE%").split("%THIS_MACHINE%").join(reflexiveAddress),
24
25 // if (version_compare(buildLabel, gameToBuildVersion["16.5.5"]) < 0) {
26 irc: (config.ircAddress || "%THIS_MACHINE%").split("%THIS_MACHINE%").join(reflexiveAddress)
27 };
22 28 if (config.tunables?.useLoginToken) {
23 29 tunables.token = getTokenForClient(clientAddress);
24 30 }
Modified src/types/bootstrapperTypes.ts +1 -0
@@ -9,6 +9,7 @@ export interface ITunables {
9 9 disable_websocket?: boolean;
10 10 motd?: string;
11 11 token?: string;
12 nrs?: string;
12 13 irc?: string;
13 14 udp_proxy_upstream?: string;
14 15 }