diff --git a/flake.nix b/flake.nix index 17da72a..3169633 100644 --- a/flake.nix +++ b/flake.nix @@ -26,7 +26,7 @@ in rec { packages.bayshore = pkgs.buildNpmPackage { pname = "bayshore"; - version = "1.0.10"; + version = "1.1.0"; src = ./.; npmDepsHash = "sha256-VbFdHmPF9we1MS8OibpJY51WKFUK3Iq9xNyb8GiBgL0="; diff --git a/src/modules/game/ghost.ts b/src/modules/game/ghost.ts index bee51a1..02f0cc3 100644 --- a/src/modules/game/ghost.ts +++ b/src/modules/game/ghost.ts @@ -442,16 +442,12 @@ export async function saveGhostBattleResult(body: wm.protobuf.SaveGameResultRequ { console.log('OCM Ghost Mode Found - Appointment (VS HoF Ghost)'); - // Defeated HoF Ghost - if(body.rgResult!.opponents![0].result >= 0) - { - // Delete all the records - await prisma.ghostRegisteredFromTerminal.deleteMany({ - where:{ - carId: Number(body.carId) - } - }); - } + // Delete all the records + await prisma.ghostRegisteredFromTerminal.deleteMany({ + where:{ + carId: Number(body.carId) + } + }); break; } diff --git a/src/modules/ghost.ts b/src/modules/ghost.ts index a63b4cc..489ac64 100644 --- a/src/modules/ghost.ts +++ b/src/modules/ghost.ts @@ -39,13 +39,17 @@ export default class GhostModule extends Module { let getStampTargets = await ghostFunctions.getOpponentHistory(body.carId); let opponentHistory = getStampTargets.opponentHistory; - // Get Stamp Target - let getStampTarget = await ghostFunctions.getStampTarget(body.carId); - let stampTarget = getStampTarget.stampTarget; - + // ------------- STAMP STUFF ------------- + // Must declare both // Get Challengers let getChallengers = await ghostFunctions.getChallengers(body.carId); let challengers = getChallengers.challengers; + let arrayCarId = getChallengers.arrayCarId + + // Get Stamp Target + let getStampTarget = await ghostFunctions.getStampTarget(body.carId, arrayCarId); + let stampTarget = getStampTarget.stampTarget; + // --------------------------------------- // Response data let msg = { @@ -98,14 +102,17 @@ export default class GhostModule extends Module { // Get the request body for the load stamp target request let body = wm.wm.protobuf.LoadStampTargetRequest.decode(req.body); - // Get Stamp Target - let getStampTarget = await ghostFunctions.getStampTarget(body.carId); - let stampTarget = getStampTarget.stampTarget; - + // ------------- STAMP STUFF ------------- + // Must declare both // Get Challengers let getChallengers = await ghostFunctions.getChallengers(body.carId); let challengers = getChallengers.challengers; + let arrayCarId = getChallengers.arrayCarId + // Get Stamp Target + let getStampTarget = await ghostFunctions.getStampTarget(body.carId, arrayCarId); + let stampTarget = getStampTarget.stampTarget; + // --------------------------------------- // Response data let msg = { error: wm.wm.protobuf.ErrorCode.ERR_SUCCESS, diff --git a/src/modules/ghost/functions.ts b/src/modules/ghost/functions.ts index 6063820..32e1275 100644 --- a/src/modules/ghost/functions.ts +++ b/src/modules/ghost/functions.ts @@ -61,22 +61,22 @@ export async function getOpponentHistory(carId: number) // Get Stamp Target -export async function getStampTarget(carId: number) +export async function getStampTarget(carId: number, arrayCarId: number[]) { // Get all of the friend cars for the carId provided let getStampTargets = await prisma.carStampTarget.findMany({ where: { stampTargetCarId: carId, - recommended: true + recommended: true, + carId: { in: arrayCarId }, }, orderBy:{ locked: 'desc' }, - take: 10 }); let stampTarget: wmproto.wm.protobuf.StampTargetCar[] = []; - if(getStampTargets) + if(getStampTargets.length > 0) { for(let i=0; i 0) { for(let i=0; i 25) + if(participantLength > 50) { - participantLength = 25; + participantLength = 50; } // 16th - C1 diff --git a/src/modules/util/common.ts b/src/modules/util/common.ts index 49d3bc2..9f66344 100644 --- a/src/modules/util/common.ts +++ b/src/modules/util/common.ts @@ -62,6 +62,7 @@ export function sendResponse(message: Writer, res: Response, headers: string[]) // Get config const config = Config.getConfig(); + let revisionCheck = config.gameOptions.revisionCheck || 1; // Get the end of the message let end = message.finish(); @@ -74,7 +75,7 @@ export function sendResponse(message: Writer, res: Response, headers: string[]) .status(200); // If revision check is enabled - if (config.gameOptions.revisionCheck) { + if (revisionCheck == 1) { // Get the protobuf revision from the headers let revision = getProtobufRevision(headers);