From 550f805c6241c645b5fa472b94e5ea41891ea645 Mon Sep 17 00:00:00 2001 From: DavidVentura Date: Tue, 30 Jan 2024 13:46:23 +0100 Subject: [PATCH] clean the p2palive from debug output --- server.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server.ts b/server.ts index bf55084..0bcba61 100644 --- a/server.ts +++ b/server.ts @@ -57,14 +57,18 @@ export const makeSession = (cb: msgCb, connCb: connCb, options: opt): Session => const cmd = CommandsByValue[raw]; if (options.debug) { console.log(`>> ${cmd}`); - console.log(hexdump(msg.buffer, { ansi: options.ansi, ansiColor: 0 })); + if (raw != Commands.P2PAlive) { + console.log(hexdump(msg.buffer, { ansi: options.ansi, ansiColor: 0 })); + } } if (raw == Commands.Drw) { session.outgoingCommandId++; } sock.send(new Uint8Array(msg.buffer), SEND_PORT, session.dst_ip); }, - broadcast: (msg: DataView) => sock.send(new Uint8Array(msg.buffer), SEND_PORT, BCAST_IP), + broadcast: (msg: DataView) => { + sock.send(new Uint8Array(msg.buffer), SEND_PORT, BCAST_IP); + }, dst_ip: BCAST_IP, }; return session;