1
0
mirror of synced 2024-09-23 18:58:22 +02:00

Merge pull request #76 from shiroikitsu8/master

change force finish detection threshold
This commit is contained in:
Sylvie Nightshade 2023-07-27 08:15:37 +01:00 committed by GitHub
commit 07a4d26c44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 44 additions and 2 deletions

View File

@ -26,7 +26,7 @@
in rec {
packages.bayshore = pkgs.buildNpmPackage {
pname = "bayshore";
version = "1.1.0";
version = "1.1.2";
src = ./.;
npmDepsHash = "sha256-VbFdHmPF9we1MS8OibpJY51WKFUK3Iq9xNyb8GiBgL0=";

View File

@ -257,7 +257,7 @@ export default class GameModule extends Module {
{
let timestamp = body.playedAt - body.timestamp;
if(timestamp <= 120)
if(timestamp <= 30)
{
console.log('Crown Force Finish Detected');

View File

@ -231,6 +231,27 @@ export async function saveOCMGhostHistory(body: wm.protobuf.SaveGameResultReques
}
});
// Period ID not found
if(!(OCM_periodId))
{
OCM_periodId = await prisma.oCMPeriod.findFirst({
where:{
competitionId: ocmEventDate!.competitionId,
startAt:
{
lte: date - ocmEventDate!.lengthOfInterval, // competitionStartAt is less than current date
},
closeAt:
{
gte: date - ocmEventDate!.lengthOfInterval, // competitionCloseAt is greater than current date
}
},
select:{
periodId: true
}
});
}
let checkGhost = await prisma.oCMGhostBattleRecord.findFirst({
where:{
carId: saveExGhostHistory.carId,
@ -338,6 +359,27 @@ export async function saveOCMGhostHistory(body: wm.protobuf.SaveGameResultReques
}
});
// Period ID not found
if(!(OCM_periodId))
{
OCM_periodId = await prisma.oCMPeriod.findFirst({
where:{
competitionId: ocmEventDate!.competitionId,
startAt:
{
lte: date - ocmEventDate!.lengthOfInterval, // competitionStartAt is less than current date
},
closeAt:
{
gte: date - ocmEventDate!.lengthOfInterval, // competitionCloseAt is greater than current date
}
},
select:{
periodId: true
}
});
}
// Update ghost battle record
await prisma.oCMGhostBattleRecord.create({
data: {