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: don't add 'alwaysAvailable' skins with unlockAllSkins (#2843)

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

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

代码差异

1 个文件 +10 -9
Modified src/controllers/api/inventoryController.ts +10 -9
@@ -335,15 +335,16 @@ export const getInventoryResponse = async (
335 335 }
336 336
337 337 if (config.unlockAllSkins) {
338 const missingWeaponSkins = new Set(Object.keys(ExportCustoms));
339 inventoryResponse.WeaponSkins.forEach(x => missingWeaponSkins.delete(x.ItemType));
340 for (const uniqueName of missingWeaponSkins) {
341 inventoryResponse.WeaponSkins.push({
342 ItemId: {
343 $oid: "ca70ca70ca70ca70" + catBreadHash(uniqueName).toString(16).padStart(8, "0")
344 },
345 ItemType: uniqueName
346 });
338 const ownedWeaponSkins = new Set<string>(inventoryResponse.WeaponSkins.map(x => x.ItemType));
339 for (const [uniqueName, meta] of Object.entries(ExportCustoms)) {
340 if (!meta.alwaysAvailable && !ownedWeaponSkins.has(uniqueName)) {
341 inventoryResponse.WeaponSkins.push({
342 ItemId: {
343 $oid: "ca70ca70ca70ca70" + catBreadHash(uniqueName).toString(16).padStart(8, "0")
344 },
345 ItemType: uniqueName
346 });
347 }
347 348 }
348 349 }
349 350