BREAKING: Version checking

This commit is contained in:
memetrollsXD 2022-08-02 02:19:54 +02:00
parent 01e60ab390
commit b298649e30
No known key found for this signature in database
GPG Key ID: 105C2F3417AC32CD
2 changed files with 11 additions and 1 deletions

View File

@ -4,5 +4,6 @@
"t": "target", "t": "target",
"acc": "account", "acc": "account",
"d": "debug", "d": "debug",
"?": "help" "?": "help",
"m": "maintenance"
} }

View File

@ -25,6 +25,15 @@ export default function handle(req: Request, res: Response) {
dataObj.stopEndTime = Date.now() * 2; dataObj.stopEndTime = Date.now() * 2;
} }
const url = new URL(`https://crepe.sr${req.originalUrl}`);
const query = new URLSearchParams(url.search);
const version = query.get("version");
if (version !== "OSGMWin0.70.0") {
dataObj.retcode = 2;
dataObj.msg = "Unknown StarRail version. Did you forget to update your client?\nSupport Discord: https://discord.gg/QYZxrcJkjH";
}
let rsp; let rsp;
try { try {
rsp = Gateserver.encode(dataObj).finish(); rsp = Gateserver.encode(dataObj).finish();