1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-05 10:22:31 +01:00

🐛 fix fosscord.js

This commit is contained in:
Flam3rboy 2021-09-13 17:51:37 +02:00
parent 0ddca07df0
commit 324eb7f1dd
3 changed files with 18 additions and 2 deletions

View File

@ -9,4 +9,18 @@ router.get("/", route({}), (req: Request, res: Response) => {
res.json({ url: endpoint || process.env.GATEWAY || "ws://localhost:3002" });
});
router.get("/bot", route({}), (req: Request, res: Response) => {
const { endpoint } = Config.get().gateway;
res.json({
url: endpoint || process.env.GATEWAY || "ws://localhost:3002",
shards: 1,
session_start_limit: {
total: 1000,
remaining: 999,
reset_after: 14400000,
max_concurrency: 1
}
});
});
export default router;

View File

@ -50,12 +50,13 @@ export async function onIdentify(this: WebSocket, data: Payload) {
this.shard_id = identify.shard[0];
this.shard_count = identify.shard[1];
if (
!this.shard_count ||
!this.shard_id ||
this.shard_count == null ||
this.shard_id == null ||
this.shard_id >= this.shard_count ||
this.shard_id < 0 ||
this.shard_count <= 0
) {
console.log(identify.shard);
return this.close(CLOSECODES.Invalid_shard);
}
}

View File

@ -43,6 +43,7 @@ export const IdentifySchema = {
$user_guild_settings_version: Number,
},
$v: Number,
$version: Number,
};
export interface IdentifySchema {