1
0
mirror of https://github.com/ShadowKatStudios/OC-Minitel.git synced 2024-11-27 04:18:05 +11:00

changed the timeout for the bridge server and made the output more useful

This commit is contained in:
Izaya 2018-04-05 20:48:57 +10:00
parent ad4284a340
commit 16f337531a

View File

@ -66,7 +66,7 @@ function clientLoop()
client.conn:close() client.conn:close()
clients[id] = nil clients[id] = nil
end end
if client.last+30 < os.time() then if client.last+3000 < os.time() then
print("Dropping client "..tostring(id).." for inactivity") print("Dropping client "..tostring(id).." for inactivity")
client.conn:close() client.conn:close()
clients[id] = nil clients[id] = nil
@ -81,11 +81,11 @@ spawn(clientLoop)
function pushLoop() function pushLoop()
while true do while true do
for id,msg in pairs(messages) do for id,msg in pairs(messages) do
for _,client in pairs(clients) do for k,client in pairs(clients) do
client.conn:send(msg) client.conn:send(msg)
reprint("Message #"..tostring(id).." -> Client #"..tostring(k).." - "..msg)
end end
messages[id] = nil messages[id] = nil
reprint(msg)
end end
coroutine.yield() coroutine.yield()
end end