diff --git a/src/modules/game.ts b/src/modules/game.ts index be97c06..cb62902 100644 --- a/src/modules/game.ts +++ b/src/modules/game.ts @@ -1,7 +1,7 @@ import e, { Application } from "express"; import { Module } from "../module"; import * as wm from "../wmmt/wm.proto"; -import * as svc from "../wmmt/service.proto"; +import * as wms from "../wmmt/service.proto"; import { prisma } from ".."; import { Car, User } from "@prisma/client"; import { Config } from "../config"; @@ -269,7 +269,6 @@ export default class GameModule extends Module { } case wm.wm.protobuf.GameMode.MODE_VS_BATTLE: { - console.log(body); let saveEx: any = {}; if(body.vsResult?.vsPlayCount !== null && body.vsResult?.vsPlayCount !== undefined){ saveEx.vsPlayCount = body.vsResult?.vsPlayCount!; @@ -407,7 +406,7 @@ export default class GameModule extends Module { }, }, }) - console.log('How many meter already obtained : ' +carItemCount); + console.log('How many meter already obtained : ' +carItemCount.length); let sqlVal = 0; for(let i=0; i { let body = wm.wm.protobuf.LoadGhostBattleInfoRequest.decode(req.body); + + let cars = await prisma.car.findMany({ + include:{ + gtWing: true + } + }); + + let lists_stamptarget: wm.wm.protobuf.StampTargetCar[] = []; + for(let i=0; i { + let body = wm.wm.protobuf.LoadStampTargetRequest.decode(req.body); + + let msg = { + error: wm.wm.protobuf.ErrorCode.ERR_SUCCESS, + }; + //----------------------------------------------- + let resp = wm.wm.protobuf.LoadStampTargetResponse.encode(msg); + let end = resp.finish(); + let r = res + .header('Server', 'v388 wangan') + .header('Content-Type', 'application/x-protobuf; revision=8053') + .header('Content-Length', end.length.toString()) + .status(200); + r.send(Buffer.from(end)); + }) + app.post('/method/search_cars_by_level', async (req, res) => { let body = wm.wm.protobuf.SearchCarsByLevelRequest.decode(req.body); //---------------MAYBE NOT CORRECT--------------- @@ -2188,6 +2223,23 @@ export default class GameModule extends Module { .header('Content-Length', end.length.toString()) .status(200); r.send(Buffer.from(end)); + }) + + app.post('/method/lock_crown', (req, res) => { + let body = wms.wm.protobuf.LockCrownRequest.decode(req.body); + //---------------MAYBE NOT CORRECT--------------- + let msg = { + error: wms.wm.protobuf.ErrorCode.ERR_SUCCESS, + }; + //----------------------------------------------- + let resp = wms.wm.protobuf.LockCrownResponse.encode(msg); + let end = resp.finish(); + let r = res + .header('Server', 'v388 wangan') + .header('Content-Type', 'application/x-protobuf; revision=8053') + .header('Content-Length', end.length.toString()) + .status(200); + r.send(Buffer.from(end)); }) } } diff --git a/src/modules/startup.ts b/src/modules/startup.ts index 3c0cfa9..e5bdc59 100644 --- a/src/modules/startup.ts +++ b/src/modules/startup.ts @@ -102,8 +102,8 @@ export default class StartupModule extends Module { result: resulttime, name: 'GUEST', regionId: 0, - model: Math.floor(Math.random() * 100), - visualModel: Math.floor(Math.random() * 100), + model: Math.floor(Math.random() * 106) + 1, + visualModel: Math.floor(Math.random() * 106) + 1, defaultColor: 0, tunePower: 0, tuneHandling: 0, @@ -152,8 +152,8 @@ export default class StartupModule extends Module { result: 0, name: 'GUEST', regionId: 0, - model: Math.floor(Math.random() * 100), - visualModel: Math.floor(Math.random() * 100), + model: Math.floor(Math.random() * 106) + 1, + visualModel: Math.floor(Math.random() * 106) + 1, defaultColor: 0, tunePower: 0, tuneHandling: 0, @@ -199,8 +199,8 @@ export default class StartupModule extends Module { result: 0, name: 'GUEST', regionId: 0, - model: Math.floor(Math.random() * 100), - visualModel: Math.floor(Math.random() * 100), + model: Math.floor(Math.random() * 106) + 1, + visualModel: Math.floor(Math.random() * 106) + 1, defaultColor: 0, tunePower: 0, tuneHandling: 0,