返回提交历史
Modified
src/services/guildService.ts
+14
-2
XFEstudio/XFESpaceNinjaServer
fix: properly map clan ranks for pre-U24 client (#3608)
I noticed that the UI in U15 refused to resolve loctags in general, so it wasn't an issue due to founding warlord in particular. Also for some reason the Permissions field being before Name caused the game to think the rank has no permissions at all. Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/3608 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
be5083d2
代码差异
1 个文件
+14
-2
@@ -66,6 +66,18 @@ export const getGuildRankBase = (buildLabel: string | undefined): number => {
66
66
return buildLabel && version_compare(buildLabel, gameToBuildVersion["24.0.0"]) < 0 ? 1 : 0;
67
67
};
68
68
69
const rankTagToName: Record<string, string> = {
70
"/Lotus/Language/Game/Rank_Creator": "Founding Warlord",
71
"/Lotus/Language/Game/Rank_General": "General",
72
"/Lotus/Language/Game/Rank_Initiate": "Initiate",
73
"/Lotus/Language/Game/Rank_Leader": "Leader",
74
"/Lotus/Language/Game/Rank_Officer": "Officer",
75
"/Lotus/Language/Game/Rank_Sage": "Sage",
76
"/Lotus/Language/Game/Rank_Soldier": "Soldier",
77
"/Lotus/Language/Game/Rank_Utility": "Utility",
78
"/Lotus/Language/Game/Rank_Warlord": "Warlord"
79
};
80
69
81
export const getGuildClient = async (
70
82
guild: TGuildDatabaseDocument,
71
83
account: TAccountDocument
@@ -112,8 +124,8 @@ export const getGuildClient = async (
112
124
let ranks = guild.Ranks;
113
125
if (account.BuildLabel && version_compare(account.BuildLabel, gameToBuildVersion["24.0.0"]) < 0) {
114
126
ranks = ranks.map(x => ({
115
...x,
116
Name: x.Name == "/Lotus/Language/Game/Rank_Creator" ? "Founding Warlord" : x.Name
127
Name: rankTagToName[x.Name] ?? x.Name,
128
Permissions: x.Permissions
117
129
}));
118
130
}
119
131