From b076fff40c7aa57c6fd0041affb84081db36056f Mon Sep 17 00:00:00 2001
From: ghkkk090 <108461408+ghkkk090@users.noreply.github.com>
Date: Sat, 23 Jul 2022 16:40:17 +0700
Subject: [PATCH] fix custom color and discarded card item reward every n*100
plays
---
src/modules/game.ts | 86 +++++++++++++++++++++++++--------------------
1 file changed, 48 insertions(+), 38 deletions(-)
diff --git a/src/modules/game.ts b/src/modules/game.ts
index e4f558f..0ceb0df 100644
--- a/src/modules/game.ts
+++ b/src/modules/game.ts
@@ -21,7 +21,6 @@ export default class GameModule extends Module {
carId: body.carId
}
});
- console.log(body);
let storyLose: boolean = false;
switch (body.gameMode) {
case wm.wm.protobuf.GameMode.MODE_STORY:
@@ -92,20 +91,6 @@ export default class GameModule extends Module {
});
console.log('-------');
console.log(c);
-
- if(body.earnedItems.length !== 0){
- console.log('Game reward available, continuing ...');
- for(let i=0; i
{
-
let body = wm.wm.protobuf.LoadUserRequest.decode(req.body);
-
-
let user = await prisma.user.findFirst({
where: {
chipId: body.cardChipId,
@@ -407,7 +407,6 @@ export default class GameModule extends Module {
// No user returned
if (!user) {
-
console.log('no such user');
let msg = {
error: wm.wm.protobuf.ErrorCode.ERR_SUCCESS,
@@ -1231,9 +1230,7 @@ export default class GameModule extends Module {
})
app.post('/method/update_car', async (req, res) => {
-
let body = wm.wm.protobuf.UpdateCarRequest.decode(req.body);
-
let car = await prisma.car.findFirst({
where: {
carId: body.carId
@@ -1280,6 +1277,21 @@ export default class GameModule extends Module {
}
});
+ // Get car item
+ if(body.earnedItems.length !== 0){
+ console.log('Car Item reward available, continuing ...');
+ for(let i=0; i {
-
// Get the request body
// let body = wm.wm.protobuf.UpdateUserSessionRequest.decode(req.body);
@@ -1776,8 +1787,7 @@ export default class GameModule extends Module {
app.post('/method/search_cars_by_level', async (req, res) => {
let body = wm.wm.protobuf.SearchCarsByLevelRequest.decode(req.body);
- console.log(body);
- //---------------MAYBE NOT CORRECT---------------
+ //---------------MAYBE NOT CORRECT---------------
let rampVal = 0;
let pathVal = 0;
if(body.area === 0){ //GID_RUNAREA_C1