1
0
mirror of synced 2024-12-04 19:17:58 +01:00

fix ocm last tally

This commit is contained in:
Shiroi Kitsu 2023-01-22 09:42:34 +07:00
parent 5c345188f2
commit 221d60b38b
4 changed files with 10 additions and 7 deletions

View File

@ -139,7 +139,7 @@ export default class GhostModule extends Module {
// If not yet tallying
if(OCMTallyCount === 0)
{
await ghost_ocm.ocmTallying(body, OCMCurrentPeriod.periodId, false);
await ghost_ocm.ocmTallying(body, OCMCurrentPeriod.periodId, false, ocmEventDate!.competitionId);
// Completed
console.log('Tally Completed!');
@ -181,7 +181,6 @@ export default class GhostModule extends Module {
// Get Current OCM Period
let OCMCurrentPeriod = await prisma.oCMPeriod.findFirst({
where: {
competitionDbId: ocmEventDate!.dbId,
competitionId: ocmEventDate!.competitionId
},
orderBy: {
@ -207,7 +206,7 @@ export default class GhostModule extends Module {
{
console.log('Tallying');
await ghost_ocm.ocmTallying(body, OCMCurrentPeriod.periodId, true);
await ghost_ocm.ocmTallying(body, OCMCurrentPeriod.periodId, true, ocmEventDate.competitionId);
// Completed
console.log('Last Tally Completed!');

View File

@ -338,6 +338,9 @@ export async function saveGhostBattleResult(body: wm.protobuf.SaveGameResultRequ
await ghost_history.saveGhostHistory(body);
// Return Stamp (Shuttle Match)
await ghost_stamp.shuttleReturnStamp(body);
break;
}

View File

@ -6,7 +6,7 @@ import wmproto from "../../wmmt/wm.proto";
// OCM Tallying
export async function ocmTallying(body: wm.protobuf.LoadGhostCompetitionInfoRequest, periodId: number, ended: boolean)
export async function ocmTallying(body: wm.protobuf.LoadGhostCompetitionInfoRequest, periodId: number, ended: boolean, competitionId: number)
{
// OCM is still on going
if(ended === false)
@ -283,7 +283,7 @@ export async function ocmTallying(body: wm.protobuf.LoadGhostCompetitionInfoRequ
// Get user that playing OCM qualifying day
let OCMTally = await prisma.oCMTally.findMany({
where:{
competitionId: body.competitionId,
competitionId: competitionId,
periodId: periodId
},
orderBy:{
@ -381,7 +381,8 @@ export async function ocmTallying(body: wm.protobuf.LoadGhostCompetitionInfoRequ
}
if(i === 0){
if(i === 0)
{
console.log('Making OCM Top 1 Ghost Data');
// Create Top 1 ghost data

View File

@ -1,2 +1,2 @@
yarn dev
node dist
pause