mirror of
https://github.com/shiroikitsu8/Bayshore_6r_legacy.git
synced 2025-02-26 18:21:43 +01:00
Out of ideas rn lmao
This commit is contained in:
parent
300ff4d24e
commit
39a7b0a542
@ -21,6 +21,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@prisma/client": "^4.0.0",
|
"@prisma/client": "^4.0.0",
|
||||||
|
"body-parser": "^1.20.0",
|
||||||
"express": "^4.18.1",
|
"express": "^4.18.1",
|
||||||
"protobufjs": "^7.0.0",
|
"protobufjs": "^7.0.0",
|
||||||
"ts-proto": "^1.117.0"
|
"ts-proto": "^1.117.0"
|
||||||
|
10
src/index.ts
10
src/index.ts
@ -3,10 +3,18 @@
|
|||||||
|
|
||||||
import express from 'express';
|
import express from 'express';
|
||||||
import {PrismaClient} from '@prisma/client';
|
import {PrismaClient} from '@prisma/client';
|
||||||
import https from 'https';
|
import https, {globalAgent} from 'https';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
|
import bodyParser from 'body-parser';
|
||||||
|
globalAgent.options.keepAlive = true;
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
|
require('http').globalAgent.options.keepAlive = true;
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
|
app.use(bodyParser.raw({
|
||||||
|
type: '*/*'
|
||||||
|
}));
|
||||||
|
|
||||||
let dirs = fs.readdirSync('dist/modules');
|
let dirs = fs.readdirSync('dist/modules');
|
||||||
for (let i of dirs) {
|
for (let i of dirs) {
|
||||||
|
@ -1,8 +1,46 @@
|
|||||||
import { Application } from "express";
|
import { Application } from "express";
|
||||||
import {Module} from "module";
|
import {Module} from "module";
|
||||||
|
import {ClientLogType, ErrorCode, RegisterSystemInfoRequest, RegisterSystemInfoResponse} from "../proto/wm";
|
||||||
|
|
||||||
export default class StartupModule extends Module {
|
export default class StartupModule extends Module {
|
||||||
register(app: Application): void {
|
register(app: Application): void {
|
||||||
console.log('test!');
|
app.post('/method/register_system_info', (req, res) => {
|
||||||
|
for (let i of req.rawHeaders) {
|
||||||
|
console.log(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
let b = RegisterSystemInfoRequest.decode(req.body);
|
||||||
|
console.log(b);
|
||||||
|
let msg = {
|
||||||
|
error: ErrorCode.ERR_SUCCESS,
|
||||||
|
regionId: b.allnetRegion0,
|
||||||
|
placeId: b.allnetPlaceId.toString(),
|
||||||
|
allowedClientLogTypes: [
|
||||||
|
ClientLogType.LOG_ERROR
|
||||||
|
],
|
||||||
|
ghostSelectionMinRedoWait: 1,
|
||||||
|
ghostSelectionMaxRedoWait: 3,
|
||||||
|
inviteFriendCampaignSchedule: undefined,
|
||||||
|
featureVersion: {
|
||||||
|
version: 304,
|
||||||
|
year: 2022,
|
||||||
|
month: 7,
|
||||||
|
pluses: 1,
|
||||||
|
releaseAt: 1657438767 // idk what this is
|
||||||
|
},
|
||||||
|
latestCompetitionId: 0,
|
||||||
|
competitionSchedule: undefined,
|
||||||
|
scratchNotes: "test" // null
|
||||||
|
}
|
||||||
|
let resp = RegisterSystemInfoResponse.encode(msg);
|
||||||
|
let end = resp.finish();
|
||||||
|
let r = res
|
||||||
|
.header('User-Agent', 'v388 wangan')
|
||||||
|
.header('Content-Type', 'application/x-protobuf; revision=8053');
|
||||||
|
r.write(Buffer.from(end));
|
||||||
|
r.writeContinue(() => {
|
||||||
|
console.log('writeContinue')
|
||||||
|
});
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1418,7 +1418,7 @@ export interface RegisterSystemInfoResponse {
|
|||||||
featureVersion: GameFeatureVersion | undefined;
|
featureVersion: GameFeatureVersion | undefined;
|
||||||
latestCompetitionId: number;
|
latestCompetitionId: number;
|
||||||
competitionSchedule: GhostCompetitionSchedule | undefined;
|
competitionSchedule: GhostCompetitionSchedule | undefined;
|
||||||
scratchNotes: string;
|
scratchNotes: string | undefined;
|
||||||
inviteFriendCampaignSchedule: InviteFriendCampaignSchedule | undefined;
|
inviteFriendCampaignSchedule: InviteFriendCampaignSchedule | undefined;
|
||||||
ghostSelectionMinRedoWait: number;
|
ghostSelectionMinRedoWait: number;
|
||||||
ghostSelectionMaxRedoWait: number;
|
ghostSelectionMaxRedoWait: number;
|
||||||
@ -3003,8 +3003,8 @@ export const RegisterSystemInfoResponse = {
|
|||||||
writer.uint32(98).fork()
|
writer.uint32(98).fork()
|
||||||
).ldelim();
|
).ldelim();
|
||||||
}
|
}
|
||||||
if (message.scratchNotes !== "") {
|
if (message.scratchNotes !== undefined && message.scratchNotes !== "") {
|
||||||
writer.uint32(154).string(message.scratchNotes);
|
writer.uint32(154).string(message.scratchNotes as any as string);
|
||||||
}
|
}
|
||||||
if (message.inviteFriendCampaignSchedule !== undefined) {
|
if (message.inviteFriendCampaignSchedule !== undefined) {
|
||||||
InviteFriendCampaignSchedule.encode(
|
InviteFriendCampaignSchedule.encode(
|
||||||
|
@ -267,7 +267,7 @@ bluebird@^3.7.2:
|
|||||||
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f"
|
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f"
|
||||||
integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==
|
integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==
|
||||||
|
|
||||||
body-parser@1.20.0:
|
body-parser@1.20.0, body-parser@^1.20.0:
|
||||||
version "1.20.0"
|
version "1.20.0"
|
||||||
resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.0.tgz#3de69bd89011c11573d7bfee6a64f11b6bd27cc5"
|
resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.0.tgz#3de69bd89011c11573d7bfee6a64f11b6bd27cc5"
|
||||||
integrity sha512-DfJ+q6EPcGKZD1QWUjSpqp+Q7bDQTsQIF4zfUAtZ6qk+H/3/QRhg9CEp39ss+/T2vw0+HaidC0ecJj/DRLIaKg==
|
integrity sha512-DfJ+q6EPcGKZD1QWUjSpqp+Q7bDQTsQIF4zfUAtZ6qk+H/3/QRhg9CEp39ss+/T2vw0+HaidC0ecJj/DRLIaKg==
|
||||||
|
Loading…
x
Reference in New Issue
Block a user