From 0871784ff96dfde1f7c52a845af8aa309568105b Mon Sep 17 00:00:00 2001 From: Izaya Date: Fri, 6 Apr 2018 17:49:55 +1000 Subject: [PATCH 1/2] added vcomponent to the requirements for vtunnel --- programs.cfg | 3 +++ 1 file changed, 3 insertions(+) diff --git a/programs.cfg b/programs.cfg index d60abd0..ff9fd7f 100644 --- a/programs.cfg +++ b/programs.cfg @@ -51,6 +51,9 @@ ["master/vTunnel/interminitel.lua"] = "/lib", ["master/vTunnel/vtunnel.lua"] = "/bin", }, + dependencies = { + ["vcomponent"] = "" + }, name = "vTunnel", description = "Linked card emulator", authors = "Izaya", From 8731e9bbbf18e8849ed52aa502d4001d6d1c80d9 Mon Sep 17 00:00:00 2001 From: Izaya Date: Fri, 6 Apr 2018 17:57:45 +1000 Subject: [PATCH 2/2] made the vtunnel bridge output more useful information --- vTunnel/bridge.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/vTunnel/bridge.lua b/vTunnel/bridge.lua index e725900..f5c795b 100644 --- a/vTunnel/bridge.lua +++ b/vTunnel/bridge.lua @@ -87,10 +87,10 @@ spawn(clientLoop) function pushLoop() while true do for id,msg in pairs(messages) do - if msg:len() > 3 then + if msg[1]:len() > 3 then for k,client in pairs(clients) do - client.conn:send(msg) - reprint("Message #"..tostring(id).." -> Client #"..tostring(k).." - "..msg) + client.conn:send(msg[1]) + reprint("Message #"..tostring(id).." (Client #"..tostring(msg[2]).." -> Client #"..tostring(k).." - "..msg[1]) end end messages[id] = nil @@ -103,10 +103,10 @@ spawn(pushLoop) function bufferLoop() while true do - for _,client in pairs(clients) do + for id,client in pairs(clients) do if client.buffer:len() > 0 then if imt.decodePacket(client.buffer) then - messages[#messages+1] = imt.encodePacket(imt.decodePacket(client.buffer)) + messages[#messages+1] = {imt.encodePacket(imt.decodePacket(client.buffer)),id} client.buffer = imt.getRemainder(client.buffer) or "" end end