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: improve handling of setGuildMotd request for U10 (#3422)

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

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

代码差异

1 个文件 +5 -1
Modified src/controllers/api/setGuildMotdController.ts +5 -1
@@ -15,7 +15,11 @@ export const setGuildMotdController: RequestHandler = async (req, res) => {
15 15 const member = (await GuildMember.findOne({ accountId: account._id, guildId: guild._id }))!;
16 16
17 17 const IsLongMOTD = "longMOTD" in req.query;
18 const MOTD = req.body ? String(req.body) : undefined;
18 let MOTD = req.body ? String(req.body) : undefined;
19 if (MOTD && MOTD.charCodeAt(MOTD.length - 1) === 0) {
20 // U10's request body ends on a zero byte, but that's not intended to be part of the MOTD.
21 MOTD = MOTD.substring(0, MOTD.length - 1);
22 }
19 23
20 24 if ("alliance" in req.query) {
21 25 if (member.rank > 1) {