Skip to content

Commit

Permalink
fix: events wrapper not being used
Browse files Browse the repository at this point in the history
  • Loading branch information
TGRHavoc committed Jun 9, 2019
1 parent 9a206ef commit c3f31ae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Expand Up @@ -30,6 +30,6 @@
"always"
],
"no-console": "off",
"no-undef": "warn"
"no-undef": "off"
}
}
8 changes: 6 additions & 2 deletions src/server.js
Expand Up @@ -26,6 +26,8 @@ router.use(async (ctx, next) => {
const SocketController = require("LivemapSocketController")(access);
SocketController.hook(wss);

require("LivemapEventsWrapper")(SocketController);

// Passing the SocketController through as we need it to keep blips updated on the client. Plus, I can't seem to just "require" the server in the BlipController.
const BlipController = require("LivemapBlipController")(SocketController);

Expand All @@ -34,8 +36,8 @@ router.get("/blips.json", BlipController.getBlips);

app.use(koaBody(
{
patchKoa: true,
}))
patchKoa: true,
}))
.use(router.routes())
.use(router.allowedMethods());

Expand All @@ -45,3 +47,5 @@ const port = GetConvarInt("socket_port", 30121);
server.listen(port, function listening() {
log.info("Listening on %d", port);
});

setInterval(SocketController.SendPlayerData, GetConvarInt("livemap_milliseconds", 500)); // Default = half a second.

0 comments on commit c3f31ae

Please sign in to comment.