From ab23f99e6c93b7b0d6a4efcbedc3b8cc26347490 Mon Sep 17 00:00:00 2001 From: Shiroi Kitsu <108461408+shiroikitsu8@users.noreply.github.com> Date: Thu, 22 Jun 2023 11:47:04 +0700 Subject: [PATCH 1/5] also delete the challenge hof ghost when lost --- src/modules/game/ghost.ts | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) 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; } From f9f34000e3c89ff0971c11a8a36363f4a595ffd5 Mon Sep 17 00:00:00 2001 From: Shiroi Kitsu <108461408+shiroikitsu8@users.noreply.github.com> Date: Thu, 29 Jun 2023 10:22:11 +0700 Subject: [PATCH 2/5] 50 gp --- src/modules/ghost/ghost_ocm.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/ghost/ghost_ocm.ts b/src/modules/ghost/ghost_ocm.ts index dbcdbca..603fe6f 100644 --- a/src/modules/ghost/ghost_ocm.ts +++ b/src/modules/ghost/ghost_ocm.ts @@ -589,9 +589,9 @@ export async function ocmGiveNamePlateReward(competitionId: number) let participantLength = getCarParticipant.length; // Participant is more than certain number (100 is default) - if(participantLength > 25) + if(participantLength > 50) { - participantLength = 25; + participantLength = 50; } // 16th - C1 From a1066779a1f65e6cecc62a964fdb5d00483555f3 Mon Sep 17 00:00:00 2001 From: Shiroi Kitsu <108461408+shiroikitsu8@users.noreply.github.com> Date: Thu, 29 Jun 2023 10:24:06 +0700 Subject: [PATCH 3/5] revision check --- src/modules/util/common.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); From b787aec0da6588070ec81327d392a6d57fc6e83d Mon Sep 17 00:00:00 2001 From: Shiroi Kitsu <108461408+shiroikitsu8@users.noreply.github.com> Date: Thu, 29 Jun 2023 10:25:16 +0700 Subject: [PATCH 4/5] bump --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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="; From 47744d46478e79bac65d4213bcd892009fe73f0f Mon Sep 17 00:00:00 2001 From: Shiroi Kitsu <108461408+shiroikitsu8@users.noreply.github.com> Date: Mon, 3 Jul 2023 16:33:12 +0700 Subject: [PATCH 5/5] fix ghost return stamp no stamp logo --- src/modules/ghost.ts | 23 +++++++++++++++-------- src/modules/ghost/functions.ts | 17 +++++++++++------ 2 files changed, 26 insertions(+), 14 deletions(-) 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