1
0
mirror of synced 2025-02-22 13:10:26 +01:00

Re-did changes that allowed newer Node.JS to work, change env example's ALL.NET port to 80

This commit is contained in:
leezhiwei 2024-09-15 01:16:42 +08:00
parent 1ba8f9c7f2
commit fe9ba87c70
15 changed files with 27 additions and 24 deletions

View File

@ -1,5 +1,5 @@
POSTGRES_URL=postgresql://user:password@your-host:5432/database
ALLNET_PORT=20080
ALLNET_PORT=80
MUCHA_PORT=10082
SERVICE_PORT=9002
API_PORT=9003

1
.gitignore vendored
View File

@ -10,3 +10,4 @@ config.json
ecosystem.config.js
static/*
screenshot/*
yarn.lock

View File

@ -118,10 +118,10 @@ let dirs = fs.readdirSync(path.join(path.dirname(__filename), 'modules'));
for (let i of dirs)
{
// If the file is a .js file
if (i.endsWith('.js'))
if (i.endsWith('.js') || i.endsWith('.ts')) // if running directly from ts files
{
// Require the module file
let mod = require(`./modules/${i.substring(0, i.length - 3)}`); // .js extension
let mod = require(`./modules/${i.substring(0, i.length - 3)}`);
// Create an instance of the module
let inst = new mod.default();

View File

@ -12,7 +12,7 @@ import * as carFunctions from "./cars/functions";
import * as terminal from "./terminal/check_car";
export default class CarModule extends Module {
export default class CarModule {
register(app: Application): void {
// Load Car

View File

@ -16,7 +16,7 @@ import * as ghost from "./game/ghost";
import * as versus from "./game/versus";
export default class GameModule extends Module {
export default class GameModule {
register(app: Application): void {
// Saving the game result on mileage screen

View File

@ -42,10 +42,10 @@ export async function saveStoryResult(body: wm.protobuf.SaveGameResultRequest, c
}
// If the lose bits are set, and are long data
if (Long.isLong(storyResult.stLoseBits))
if (Long.isLong(storyResult.stLoseBits) && storyResult && storyResult.stLoseBits)
{
// Convert them to BigInt and add to the data
data.stLoseBits = common.getBigIntFromLong(storyResult.stLoseBits);
data.stLoseBits = common.getBigIntFromLong(storyResult.stLoseBits as Long);
stLoseBits = data.stLoseBits
// If a loss has been recorded

View File

@ -16,7 +16,7 @@ import * as ghost_trail from "./ghost/ghost_util/ghost_trail";
import * as ghost_area from "./ghost/ghost_util/ghost_area";
export default class GhostModule extends Module {
export default class GhostModule {
register(app: Application): void {
// Load Ghost Battle Info
@ -307,10 +307,10 @@ export default class GhostModule extends Module {
let actualSessionId: number = 0;
// If the session are set, and are long data
if(Long.isLong(body.ghostSessionId))
if(Long.isLong(body.ghostSessionId) && body && body.ghostSessionId)
{
// Convert them to BigInt and add to the data
actualSessionId = common.getBigIntFromLong(body.ghostSessionId);
actualSessionId = common.getBigIntFromLong(body.ghostSessionId as Long);
}
// -----------------------------------------------------------------------------------------

View File

@ -12,7 +12,7 @@ import * as ghost_ocm from "./ghost/ghost_ocm";
import * as ghost_ocm_area from "./ghost/ghost_util/ghost_ocm_area";
export default class GhostModule extends Module {
export default class GhostModule {
register(app: Application): void {
// Get OCM Battle event info

View File

@ -14,7 +14,7 @@ import * as crown_list from "./resource/crown_list";
import * as ranking from "./resource/ranking";
export default class ResourceModule extends Module {
export default class ResourceModule {
register(app: Application): void {
// Place List
@ -74,7 +74,6 @@ export default class ResourceModule extends Module {
// Encode the response
let message = wm.wm.protobuf.PlaceList.encode({places});
// Send the response to the client
common.sendResponse(message, res, req.rawHeaders);
})

View File

@ -9,7 +9,7 @@ import * as common from "./util/common";
import * as startupFunctions from "./startup/functions";
export default class StartupModule extends Module {
export default class StartupModule {
register(app: Application): void {
// Register system info upon booting

View File

@ -12,7 +12,7 @@ import * as scratch from "./terminal/scratch";
import * as common from "./util/common";
export default class TerminalModule extends Module {
export default class TerminalModule {
register(app: Application): void {
// Load upon enter terminal

View File

@ -9,7 +9,7 @@ import * as wm from "../wmmt/wm.proto";
import * as common from "./util/common";
export default class TimeAttackModule extends Module {
export default class TimeAttackModule {
register(app: Application): void {
// Load time Attack Record

View File

@ -11,7 +11,7 @@ import * as scratch from "./terminal/scratch";
import * as common from "./util/common";
export default class UserModule extends Module {
export default class UserModule {
register(app: Application): void {
// Load user data when entering the game or after tapping the bannapass card

View File

@ -5,7 +5,10 @@
"strict": true,
"lib": ["esnext"],
"esModuleInterop": true,
"allowJs": true
"allowJs": true,
"types":[
"long"
]
},
"include": ["src/**/*"],
"exclude": ["src/wmmt/**/*"]