From 19b5c3790dbbb3366358a145bf55963f7c49824b Mon Sep 17 00:00:00 2001 From: Artem Titoulenko Date: Tue, 7 Sep 2021 19:09:45 -0400 Subject: [PATCH] actually use imports, cleanup logging --- src/index.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/index.js b/src/index.js index 794c502..22648e9 100644 --- a/src/index.js +++ b/src/index.js @@ -1,5 +1,6 @@ const net = require('net'); const { logDataStream } = require('./util'); +const { FLAP } = require('./structures'); const server = net.createServer((socket) => { console.log('client connected...'); @@ -11,7 +12,6 @@ const server = net.createServer((socket) => { socket.on('data', (data) => { const flap = FLAP.fromBuffer(Buffer.from(data, 'hex')); - console.log(logDataStream(flap.toBuffer())); console.log('RECV', flap.toString()); }); @@ -24,10 +24,7 @@ const server = net.createServer((socket) => { console.log('client disconnected...'); }); - // const hello = Buffer.from(new Uint8Array([0x2a, 0x01, 0, 0x01, 0, 0x04, 0x00, 0x00, 0x00, 0x01])); - const hello = new FLAP(0x01, 0, Buffer.from([0x00, 0x00, 0x00, 0x01])); - // console.log(logDataStream(hello.toBuffer())); socket.write(hello.toBuffer()); /* 1. on connection, server sends