summary refs log tree commit diff
path: root/gateway/src/opcodes/Heartbeat.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-12 20:18:05 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-12 20:18:05 +0200
commitd24348ef0f53c80ad618056c45eda6c147525133 (patch)
tree7cf427eb871c2127aef1fdd6c9659452415cd0d6 /gateway/src/opcodes/Heartbeat.ts
parentMerge branch 'master' into gateway (diff)
downloadserver-d24348ef0f53c80ad618056c45eda6c147525133.tar.xz
:sparkles: gateway
Diffstat (limited to 'gateway/src/opcodes/Heartbeat.ts')
-rw-r--r--gateway/src/opcodes/Heartbeat.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/gateway/src/opcodes/Heartbeat.ts b/gateway/src/opcodes/Heartbeat.ts
new file mode 100644

index 00000000..015257b9 --- /dev/null +++ b/gateway/src/opcodes/Heartbeat.ts
@@ -0,0 +1,12 @@ +import { CLOSECODES, Payload } from "../util/Constants"; +import { Send } from "../util/Send"; +import { setHeartbeat } from "../util/setHeartbeat"; +import WebSocket from "../util/WebSocket"; + +export async function onHeartbeat(this: WebSocket, data: Payload) { + // TODO: validate payload + + setHeartbeat(this); + + await Send(this, { op: 11 }); +}