summary refs log tree commit diff
path: root/gateway/src
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-09-13 17:51:37 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-09-13 17:51:37 +0200
commit8568b3cdce917731f99456601b31228b933fa9ed (patch)
treeca20c0f83518e7cd12018989e957312073b4da86 /gateway/src
parent:art: remove unused imports (diff)
downloadserver-8568b3cdce917731f99456601b31228b933fa9ed.tar.xz
:bug: fix fosscord.js
Diffstat (limited to 'gateway/src')
-rw-r--r--gateway/src/opcodes/Identify.ts5
-rw-r--r--gateway/src/schema/Identify.ts1
2 files changed, 4 insertions, 2 deletions
diff --git a/gateway/src/opcodes/Identify.ts b/gateway/src/opcodes/Identify.ts

index 9eb4cd32..f6a4478f 100644 --- a/gateway/src/opcodes/Identify.ts +++ b/gateway/src/opcodes/Identify.ts
@@ -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); } } diff --git a/gateway/src/schema/Identify.ts b/gateway/src/schema/Identify.ts
index 0835ddc7..6054f2e8 100644 --- a/gateway/src/schema/Identify.ts +++ b/gateway/src/schema/Identify.ts
@@ -43,6 +43,7 @@ export const IdentifySchema = { $user_guild_settings_version: Number, }, $v: Number, + $version: Number, }; export interface IdentifySchema {