1
0
mirror of https://github.com/shiroikitsu8/Bayshore_6r_legacy.git synced 2025-02-07 23:21:30 +01:00

Merge pull request #38 from ghkkk090/master

fix ocm ghost registered from terminal
This commit is contained in:
Luna 2022-08-30 12:31:28 +01:00 committed by GitHub
commit 62e8ef9350
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 21 deletions

View File

@ -103,6 +103,8 @@ export default class CarModule extends Module {
if(checkRegisteredGhost) if(checkRegisteredGhost)
{ {
console.log('OCM Ghost Registered From Terminal');
let getNo1OCM = await prisma.oCMTally.findFirst({ let getNo1OCM = await prisma.oCMTally.findFirst({
where:{ where:{
competitionId: ocmEventDate.competitionId, competitionId: ocmEventDate.competitionId,
@ -115,12 +117,10 @@ export default class CarModule extends Module {
if(getNo1OCM) if(getNo1OCM)
{ {
let carId = getNo1OCM.carId
// Get Car Data // Get Car Data
let cars = await prisma.car.findFirst({ let cars = await prisma.car.findFirst({
where:{ where:{
carId: carId carId: getNo1OCM.carId
}, },
include:{ include:{
gtWing: true, gtWing: true,
@ -131,25 +131,33 @@ export default class CarModule extends Module {
// Get Ghost Trail // Get Ghost Trail
let ghostTrailNo1 = await prisma.oCMTop1GhostTrail.findFirst({ let ghostTrailNo1 = await prisma.oCMTop1GhostTrail.findFirst({
where:{ where:{
carId: carId, carId: getNo1OCM.carId,
competitionId: ocmEventDate.competitionId, competitionId: ocmEventDate.competitionId
periodId: 999999999 },
orderBy:{
dbId: 'asc'
} }
}); });
trailIdNo1 = ghostTrailNo1!.dbId; if(ghostTrailNo1)
{
console.log('Getting registered ghost trail');
ghostCarsNo1 = wm.wm.protobuf.GhostCar.create({ trailIdNo1 = ghostTrailNo1.dbId;
car: {
...cars!, ghostCarsNo1 = wm.wm.protobuf.GhostCar.create({
}, car: {
area: ghostTrailNo1!.area, ...cars!,
ramp: ghostTrailNo1!.ramp, },
path: ghostTrailNo1!.path, area: ghostTrailNo1.area,
nonhuman: false, ramp: ghostTrailNo1.ramp,
type: wm.wm.protobuf.GhostType.GHOST_NORMAL, path: ghostTrailNo1.path,
trailId: trailIdNo1 nonhuman: false,
}); type: wm.wm.protobuf.GhostType.GHOST_NORMAL,
trailId: trailIdNo1
});
}
} }
} }
} }

View File

@ -76,7 +76,8 @@ export default class GhostModule extends Module {
// Get all of the friend cars for the carId provided // Get all of the friend cars for the carId provided
let stampTargets = await prisma.carStampTarget.findMany({ let stampTargets = await prisma.carStampTarget.findMany({
where: { where: {
stampTargetCarId: body.carId stampTargetCarId: body.carId,
locked: false
} }
}); });
@ -177,7 +178,8 @@ export default class GhostModule extends Module {
// Get all of the friend cars for the carId provided // Get all of the friend cars for the carId provided
let stampTargets = await prisma.carStampTarget.findMany({ let stampTargets = await prisma.carStampTarget.findMany({
where: { where: {
carId: body.carId stampTargetCarId: body.carId,
locked: false
} }
}); });
@ -187,7 +189,7 @@ export default class GhostModule extends Module {
{ {
let carTarget = await prisma.car.findFirst({ let carTarget = await prisma.car.findFirst({
where:{ where:{
carId: stampTargets[i].stampTargetCarId carId: stampTargets[i].carId
}, },
include:{ include:{
gtWing: true, gtWing: true,