1
0
mirror of https://github.com/ShadowKatStudios/OC-Minitel.git synced 2024-11-23 10:38:05 +11:00

cleanups and reorganisation

This commit is contained in:
Izaya 2018-04-04 13:47:18 +10:00
parent 3fa392bc0e
commit 9aaf884f06

View File

@ -199,19 +199,7 @@ local function processPacket(_,localModem,from,pport,_,packetID,packetType,dest,
end end
end end
listeners["modem_message"]=processPacket
event.listen("modem_message",processPacket) event.listen("modem_message",processPacket)
print("Started packet listening daemon: "..tostring(processPacket))
local function queuePacket(ptype,to,vport,data,npID)
npID = npID or genPacketID()
pqueue[npID] = {ptype,to,vport,data,0,0}
dprint(npID,table.unpack(pqueue[npID]))
end
listeners["net_send"]=queuePacket
event.listen("net_send",queuePacket)
print("Started packet queueing daemon: "..tostring(queuePacket))
local function packetPusher() local function packetPusher()
for k,v in pairs(pqueue) do for k,v in pairs(pqueue) do
@ -228,11 +216,12 @@ local function packetPusher()
end end
end end
timers[#timers+1]=event.timer(0,packetPusher,math.huge) local function queuePacket(ptype,to,vport,data,npID)
print("Started packet pusher: "..tostring(timers[#timers])) npID = npID or genPacketID()
pqueue[npID] = {ptype,to,vport,data,0,0}
listeners["net_ack"]=dprint dprint(npID,table.unpack(pqueue[npID]))
event.listen("net_ack",dprint) packetPusher()
end
-- More KOS NEO stuff -- More KOS NEO stuff