1
0
mirror of synced 2024-12-12 15:01:12 +01:00

fix gt wing reset bug, and stamp sheet reset bug

This commit is contained in:
ghkkk090 2022-08-31 21:25:26 +07:00
parent 8a917c4fa2
commit bd2d615a3e
2 changed files with 35 additions and 16 deletions

View File

@ -575,6 +575,7 @@ export default class CarModule extends Module {
// Get the request body for the update car request // Get the request body for the update car request
let body = wm.wm.protobuf.UpdateCarRequest.decode(req.body); let body = wm.wm.protobuf.UpdateCarRequest.decode(req.body);
console.log(body);
// Get the ghost result for the car // Get the ghost result for the car
let cars = body?.car; let cars = body?.car;
@ -704,8 +705,19 @@ export default class CarModule extends Module {
wingTip: common.sanitizeInput(gtWing.wingTip), wingTip: common.sanitizeInput(gtWing.wingTip),
material: common.sanitizeInput(gtWing.material), material: common.sanitizeInput(gtWing.material),
} }
await prisma.carGTWing.update({
where: {
dbId: body.carId
},
data: dataGTWing
})
} }
else // Check if this is in getting new custom color screen or not
else if(body.car?.carId !== null && body.car?.carId !== undefined)
{
// GT Wing not set
if(gtWing === undefined || gtWing === null)
{ {
dataGTWing = { dataGTWing = {
pillar: 0, pillar: 0,
@ -715,7 +727,6 @@ export default class CarModule extends Module {
wingTip: 0, wingTip: 0,
material: 0, material: 0,
} }
}
await prisma.carGTWing.update({ await prisma.carGTWing.update({
where: { where: {
@ -723,6 +734,8 @@ export default class CarModule extends Module {
}, },
data: dataGTWing data: dataGTWing
}) })
}
}
// Response data // Response data
let msg = { let msg = {

View File

@ -71,13 +71,19 @@ export async function saveGhostBattleResult(body: wm.protobuf.SaveGameResultRequ
// ghostResult is set // ghostResult is set
if (ghostResult) if (ghostResult)
{ {
let stampSheet: any = undefined;
if(ghostResult.stampSheet!.length > 0)
{
stampSheet = ghostResult.stampSheet;
}
// Ghost update data // Ghost update data
dataGhost = { dataGhost = {
rgRegionMapScore: common.sanitizeInput(ghostResult.rgRegionMapScore), rgRegionMapScore: common.sanitizeInput(ghostResult.rgRegionMapScore),
rgPlayCount: common.sanitizeInput(ghostResult.rgPlayCount), rgPlayCount: common.sanitizeInput(ghostResult.rgPlayCount),
dressupLevel: common.sanitizeInput(ghostResult.dressupLevel), dressupLevel: common.sanitizeInput(ghostResult.dressupLevel),
dressupPoint: common.sanitizeInput(ghostResult.dressupPoint), dressupPoint: common.sanitizeInput(ghostResult.dressupPoint),
stampSheet: common.sanitizeInput(ghostResult.stampSheet), stampSheet: stampSheet,
stampSheetCount: common.sanitizeInputNotZero(ghostResult.stampSheetCount), stampSheetCount: common.sanitizeInputNotZero(ghostResult.stampSheetCount),
} }