mirror of
https://github.com/shiroikitsu8/Bayshore_6r_legacy.git
synced 2025-02-26 21:41:38 +01:00
fix crown ghost saving bug
This commit is contained in:
parent
b45ac59e18
commit
29995d1940
13
prisma/migrations/20220730022702_ghost_trail_3/migration.sql
Normal file
13
prisma/migrations/20220730022702_ghost_trail_3/migration.sql
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
/*
|
||||||
|
Warnings:
|
||||||
|
|
||||||
|
- You are about to drop the column `tuneHandling` on the `GhostTrail` table. All the data in the column will be lost.
|
||||||
|
- You are about to drop the column `tunePower` on the `GhostTrail` table. All the data in the column will be lost.
|
||||||
|
|
||||||
|
*/
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE "Car" ALTER COLUMN "stLoseBits" SET DEFAULT 0;
|
||||||
|
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE "GhostTrail" DROP COLUMN "tuneHandling",
|
||||||
|
DROP COLUMN "tunePower";
|
@ -0,0 +1,11 @@
|
|||||||
|
/*
|
||||||
|
Warnings:
|
||||||
|
|
||||||
|
- You are about to drop the column `trail` on the `CarCrown` table. All the data in the column will be lost.
|
||||||
|
|
||||||
|
*/
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE "Car" ALTER COLUMN "stLoseBits" SET DEFAULT 0;
|
||||||
|
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE "CarCrown" DROP COLUMN "trail";
|
@ -209,7 +209,6 @@ model CarCrown {
|
|||||||
area Int @unique
|
area Int @unique
|
||||||
ramp Int
|
ramp Int
|
||||||
path Int
|
path Int
|
||||||
trail BigInt
|
|
||||||
playedAt Int @default(0)
|
playedAt Int @default(0)
|
||||||
tunePower Int
|
tunePower Int
|
||||||
tuneHandling Int
|
tuneHandling Int
|
||||||
@ -226,8 +225,6 @@ model GhostTrail {
|
|||||||
time Int?
|
time Int?
|
||||||
driveData Bytes? @db.ByteA
|
driveData Bytes? @db.ByteA
|
||||||
trendBinaryByArea Bytes? @db.ByteA
|
trendBinaryByArea Bytes? @db.ByteA
|
||||||
tunePower Int
|
|
||||||
tuneHandling Int
|
|
||||||
playedAt Int
|
playedAt Int
|
||||||
crownBattle Boolean
|
crownBattle Boolean
|
||||||
}
|
}
|
||||||
|
@ -200,7 +200,6 @@ export default class GameModule extends Module {
|
|||||||
case wm.wm.protobuf.GameMode.MODE_GHOST_BATTLE:
|
case wm.wm.protobuf.GameMode.MODE_GHOST_BATTLE:
|
||||||
{
|
{
|
||||||
if (!(body.retired)) {
|
if (!(body.retired)) {
|
||||||
ghostModePlay = true;
|
|
||||||
let saveEx: any = {};
|
let saveEx: any = {};
|
||||||
if (body.rgResult?.rgRegionMapScore !== null && body.rgResult?.rgRegionMapScore !== undefined) {
|
if (body.rgResult?.rgRegionMapScore !== null && body.rgResult?.rgRegionMapScore !== undefined) {
|
||||||
saveEx.rgRegionMapScore = body.rgResult?.rgRegionMapScore!;
|
saveEx.rgRegionMapScore = body.rgResult?.rgRegionMapScore!;
|
||||||
@ -305,6 +304,7 @@ export default class GameModule extends Module {
|
|||||||
case wm.wm.protobuf.GhostSelectionMethod.GHOST_SELECT_CROWN_MATCH:
|
case wm.wm.protobuf.GhostSelectionMethod.GHOST_SELECT_CROWN_MATCH:
|
||||||
{
|
{
|
||||||
if (body.rgResult?.acquireCrown !== false && body.rgResult?.acquireCrown !== null && body.rgResult?.acquireCrown !== undefined) {
|
if (body.rgResult?.acquireCrown !== false && body.rgResult?.acquireCrown !== null && body.rgResult?.acquireCrown !== undefined) {
|
||||||
|
ghostModePlay = true;
|
||||||
let saveExCrown: any = {};
|
let saveExCrown: any = {};
|
||||||
saveExCrown.carId = body.carId;
|
saveExCrown.carId = body.carId;
|
||||||
if(body.rgResult?.path !== null && body.rgResult?.path !== undefined){
|
if(body.rgResult?.path !== null && body.rgResult?.path !== undefined){
|
||||||
@ -374,13 +374,11 @@ export default class GameModule extends Module {
|
|||||||
if(body?.playedAt !== null || body?.playedAt !== undefined){
|
if(body?.playedAt !== null || body?.playedAt !== undefined){
|
||||||
saveExCrown.playedAt = body?.playedAt!;
|
saveExCrown.playedAt = body?.playedAt!;
|
||||||
}
|
}
|
||||||
saveExCrown.trail = Number(1); //wtf is this lmao
|
|
||||||
saveExCrown.tunePower = body.car!.tunePower!;
|
saveExCrown.tunePower = body.car!.tunePower!;
|
||||||
saveExCrown.tuneHandling = body.car!.tuneHandling!;
|
saveExCrown.tuneHandling = body.car!.tuneHandling!;
|
||||||
|
|
||||||
let carCrowns = await prisma.carCrown.count({
|
let carCrowns = await prisma.carCrown.count({
|
||||||
where: {
|
where: {
|
||||||
carId: body.carId,
|
|
||||||
area: saveExCrown.area
|
area: saveExCrown.area
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -712,7 +710,7 @@ export default class GameModule extends Module {
|
|||||||
|
|
||||||
app.post('/method/register_ghost_trail', async (req, res) => {
|
app.post('/method/register_ghost_trail', async (req, res) => {
|
||||||
let body = wm.wm.protobuf.RegisterGhostTrailRequest.decode(req.body);
|
let body = wm.wm.protobuf.RegisterGhostTrailRequest.decode(req.body);
|
||||||
//-----------------SAVING STILL NOT WORKING-----------------
|
//-----------------ONLY CROWN BATTLE FOR NOW-----------------
|
||||||
let crownBattles: boolean = false;
|
let crownBattles: boolean = false;
|
||||||
if(body.trendBinaryByArea?.data === null && body.trendBinaryByArea?.data === undefined){
|
if(body.trendBinaryByArea?.data === null && body.trendBinaryByArea?.data === undefined){
|
||||||
crownBattles = true;
|
crownBattles = true;
|
||||||
@ -746,16 +744,20 @@ export default class GameModule extends Module {
|
|||||||
if(body.ghost?.car.lastPlayedAt !== null && body.ghost?.car.lastPlayedAt !== undefined){
|
if(body.ghost?.car.lastPlayedAt !== null && body.ghost?.car.lastPlayedAt !== undefined){
|
||||||
saveEx.playedAt = body.ghost?.car.lastPlayedAt!;
|
saveEx.playedAt = body.ghost?.car.lastPlayedAt!;
|
||||||
}
|
}
|
||||||
if(body.ghost?.car.tunePower !== null && body.ghost?.car.tunePower !== undefined){
|
|
||||||
saveEx.tunePower = body.ghost?.car.tunePower!;
|
|
||||||
}
|
|
||||||
if(body.ghost?.car.tuneHandling !== null && body.ghost?.car.tuneHandling !== undefined){
|
|
||||||
saveEx.tuneHandling = body.ghost?.car.tuneHandling!;
|
|
||||||
}
|
|
||||||
|
|
||||||
await prisma.ghostTrail.create({
|
await prisma.ghostTrail.create({
|
||||||
data: saveEx
|
data: saveEx
|
||||||
});
|
});
|
||||||
|
|
||||||
|
await prisma.carCrown.update({
|
||||||
|
where: {
|
||||||
|
area: saveEx.area
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
ramp: saveEx.ramp,
|
||||||
|
path: saveEx.path
|
||||||
|
}
|
||||||
|
});
|
||||||
//----------------------------------------------------------
|
//----------------------------------------------------------
|
||||||
|
|
||||||
let msg = {
|
let msg = {
|
||||||
@ -2491,9 +2493,9 @@ export default class GameModule extends Module {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
//---------------MAYBE NOT CORRECT---------------
|
//---------------MAYBE NOT CORRECT---------------
|
||||||
let rampVal = 0;
|
let rampVal = ghost_trails!.ramp;
|
||||||
let pathVal = 0;
|
let pathVal = ghost_trails!.path;
|
||||||
if(pArea === 0){ //GID_RUNAREA_C1
|
/*if(pArea === 0){ //GID_RUNAREA_C1
|
||||||
rampVal = Math.floor(Math.random() * 4);
|
rampVal = Math.floor(Math.random() * 4);
|
||||||
pathVal = Math.floor(Math.random() * 10);
|
pathVal = Math.floor(Math.random() * 10);
|
||||||
}
|
}
|
||||||
@ -2557,7 +2559,7 @@ export default class GameModule extends Module {
|
|||||||
else if(pArea === 18){ //GID_RUNAREA_HIROSHIMA
|
else if(pArea === 18){ //GID_RUNAREA_HIROSHIMA
|
||||||
rampVal = Math.floor(Math.random() * 2) + 37;
|
rampVal = Math.floor(Math.random() * 2) + 37;
|
||||||
pathVal = Math.floor(Math.random() * 2) + 56;
|
pathVal = Math.floor(Math.random() * 2) + 56;
|
||||||
}
|
}*/
|
||||||
//let trails = new Uint8Array([1, 2, 3, 4]); //wtf is this lmao
|
//let trails = new Uint8Array([1, 2, 3, 4]); //wtf is this lmao
|
||||||
|
|
||||||
let msg = {
|
let msg = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user