mirror of
https://github.com/shiroikitsu8/Bayshore_6r_legacy.git
synced 2024-11-12 02:01:02 +01:00
Out of ideas rn lmao
This commit is contained in:
parent
300ff4d24e
commit
39a7b0a542
@ -21,6 +21,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@prisma/client": "^4.0.0",
|
||||
"body-parser": "^1.20.0",
|
||||
"express": "^4.18.1",
|
||||
"protobufjs": "^7.0.0",
|
||||
"ts-proto": "^1.117.0"
|
||||
|
10
src/index.ts
10
src/index.ts
@ -3,10 +3,18 @@
|
||||
|
||||
import express from 'express';
|
||||
import {PrismaClient} from '@prisma/client';
|
||||
import https from 'https';
|
||||
import https, {globalAgent} from 'https';
|
||||
import fs from 'fs';
|
||||
import bodyParser from 'body-parser';
|
||||
globalAgent.options.keepAlive = true;
|
||||
|
||||
// @ts-ignore
|
||||
require('http').globalAgent.options.keepAlive = true;
|
||||
|
||||
const app = express();
|
||||
app.use(bodyParser.raw({
|
||||
type: '*/*'
|
||||
}));
|
||||
|
||||
let dirs = fs.readdirSync('dist/modules');
|
||||
for (let i of dirs) {
|
||||
|
@ -1,8 +1,46 @@
|
||||
import { Application } from "express";
|
||||
import {Module} from "module";
|
||||
import {ClientLogType, ErrorCode, RegisterSystemInfoRequest, RegisterSystemInfoResponse} from "../proto/wm";
|
||||
|
||||
export default class StartupModule extends Module {
|
||||
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;
|
||||
latestCompetitionId: number;
|
||||
competitionSchedule: GhostCompetitionSchedule | undefined;
|
||||
scratchNotes: string;
|
||||
scratchNotes: string | undefined;
|
||||
inviteFriendCampaignSchedule: InviteFriendCampaignSchedule | undefined;
|
||||
ghostSelectionMinRedoWait: number;
|
||||
ghostSelectionMaxRedoWait: number;
|
||||
@ -3003,8 +3003,8 @@ export const RegisterSystemInfoResponse = {
|
||||
writer.uint32(98).fork()
|
||||
).ldelim();
|
||||
}
|
||||
if (message.scratchNotes !== "") {
|
||||
writer.uint32(154).string(message.scratchNotes);
|
||||
if (message.scratchNotes !== undefined && message.scratchNotes !== "") {
|
||||
writer.uint32(154).string(message.scratchNotes as any as string);
|
||||
}
|
||||
if (message.inviteFriendCampaignSchedule !== undefined) {
|
||||
InviteFriendCampaignSchedule.encode(
|
||||
|
@ -267,7 +267,7 @@ bluebird@^3.7.2:
|
||||
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f"
|
||||
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"
|
||||
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==
|
||||
|
Loading…
Reference in New Issue
Block a user