mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-05-14 15:00:54 -05:00
SQ match seed
This commit is contained in:
parent
456180c65b
commit
a47b3024cc
|
|
@ -230,7 +230,7 @@ const basicSeeds = (variation?: SeedVariation | null) => [
|
|||
arts,
|
||||
commissionsOpen,
|
||||
playedMatches,
|
||||
variation === "NO_SQ_GROUPS" ? undefined : groups,
|
||||
variation === "NO_SQ_GROUPS" ? undefined : () => groups(variation),
|
||||
friendCodes,
|
||||
lfgPosts,
|
||||
variation === "NO_SCRIMS" ? undefined : scrimPosts,
|
||||
|
|
@ -2456,12 +2456,15 @@ function commissionsOpen() {
|
|||
}
|
||||
|
||||
const SENDOU_IN_FULL_GROUP = true;
|
||||
async function groups() {
|
||||
async function groups(variation?: SeedVariation | null) {
|
||||
const users = userIdsInAscendingOrderById()
|
||||
.slice(0, 100)
|
||||
.filter((id) => id !== ADMIN_ID && id !== NZAP_TEST_ID);
|
||||
users.push(NZAP_TEST_ID);
|
||||
|
||||
let nzapGroupId = 0;
|
||||
let sendouGroupId = 0;
|
||||
|
||||
for (let i = 0; i < 25; i++) {
|
||||
const group = await SQGroupRepository.createGroup({
|
||||
status: "ACTIVE",
|
||||
|
|
@ -2492,10 +2495,22 @@ async function groups() {
|
|||
});
|
||||
}
|
||||
|
||||
if (i === 0) nzapGroupId = group.id;
|
||||
if (i === 1) sendouGroupId = group.id;
|
||||
|
||||
if (i === 0 && SENDOU_IN_FULL_GROUP) {
|
||||
users.push(ADMIN_ID);
|
||||
}
|
||||
}
|
||||
|
||||
if (variation === "IN_SQ_MATCH") {
|
||||
await SQMatchRepository.create({
|
||||
alphaGroupId: sendouGroupId,
|
||||
bravoGroupId: nzapGroupId,
|
||||
mapList: randomMapList(sendouGroupId, nzapGroupId),
|
||||
memento: { users: {}, groups: {}, pools: [] },
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const randomMapList = (
|
||||
|
|
|
|||
|
|
@ -7,4 +7,5 @@ export const SEED_VARIATIONS = [
|
|||
"NO_SCRIMS",
|
||||
"NO_SQ_GROUPS",
|
||||
"FINALIZED_BRACKET",
|
||||
"IN_SQ_MATCH",
|
||||
] as const;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user