fix ocm last tally
This commit is contained in:
parent
5c345188f2
commit
221d60b38b
@ -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!');
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user