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
commitfa31e7f8db61efe085f7d8a317e6a8640ebb3f46 (patch)
tree5d12bfa42b9ed09e67935c1e6a5063babe33eeb8 /gateway/src/opcodes/Heartbeat.ts
parentMerge branch 'master' into gateway (diff)
downloadserver-fa31e7f8db61efe085f7d8a317e6a8640ebb3f46.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 }); +}