1
0
mirror of synced 2024-11-12 01:10:47 +01:00

Emergency fix! Disallow empty IDs

This commit is contained in:
Rin 2022-07-17 19:27:27 +01:00
parent 720bc08035
commit 23fc62b5a6

View File

@ -165,6 +165,23 @@ export default class GameModule extends Module {
spappState: wm.wm.protobuf.SmartphoneAppState.SPAPP_UNREGISTERED,
transferState: wm.wm.protobuf.TransferState.NOT_REGISTERED
};
if (!body.cardChipId || !body.accessCode) {
let msg = {
error: wm.wm.protobuf.ErrorCode.ERR_ID_BANNED,
numOfOwnedCars: 0,
spappState: wm.wm.protobuf.SmartphoneAppState.SPAPP_UNREGISTERED,
transferState: wm.wm.protobuf.TransferState.NOT_REGISTERED
}
let resp = wm.wm.protobuf.LoadUserResponse.encode(msg);
let end = resp.finish();
let r = res
.header('Server', 'v388 wangan')
.header('Content-Type', 'application/x-protobuf; revision=8053')
.header('Content-Length', end.length.toString())
.status(200);
r.send(Buffer.from(end));
return;
}
let user = await prisma.user.create({
data: {
chipId: body.cardChipId,