aboutsummaryrefslogtreecommitdiffstats
path: root/lib/sockets.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-09-05 21:08:53 -0700
committerAdam Soltys <[email protected]>2022-09-05 21:08:53 -0700
commit8a82c69419dc358fbaeab322c32d18ee84656feb (patch)
treedf71a4f11a16d241a38c30e6841fe199725bc7fb /lib/sockets.js
parenta3bcd415de65a6ae14ea451d7d1c8f3f136e99d4 (diff)
downloadcoinos-server-8a82c69419dc358fbaeab322c32d18ee84656feb.tar.gz
coinos-server-8a82c69419dc358fbaeab322c32d18ee84656feb.zip
missing imports and fastify err responses
Diffstat (limited to 'lib/sockets.js')
-rw-r--r--lib/sockets.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/sockets.js b/lib/sockets.js
index 8a5ef958..366820e0 100644
--- a/lib/sockets.js
+++ b/lib/sockets.js
@@ -1,4 +1,5 @@
import store from "./store";
+import config from "$config";
import app from "$app";
import jwt from "jsonwebtoken";
import { v4 } from "uuid";
@@ -6,6 +7,9 @@ import WebSocket from "ws";
import { differenceInSeconds, subSeconds } from "date-fns";
import fastifyWs from "@fastify/websocket";
import whitelist from "./whitelist";
+import { l, err, warn } from "$lib/logging";
+import { getUser } from "$lib/utils";
+import db from "$db";
const code = 1000;
@@ -36,7 +40,7 @@ export const emit = (username, type, data) => {
}
if (!store.sockets[username]) return;
- for (id in store.sockets[username]) {
+ for (let id in store.sockets[username]) {
const ws = store.sockets[username][id];
ws.send(JSON.stringify({ type, data }));
}