diff --git a/Embedded/microtel/microtel-3.lua b/Embedded/microtel/microtel-3.lua index 865630c..a7973aa 100644 --- a/Embedded/microtel/microtel-3.lua +++ b/Embedded/microtel/microtel-3.lua @@ -17,17 +17,21 @@ local function genPacketID() return packetID end -local function sendPacket(packetID,packetType,to,vport,data) - packetCache[packetID] = computer.uptime() +local function rawSendPacket(packetID,packetType,to,from,vport,data) if routeCache[to] then - modems[routeCache[to][1]].send(routeCache[to][2],net.port,packetID,packetType,to,net.hostname,vport,data) + modems[routeCache[to][1]].send(routeCache[to][2],net.port,packetID,packetType,to,from,vport,data) else for k,v in pairs(modems) do - v.broadcast(net.port,packetID,packetType,to,net.hostname,vport,data) + v.broadcast(net.port,packetID,packetType,to,from,vport,data) end end end +local function sendPacket(packetID,packetType,to,vport,data) + packetCache[packetID] = computer.uptime() + rawSendPacket(packetID,packetType,to,net.hostname,vport,data) +end + function net.send(to,vport,data,packetType,packetID) packetType,packetID = packetType or 1, packetID or genPacketID() packetQueue[packetID] = {packetType,to,vport,data,0} @@ -71,7 +75,7 @@ function computer.pullSignal(t) packetQueue[eventTab[11]] = nil end elseif net.route and checkCache(eventTab[6]) then - sendPacket(eventTab[6],eventTab[7],eventTab[8],eventTab[9],eventTab[10],eventTab[11]) + rawSendPacket(eventTab[6],eventTab[7],eventTab[8],eventTab[9],eventTab[10],eventTab[11]) end packetCache[eventTab[6]] = computer.uptime() end diff --git a/Embedded/microtel/minify.sh b/Embedded/microtel/minify.sh index ab5d517..0a274eb 100755 --- a/Embedded/microtel/minify.sh +++ b/Embedded/microtel/minify.sh @@ -9,6 +9,7 @@ sed -i -e 's/packetType/pT/g' microtel-3-mini.lua sed -i -e 's/to/T/g' microtel-3-mini.lua sed -i -e 's/vport/vP/g' microtel-3-mini.lua sed -i -e 's/data/D/g' microtel-3-mini.lua +sed -i -e 's/rawSendPacket/rS/g' microtel-3-mini.lua sed -i -e 's/sendPacket/sP/g' microtel-3-mini.lua sed -i -e 's/genPacketID/gP/g' microtel-3-mini.lua sed -i -e 's/packetCache/pC/g' microtel-3-mini.lua