From 3d7b575425bde5db8e7f52269b46ac1ea05d9f20 Mon Sep 17 00:00:00 2001 From: memetrollsXD Date: Mon, 1 Aug 2022 17:01:39 +0200 Subject: [PATCH] skip train for now (#7) --- src/http/HttpServer.ts | 1 + .../client/Windows/Archive/M_ArchiveV.bytes | 8 ++ .../Windows/Archive/M_ArchiveV.bytes.ts | 91 ++++++++++++++++++ .../Windows/Archive/M_ArchiveV_cache.bytes | 8 ++ .../asb/design/client/Windows/M_DesignV.bytes | Bin 0 -> 44 bytes src/http/routes/query_gateway.ts | 12 ++- 6 files changed, 116 insertions(+), 4 deletions(-) create mode 100644 src/http/routes/asb/client/Windows/Archive/M_ArchiveV.bytes create mode 100644 src/http/routes/asb/client/Windows/Archive/M_ArchiveV.bytes.ts create mode 100644 src/http/routes/asb/client/Windows/Archive/M_ArchiveV_cache.bytes create mode 100644 src/http/routes/asb/design/client/Windows/M_DesignV.bytes diff --git a/src/http/HttpServer.ts b/src/http/HttpServer.ts index 3026858..a847cad 100644 --- a/src/http/HttpServer.ts +++ b/src/http/HttpServer.ts @@ -22,6 +22,7 @@ export default class HttpServer { private constructor() { this.server = express(); this.server.use(express.json()); + this.server.use('/asb', express.static(resolve(__dirname, './routes/asb'))); this.server.route('/*').all((req, res) => { if (Logger.VERBOSE_LEVEL > VerboseLevel.WARNS) c.log(`${req.method} ${req.url}`); import(`./routes${req.url.split('?')[0]}`).then(async r => { diff --git a/src/http/routes/asb/client/Windows/Archive/M_ArchiveV.bytes b/src/http/routes/asb/client/Windows/Archive/M_ArchiveV.bytes new file mode 100644 index 0000000..24cca3a --- /dev/null +++ b/src/http/routes/asb/client/Windows/Archive/M_ArchiveV.bytes @@ -0,0 +1,8 @@ +{"MajorVersion":0,"MinorVersion":5,"PatchVersion":626209,"ContentHash":"5a81a0850f254a02c541b5b455a050ac","FileSize":37311,"TimeStamp":1653234742,"FileName":"M_Start_AsbV"} +{"MajorVersion":0,"MinorVersion":5,"PatchVersion":626209,"ContentHash":"e791b90c638e60a875fa814113579cea","FileSize":388,"TimeStamp":1653234892,"FileName":"M_Start_BlockV"} +{"MajorVersion":0,"MinorVersion":5,"PatchVersion":626209,"ContentHash":"db85336fec7bb3f1d983129504e843c3","FileSize":5729237,"TimeStamp":1653234806,"FileName":"M_AsbV"} +{"MajorVersion":0,"MinorVersion":5,"PatchVersion":626209,"ContentHash":"83d0d52ebd31c2574cfcf774494654f1","FileSize":6212,"TimeStamp":1653234892,"FileName":"M_BlockV"} +{"MajorVersion":0,"MinorVersion":5,"PatchVersion":626209,"ContentHash":"9f0914e34b3d5d23a561006da866bd5a","FileSize":33875,"TimeStamp":1653233190,"FileName":"M_AudioV"} +{"MajorVersion":0,"MinorVersion":5,"PatchVersion":626209,"ContentHash":"81051bcc2cf1bedf378224b0a93e2877","FileSize":2,"TimeStamp":1653234892,"FileName":"B_M_AudioV"} +{"MajorVersion":0,"MinorVersion":5,"PatchVersion":626209,"ContentHash":"7bf71dd1cf37259e619bbcdda0cde9f5","FileSize":2124,"TimeStamp":1653233196,"FileName":"M_VideoV"} +{"MajorVersion":0,"MinorVersion":5,"PatchVersion":626209,"ContentHash":"81051bcc2cf1bedf378224b0a93e2877","FileSize":2,"TimeStamp":1653234892,"FileName":"M_VideoP"} diff --git a/src/http/routes/asb/client/Windows/Archive/M_ArchiveV.bytes.ts b/src/http/routes/asb/client/Windows/Archive/M_ArchiveV.bytes.ts new file mode 100644 index 0000000..fac0fd2 --- /dev/null +++ b/src/http/routes/asb/client/Windows/Archive/M_ArchiveV.bytes.ts @@ -0,0 +1,91 @@ +import { Request, Response } from "express"; + +// Example: These are multiple JSONs in 1 file. Literal file content below +// {"MajorVersion":0,"MinorVersion":5,"PatchVersion":626209,"ContentHash":"5a81a0850f254a02c541b5b455a050ac","FileSize":37311,"TimeStamp":1653234742,"FileName":"M_Start_AsbV"} +// {"MajorVersion":0,"MinorVersion":5,"PatchVersion":626209,"ContentHash":"e791b90c638e60a875fa814113579cea","FileSize":388,"TimeStamp":1653234892,"FileName":"M_Start_BlockV"} +// {"MajorVersion":0,"MinorVersion":5,"PatchVersion":626209,"ContentHash":"db85336fec7bb3f1d983129504e843c3","FileSize":5729237,"TimeStamp":1653234806,"FileName":"M_AsbV"} +// {"MajorVersion":0,"MinorVersion":5,"PatchVersion":626209,"ContentHash":"83d0d52ebd31c2574cfcf774494654f1","FileSize":6212,"TimeStamp":1653234892,"FileName":"M_BlockV"} +// {"MajorVersion":0,"MinorVersion":5,"PatchVersion":626209,"ContentHash":"9f0914e34b3d5d23a561006da866bd5a","FileSize":33875,"TimeStamp":1653233190,"FileName":"M_AudioV"} +// {"MajorVersion":0,"MinorVersion":5,"PatchVersion":626209,"ContentHash":"81051bcc2cf1bedf378224b0a93e2877","FileSize":2,"TimeStamp":1653234892,"FileName":"B_M_AudioV"} +// {"MajorVersion":0,"MinorVersion":5,"PatchVersion":626209,"ContentHash":"7bf71dd1cf37259e619bbcdda0cde9f5","FileSize":2124,"TimeStamp":1653233196,"FileName":"M_VideoV"} +// {"MajorVersion":0,"MinorVersion":5,"PatchVersion":626209,"ContentHash":"81051bcc2cf1bedf378224b0a93e2877","FileSize":2,"TimeStamp":1653234892,"FileName":"M_VideoP"} + + +export default function handle(req: Request, res: Response) { + const dataObj = { + start_asbv: { + MajorVersion: 0, + MinorVersion: 5, + PatchVersion: 626209, + ContentHash: "5a81a0850f254a02c541b5b455a050ac", + FileSize: 37311, + TimeStamp: 1653234742, + FileName: "M_Start_AsbV" + }, + start_blockv: { + MajorVersion: 0, + MinorVersion: 5, + PatchVersion: 626209, + ContentHash: "e791b90c638e60a875fa814113579cea", + FileSize: 388, + TimeStamp: 1653234892, + FileName: "M_Start_BlockV" + }, + asbv: { + MajorVersion: 0, + MinorVersion: 5, + PatchVersion: 626209, + ContentHash: "db85336fec7bb3f1d983129504e843c3", + FileSize: 5729237, + TimeStamp: 1653234806, + FileName: "M_AsbV" + }, + blockv: { + MajorVersion: 0, + MinorVersion: 5, + PatchVersion: 626209, + ContentHash: "83d0d52ebd31c2574cfcf774494654f1", + FileSize: 6212, + TimeStamp: 1653234892, + FileName: "M_BlockV" + }, + audiov: { + MajorVersion: 0, + MinorVersion: 5, + PatchVersion: 626209, + ContentHash: "9f0914e34b3d5d23a561006da866bd5a", + FileSize: 33875, + TimeStamp: 1653233190, + FileName: "M_AudioV" + }, + bmaudiov: { + MajorVersion: 0, + MinorVersion: 5, + PatchVersion: 626209, + ContentHash: "81051bcc2cf1bedf378224b0a93e2877", + FileSize: 2, + TimeStamp: 1653234892, + FileName: "B_M_AudioV" + }, + videov: { + MajorVersion: 0, + MinorVersion: 5, + PatchVersion: 626209, + ContentHash: "7bf71dd1cf37259e619bbcdda0cde9f5", + FileSize: 2124, + TimeStamp: 1653233196, + FileName: "M_VideoV" + }, + videop: { + MajorVersion: 0, + MinorVersion: 5, + PatchVersion: 626209, + ContentHash: "81051bcc2cf1bedf378224b0a93e2877", + FileSize: 2, + TimeStamp: 1653234892, + FileName: "M_VideoP" + } + } + + res.send(Object.values(dataObj).map(x => JSON.stringify(x)).join("\n")); +} \ No newline at end of file diff --git a/src/http/routes/asb/client/Windows/Archive/M_ArchiveV_cache.bytes b/src/http/routes/asb/client/Windows/Archive/M_ArchiveV_cache.bytes new file mode 100644 index 0000000..24cca3a --- /dev/null +++ b/src/http/routes/asb/client/Windows/Archive/M_ArchiveV_cache.bytes @@ -0,0 +1,8 @@ +{"MajorVersion":0,"MinorVersion":5,"PatchVersion":626209,"ContentHash":"5a81a0850f254a02c541b5b455a050ac","FileSize":37311,"TimeStamp":1653234742,"FileName":"M_Start_AsbV"} +{"MajorVersion":0,"MinorVersion":5,"PatchVersion":626209,"ContentHash":"e791b90c638e60a875fa814113579cea","FileSize":388,"TimeStamp":1653234892,"FileName":"M_Start_BlockV"} +{"MajorVersion":0,"MinorVersion":5,"PatchVersion":626209,"ContentHash":"db85336fec7bb3f1d983129504e843c3","FileSize":5729237,"TimeStamp":1653234806,"FileName":"M_AsbV"} +{"MajorVersion":0,"MinorVersion":5,"PatchVersion":626209,"ContentHash":"83d0d52ebd31c2574cfcf774494654f1","FileSize":6212,"TimeStamp":1653234892,"FileName":"M_BlockV"} +{"MajorVersion":0,"MinorVersion":5,"PatchVersion":626209,"ContentHash":"9f0914e34b3d5d23a561006da866bd5a","FileSize":33875,"TimeStamp":1653233190,"FileName":"M_AudioV"} +{"MajorVersion":0,"MinorVersion":5,"PatchVersion":626209,"ContentHash":"81051bcc2cf1bedf378224b0a93e2877","FileSize":2,"TimeStamp":1653234892,"FileName":"B_M_AudioV"} +{"MajorVersion":0,"MinorVersion":5,"PatchVersion":626209,"ContentHash":"7bf71dd1cf37259e619bbcdda0cde9f5","FileSize":2124,"TimeStamp":1653233196,"FileName":"M_VideoV"} +{"MajorVersion":0,"MinorVersion":5,"PatchVersion":626209,"ContentHash":"81051bcc2cf1bedf378224b0a93e2877","FileSize":2,"TimeStamp":1653234892,"FileName":"M_VideoP"} diff --git a/src/http/routes/asb/design/client/Windows/M_DesignV.bytes b/src/http/routes/asb/design/client/Windows/M_DesignV.bytes new file mode 100644 index 0000000000000000000000000000000000000000..eb259e90a1f2dceb458adc2a567dec0227ea26b3 GIT binary patch literal 44 rcmZQz00UMA&b~mq3Gpj0q$tbfPo1!|X1QB3ScX~83PdM$Wj6r;+Gz@c literal 0 HcmV?d00001 diff --git a/src/http/routes/query_gateway.ts b/src/http/routes/query_gateway.ts index 2879d9e..6a807ef 100644 --- a/src/http/routes/query_gateway.ts +++ b/src/http/routes/query_gateway.ts @@ -5,14 +5,18 @@ import Config from "../../util/Config"; import { Gateserver } from "../../data/proto/StarRail"; export default function handle(req: Request, res: Response) { - const dataObj = Gateserver.fromJSON({ + const dataObj = Gateserver.fromPartial({ retcode: 0, msg: "OK", regionName: "CrepeSR", ip: Config.GAMESERVER.SERVER_IP, port: Config.GAMESERVER.SERVER_PORT, - serverDescription: "This is not BingusRail" - }); + serverDescription: "This is not BingusRail", + exResourceUrl: "https://localhost/asb/design", + dataUseAssetBoundle: false, + resUseAssetBoundle: false, + assetBundleUrl: "https://localhost/asb", + } as Gateserver); if (Config.GAMESERVER.MAINTENANCE) { dataObj.retcode = 2; @@ -25,7 +29,7 @@ export default function handle(req: Request, res: Response) { try { rsp = Gateserver.encode(dataObj).finish(); } catch { - rsp = Gateserver.encode(Gateserver.fromJSON({ + rsp = Gateserver.encode(Gateserver.fromPartial({ retcode: 2, msg: "Internal server error", stopBeginTime: Date.now(),