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
let body = wm.wm.protobuf.UpdateCarRequest.decode(req.body);
console.log(body);
// Get the ghost result for the car
let cars = body?.car;
@ -704,8 +705,19 @@ export default class CarModule extends Module {
wingTip: common.sanitizeInput(gtWing.wingTip),
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 = {
pillar: 0,
@ -715,7 +727,6 @@ export default class CarModule extends Module {
wingTip: 0,
material: 0,
}
}
await prisma.carGTWing.update({
where: {
@ -723,6 +734,8 @@ export default class CarModule extends Module {
},
data: dataGTWing
})
}
}
// Response data
let msg = {

View File

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