diff --git a/ebs/src/modules/game/connection.ts b/ebs/src/modules/game/connection.ts index 43cc3fd..28a69f2 100644 --- a/ebs/src/modules/game/connection.ts +++ b/ebs/src/modules/game/connection.ts @@ -183,4 +183,11 @@ export class GameConnection { public stressTestSetHandshake(handshake: boolean) { this.handshake = handshake; } + + public getUnsent() { + return Array.from(this.unsentQueue); + } + public getOutstanding() { + return Array.from(this.outstandingRedeems.values()); + } } diff --git a/ebs/src/modules/game/index.ts b/ebs/src/modules/game/index.ts index 562cc40..3b3a34b 100644 --- a/ebs/src/modules/game/index.ts +++ b/ebs/src/modules/game/index.ts @@ -48,7 +48,7 @@ app.post("/private/setresult", async (req, res) => { app.post("/private/stress", async (req, res) => { if (!process.env.ENABLE_STRESS_TEST) { - res.status(403).send("Disabled unless you set the ENABLE_STRESS_TEST env var"); + res.status(501).send("Disabled unless you set the ENABLE_STRESS_TEST env var\nREMEMBER TO REMOVE IT FROM PROD"); return; } @@ -71,3 +71,13 @@ app.post("/private/stress", async (req, res) => { startStressTest(reqObj.type, reqObj.duration, reqObj.interval); res.sendStatus(200); }) + +app.get("/private/unsent", async (req, res) => { + const unsent = connection.getUnsent(); + res.send(JSON.stringify(unsent)); +}) + +app.get("/private/outstanding", async (req, res) => { + const outstanding = connection.getOutstanding(); + res.send(JSON.stringify(outstanding)); +})