fix gt wing reset bug, and stamp sheet reset bug
This commit is contained in:
parent
8a917c4fa2
commit
bd2d615a3e
@ -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,26 +705,38 @@ 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)
|
||||
{
|
||||
dataGTWing = {
|
||||
pillar: 0,
|
||||
pillarMaterial: 0,
|
||||
mainWing: 0,
|
||||
mainWingColor: 0,
|
||||
wingTip: 0,
|
||||
material: 0,
|
||||
// GT Wing not set
|
||||
if(gtWing === undefined || gtWing === null)
|
||||
{
|
||||
dataGTWing = {
|
||||
pillar: 0,
|
||||
pillarMaterial: 0,
|
||||
mainWing: 0,
|
||||
mainWingColor: 0,
|
||||
wingTip: 0,
|
||||
material: 0,
|
||||
}
|
||||
|
||||
await prisma.carGTWing.update({
|
||||
where: {
|
||||
dbId: body.carId
|
||||
},
|
||||
data: dataGTWing
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
await prisma.carGTWing.update({
|
||||
where: {
|
||||
dbId: body.carId
|
||||
},
|
||||
data: dataGTWing
|
||||
})
|
||||
|
||||
// Response data
|
||||
let msg = {
|
||||
error: wm.wm.protobuf.ErrorCode.ERR_SUCCESS,
|
||||
|
@ -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),
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user