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: treat empty string in nrsAddress and ircAddress like null (#3384)

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

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

代码差异

1 个文件 +3 -3
Modified src/controllers/api/loginController.ts +3 -3
@@ -160,10 +160,10 @@ const createLoginResponse = (request: Request, account: IDatabaseAccountJson, bu
160 160 resp.SteamId = "0";
161 161 }
162 162 if (version_compare(buildLabel, gameToBuildVersion["15.14.1"]) >= 0) {
163 resp.NRS = [(config.nrsAddress ?? "%THIS_MACHINE%").split("%THIS_MACHINE%").join(myAddress)];
163 resp.NRS = [(config.nrsAddress || "%THIS_MACHINE%").split("%THIS_MACHINE%").join(myAddress)];
164 164 }
165 165 if (version_compare(buildLabel, gameToBuildVersion["16.5.5"]) >= 0) {
166 resp.IRC = [(config.ircAddress ?? "%THIS_MACHINE%").split("%THIS_MACHINE%").join(myAddress)];
166 resp.IRC = [(config.ircAddress || "%THIS_MACHINE%").split("%THIS_MACHINE%").join(myAddress)];
167 167 }
168 168 if (version_compare(buildLabel, gameToBuildVersion["24.0.0"]) >= 0) {
169 169 resp.ConsentNeeded = account.ConsentNeeded;
@@ -216,7 +216,7 @@ const createLoginResponse = (request: Request, account: IDatabaseAccountJson, bu
216 216 ) {
217 217 const tunables = getTunablesForClient((request.socket.address() as AddressInfo).address, myAddress);
218 218 if (version_compare(buildLabel, gameToBuildVersion["16.5.5"]) < 0) {
219 tunables.irc = (config.ircAddress ?? "%THIS_MACHINE%").split("%THIS_MACHINE%").join(myAddress);
219 tunables.irc = (config.ircAddress || "%THIS_MACHINE%").split("%THIS_MACHINE%").join(myAddress);
220 220 }
221 221 raw += "\t" + JSON.stringify(tunables);
222 222 }