返回提交历史
Modified
.gitignore
+1
-1
Modified
config.json
+3
-1
Modified
src/controllers/api/loginController.ts
+6
-2
Modified
src/controllers/dynamic/worldStateController.ts
+4
-0
Modified
src/routes/cache.ts
+2
-1
XFEstudio/SpaceNinjaServer
add version config (#2)
* update * update * update
df214749
代码差异
5 个文件
+16
-5
@@ -2,4 +2,4 @@
2
2
/build
3
3
4
4
/.env
5
/static/data/*
5
/static/data/*
@@ -1,5 +1,7 @@
1
1
{
2
2
"autoCreateAccount": true,
3
3
"buildLabel": "2023.05.23.12.37/kM-ONnYx6PjFfVyxn0zuvw",
4
"matchmakingBuildId": "4920386201513015989"
4
"matchmakingBuildId": "4920386201513015989",
5
"version": "33.0.12",
6
"worldSeed": "SBripfQVIPcz+hCzf1LUSvFpsmnJaAfTEH2x/7YAWaiCGT8vxTMtVlk+SLLalLy5gtrFxHflQET2BJOKe8r0py9xFJAwi+TEP2VsfPGcs3l75kYvcpL7X7sEiISEFCt85O99GjXdGyyFwMhtvEvL5pzEVpaQu7dw4KcLtHY30q3aTM9pI4m4Qx1gPDkmyMrCKq7pzHHtA9QsFKWOunSwpfNJ49xCIZADeD30h5nshcFMl/3yipL9K0WHoouMZMLMwfCWMgFnxAazRznwda8XRjNgyuhfAQTeaPnFuLf3YJVde3FbJ4PBWX4uysx1PJHuVqMNaAe1TsDV6f2UzQ2M/g=="
5
7
}
@@ -1,13 +1,17 @@
1
/* eslint-disable @typescript-eslint/no-unused-vars */
2
import { RequestHandler } from "express";
3
4
import config from "@/config.json";
5
1
6
import { toLoginRequest } from "@/src/helpers/loginHelpers";
2
7
import { Account } from "@/src/models/loginModel";
3
8
import { createAccount, isCorrectPassword } from "@/src/services/loginService";
4
9
import { ILoginResponse } from "@/src/types/loginTypes";
5
10
import { DTLS, groups, HUB, IRC, Nonce, NRS, platformCDNs } from "@/static/fixed_responses/login_static";
6
import { RequestHandler } from "express";
7
import config from "../../../config.json";
8
11
9
12
// eslint-disable-next-line @typescript-eslint/no-misused-promises
10
13
const loginController: RequestHandler = async (request, response) => {
14
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-argument
11
15
const body = JSON.parse(request.body); // parse octet stream of json data to json object
12
16
const loginRequest = toLoginRequest(body);
13
17
// console.log(body);
@@ -1,7 +1,11 @@
1
1
import { RequestHandler } from "express";
2
import config from "@/config.json";
2
3
import worldState from "@/static/fixed_responses/worldState.json";
3
4
4
5
const worldStateController: RequestHandler = (_req, res) => {
6
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
7
worldState.WorldSeed = config.worldSeed;
8
worldState.BuildLabel = config.buildLabel;
5
9
res.json(worldState);
6
10
};
7
11
@@ -1,4 +1,5 @@
1
1
import express from "express";
2
import config from "@/config.json";
2
3
3
4
const cacheRouter = express.Router();
4
5
@@ -15,7 +16,7 @@ cacheRouter.get("/B.Cache.Windows_en.bin*", (_req, res) => {
15
16
cacheRouter.get(/^\/origin\/([a-zA-Z0-9]+)\/H\.Cache\.bin.*$/, (_req, res) => {
16
17
// console.log("asd", path.join(__dirname, "../data"));
17
18
// console.log("asd", __dirname);
18
res.sendFile("static/data/H.Cache_33.0.12.bin", { root: "./" });
19
res.sendFile(`static/data/H.Cache_${config.version}.bin`, { root: "./" });
19
20
});
20
21
21
22
export { cacheRouter };