fix: check ascension ceremony contributors when changing clan tier #1656

Merged
Sainan merged 2 commits from tier-asc into main 2025-04-16 06:29:51 -07:00
Showing only changes of commit 4e077e7602 - Show all commits

View File

@ -5,6 +5,7 @@ import { config } from "@/src/services/configService";
import { createMessage } from "@/src/services/inboxService";
import { getInventory } from "@/src/services/inventoryService";
import { getAccountIdForRequest } from "@/src/services/loginService";
import { parallelForeach } from "@/src/utils/async-utils";
import { RequestHandler } from "express";
import { Types } from "mongoose";
@ -39,7 +40,7 @@ export const contributeGuildClassController: RequestHandler = async (req, res) =
if (!config.fastClanAscension) {
// Send message to all active guild members
const members = await GuildMember.find({ guildId: payload.GuildId, status: 0 }, "accountId");
for (const member of members) {
await parallelForeach(members, async member => {
// somewhat unfaithful as on live the "msg" is not a loctag, but since we don't have the string, we'll let the client fill it in with "arg".
await createMessage(member.accountId, [
{
@ -49,15 +50,15 @@ export const contributeGuildClassController: RequestHandler = async (req, res) =
{
Key: "RESETDATE",
Tag:
guild.CeremonyResetDate.getUTCMonth() +
guild.CeremonyResetDate!.getUTCMonth() +
"/" +
guild.CeremonyResetDate.getUTCDate() +
guild.CeremonyResetDate!.getUTCDate() +
"/" +
(guild.CeremonyResetDate.getUTCFullYear() % 100) +
(guild.CeremonyResetDate!.getUTCFullYear() % 100) +
" " +
guild.CeremonyResetDate.getUTCHours().toString().padStart(2, "0") +
guild.CeremonyResetDate!.getUTCHours().toString().padStart(2, "0") +
":" +
guild.CeremonyResetDate.getUTCMinutes().toString().padStart(2, "0")
guild.CeremonyResetDate!.getUTCMinutes().toString().padStart(2, "0")
}
],
sub: "/Lotus/Language/Clan/Clan_AscensionCeremonyInProgress",
@ -65,7 +66,7 @@ export const contributeGuildClassController: RequestHandler = async (req, res) =
highPriority: true
}
]);
}
});
}
}