From 4cc6b25e3f012d28f34b07bfb002ba79ed0754f4 Mon Sep 17 00:00:00 2001 From: Govorunb Date: Thu, 13 Jun 2024 04:27:45 +1000 Subject: [PATCH] add another couple save 10 bytes in config fix redeems re-enabling on config refresh --- config.json | 30 +++++++++++++++++++++--------- ebs/src/modules/config.ts | 6 +++--- ebs/src/modules/game/connection.ts | 2 +- 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/config.json b/config.json index e769431..1adca6a 100644 --- a/config.json +++ b/config.json @@ -61,7 +61,6 @@ "description": "Beacon name" } ], - "announce": true, "image": "https://vedalai.github.io/swarm-control/Erm.png", "price": 1, "sku": "bits1" @@ -78,6 +77,7 @@ "title": "The message to display" } ], + "announce": false, "image": "https://vedalai.github.io/swarm-control/Erm.png", "price": 1, "sku": "bits1" @@ -95,6 +95,16 @@ "description": "The message to display" } ], + "announce": false, + "image": "https://vedalai.github.io/swarm-control/Erm.png", + "price": 1, + "sku": "bits1" + }, + "redeem_bigerm": { + "id": "redeem_bigerm", + "title": "Big Erm", + "description": "It's time to Get Big", + "args": [], "image": "https://vedalai.github.io/swarm-control/Erm.png", "price": 1, "sku": "bits1" @@ -118,7 +128,6 @@ "title": "Range" } ], - "announce": true, "image": "https://vedalai.github.io/swarm-control/Erm.png", "price": 1, "sku": "bits1" @@ -144,7 +153,6 @@ "description": "Spawn the creature behind the player" } ], - "announce": true, "image": "https://vedalai.github.io/swarm-control/Erm.png", "price": 1, "sku": "bits1" @@ -169,7 +177,6 @@ "description": "Spawn the creature behind the player" } ], - "announce": true, "image": "https://vedalai.github.io/swarm-control/Erm.png", "price": 1, "sku": "bits1" @@ -195,7 +202,6 @@ "description": "Spawn the creature behind the player" } ], - "announce": true, "image": "https://vedalai.github.io/swarm-control/Erm.png", "price": 1, "sku": "bits1" @@ -204,7 +210,15 @@ "id": "redeem_o2plants", "title": "Deplete O2 Plants", "args": [], - "announce": true, + "image": "https://vedalai.github.io/swarm-control/Erm.png", + "price": 1, + "sku": "bits1" + }, + "redeem_flippda": { + "id": "redeem_flippda", + "title": "Flip PDA", + "description": "Oops I forgot how to hold things", + "args": [], "image": "https://vedalai.github.io/swarm-control/Erm.png", "price": 1, "sku": "bits1" @@ -213,7 +227,6 @@ "id": "redeem_floodbase", "title": "Flood Base", "args": [], - "announce": true, "image": "https://vedalai.github.io/swarm-control/Erm.png", "price": 1, "sku": "bits1" @@ -223,10 +236,9 @@ "title": "Hide Vehicle Signals", "description": "Hides vehicle and base signals for 30 seconds.", "args": [], - "announce": true, "image": "https://vedalai.github.io/swarm-control/Erm.png", "price": 1, "sku": "bits1" } } -} +} \ No newline at end of file diff --git a/ebs/src/modules/config.ts b/ebs/src/modules/config.ts index 7ec44ca..55948fb 100644 --- a/ebs/src/modules/config.ts +++ b/ebs/src/modules/config.ts @@ -77,9 +77,9 @@ async function refreshConfig() { } app.get("/private/refresh", async (_, res) => { - activeConfig = await fetchConfig(); - console.log("Refreshed config, new config version is ", activeConfig.version); - await broadcastConfigRefresh(activeConfig); + await refreshConfig(); + console.log("Refreshed config, new config version is ", activeConfig!.version); + await broadcastConfigRefresh(activeConfig!); res.sendStatus(200); }); diff --git a/ebs/src/modules/game/connection.ts b/ebs/src/modules/game/connection.ts index 89dfa0f..3bb736d 100644 --- a/ebs/src/modules/game/connection.ts +++ b/ebs/src/modules/game/connection.ts @@ -127,7 +127,7 @@ export class GameConnection { source: CommandInvocationSource.Swarm, command: redeem.id, title: redeem.title, - announce: redeem.announce, + announce: redeem.announce ?? true, args: cart.args, user } as RedeemMessage;