From 350d2a5a1868a92692b392cbcf50971513dfb420 Mon Sep 17 00:00:00 2001 From: Steffen Date: Tue, 25 Jan 2022 12:25:48 +0100 Subject: [PATCH 1/2] fixed local server (closes #240) --- server/index.js | 14 +++++++++----- src/store/socket.js | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/server/index.js b/server/index.js index 2a8ebc1..334a1aa 100644 --- a/server/index.js +++ b/server/index.js @@ -12,10 +12,14 @@ register.setDefaultLabels({ const PING_INTERVAL = 30000; // 30 seconds -const server = https.createServer({ - cert: fs.readFileSync("cert.pem"), - key: fs.readFileSync("key.pem") -}); +const options = {}; + +if (process.env.NODE_ENV !== "development") { + options.cert = fs.readFileSync("cert.pem"); + options.key = fs.readFileSync("key.pem"); +} + +const server = https.createServer(options); const wss = new WebSocket.Server({ ...(process.env.NODE_ENV === "development" ? { port: 8081 } : { server }), verifyClient: info => @@ -234,7 +238,7 @@ const interval = setInterval(function ping() { ws.readyState === WebSocket.CONNECTING) ) ) { - metrics.channels_list.remove([channel]); + metrics.channels_list.remove({ name: channel }); delete channels[channel]; } } diff --git a/src/store/socket.js b/src/store/socket.js index eea5821..dd6fd5b 100644 --- a/src/store/socket.js +++ b/src/store/socket.js @@ -1,7 +1,7 @@ class LiveSession { constructor(store) { this._wss = "wss://live.clocktower.online:8080/"; - //this._wss = "wss://localhost:8081/"; + // this._wss = "ws://localhost:8081/"; // uncomment if using local server with NODE_ENV=development this._socket = null; this._isSpectator = true; this._gamestate = []; From a9eb07ad146c122a241d481e4fd716c728a92bbb Mon Sep 17 00:00:00 2001 From: Steffen Date: Sun, 30 Jan 2022 12:12:51 +0100 Subject: [PATCH 2/2] script tool url fixed --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d31a7f7..c082213 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ If you want to learn more about how to use the app as a player, [JayBotC](https: ### Custom Script Support -Any custom script generated by the official [Script Tool](https://bloodontheclocktower.com/script) is supported out of +Any custom script generated by the official [Script Tool](https://script.bloodontheclocktower.com/) is supported out of the box and you only need to upload it to get the selected set of characters into your grimoire. If you want to customize your script further, there is an additional `"_meta"` object that you can add to the script like you would add a normal character: