improvements (no way)

This commit is contained in:
2026-04-05 22:51:59 +02:00
parent 11328a9fc5
commit 88c2a3783f
14 changed files with 371 additions and 345 deletions
+15 -1
View File
@@ -66,12 +66,26 @@ xdr.on('connection', async (ws, request) => {
ws.send(`A${initialData.agc}\n`);
ws.send(`F${initialData.bw}\n`);
ws.send(`W${initialData.bw}\n`);
ws.send(`OK\n`);
ws.send(`wL${serverConfig.lockToAdmin ? "1" : "0"}\n`); // Don't know how XDR-GTK will handle this, but lets hope it will be fine
ws.send(`wT${serverConfig.publicTuner ? "1" : "0"}\n`); // Again
ws.send(`OK\n`); // Make sure dumbass clients don't need to wait long for the OK, does the comms really REQUIRE you to start the receiver for you to know you are in?
clients.push(ws);
ws.on('message', (message) => {
const data = message.toString();
if(data.startsWith("w")) {
switch(data.trim()) {
case "wL1":
serverConfig.lockToAdmin = true;
break;
case "wL0":
serverConfig.lockToAdmin = false;
break;
// TODO: Do the wT, but not rn because i don't feel like doing the tunerlockTracker
}
}
if (!storage.ctl_output.write(data)) {
ws.pause();
storage.ctl_output.once('drain', () => ws.resume());