mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-05 18:32:33 +01:00
🐛 fix fosscord.js
This commit is contained in:
parent
0ddca07df0
commit
324eb7f1dd
@ -9,4 +9,18 @@ router.get("/", route({}), (req: Request, res: Response) => {
|
|||||||
res.json({ url: endpoint || process.env.GATEWAY || "ws://localhost:3002" });
|
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;
|
export default router;
|
||||||
|
@ -50,12 +50,13 @@ export async function onIdentify(this: WebSocket, data: Payload) {
|
|||||||
this.shard_id = identify.shard[0];
|
this.shard_id = identify.shard[0];
|
||||||
this.shard_count = identify.shard[1];
|
this.shard_count = identify.shard[1];
|
||||||
if (
|
if (
|
||||||
!this.shard_count ||
|
this.shard_count == null ||
|
||||||
!this.shard_id ||
|
this.shard_id == null ||
|
||||||
this.shard_id >= this.shard_count ||
|
this.shard_id >= this.shard_count ||
|
||||||
this.shard_id < 0 ||
|
this.shard_id < 0 ||
|
||||||
this.shard_count <= 0
|
this.shard_count <= 0
|
||||||
) {
|
) {
|
||||||
|
console.log(identify.shard);
|
||||||
return this.close(CLOSECODES.Invalid_shard);
|
return this.close(CLOSECODES.Invalid_shard);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,6 +43,7 @@ export const IdentifySchema = {
|
|||||||
$user_guild_settings_version: Number,
|
$user_guild_settings_version: Number,
|
||||||
},
|
},
|
||||||
$v: Number,
|
$v: Number,
|
||||||
|
$version: Number,
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface IdentifySchema {
|
export interface IdentifySchema {
|
||||||
|
Loading…
Reference in New Issue
Block a user