fix ghost stuff
This commit is contained in:
parent
bf0cedacec
commit
2542b91dc1
@ -462,6 +462,39 @@ export default class UserModule extends Module {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!ocmEventDate)
|
||||
{
|
||||
let ocmEventDate = await prisma.oCMEvent.findFirst({
|
||||
orderBy: [
|
||||
{
|
||||
dbId: 'desc'
|
||||
},
|
||||
{
|
||||
competitionEndAt: 'desc',
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
if(ocmEventDate)
|
||||
{
|
||||
let pastDay = date - ocmEventDate.competitionEndAt;
|
||||
|
||||
if(pastDay < 604800)
|
||||
{
|
||||
let checkRegisteredGhost = await prisma.ghostRegisteredFromTerminal.findFirst({
|
||||
where:{
|
||||
carId: user.cars[i].carId
|
||||
}
|
||||
});
|
||||
|
||||
if(checkRegisteredGhost)
|
||||
{
|
||||
carStates[i].hasOpponentGhost = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Participated to OCM Event
|
||||
|
@ -22,9 +22,6 @@ export async function saveGhostBattleResult(body: wm.protobuf.SaveGameResultRequ
|
||||
// Set ghost mode play to true for saving the ghost trail later
|
||||
ghostModePlay = true;
|
||||
|
||||
// Set update new trail to true for updating the user's ghost trail after playing OCM ghost battle mode later
|
||||
updateNewTrail = true;
|
||||
|
||||
// Get the ghost result for the car
|
||||
let ghostResult = body?.rgResult;
|
||||
|
||||
@ -265,13 +262,13 @@ export async function saveGhostBattleResult(body: wm.protobuf.SaveGameResultRequ
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
ghost_historys = await ghost_history.saveGhostHistory(body);
|
||||
|
||||
// Update the updateNewTrail value
|
||||
updateNewTrail = ghost_historys.updateNewTrail;
|
||||
}
|
||||
|
||||
ghost_historys = await ghost_history.saveGhostHistory(body);
|
||||
|
||||
// Update the updateNewTrail value
|
||||
updateNewTrail = ghost_historys.updateNewTrail;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@ -279,6 +276,7 @@ export async function saveGhostBattleResult(body: wm.protobuf.SaveGameResultRequ
|
||||
case wmproto.wm.protobuf.GhostSelectionMethod.GHOST_COMPETITION:
|
||||
{
|
||||
console.log('OCM Ghost Mode Found');
|
||||
|
||||
OCMModePlay = true;
|
||||
let saveExOCM: any = {};
|
||||
saveExOCM.carId = body.carId;
|
||||
|
@ -7,7 +7,7 @@ import { wm } from "../../wmmt/wm.proto";
|
||||
// Save versus battle result
|
||||
export async function saveVersusBattleResult(body: wm.protobuf.SaveGameResultRequest)
|
||||
{
|
||||
if (!(body.retired || body.timeup))
|
||||
if (!(body.retired))
|
||||
{
|
||||
// Get the vs result for the car
|
||||
let vsResult = body?.vsResult;
|
||||
|
Loading…
Reference in New Issue
Block a user