This commit is contained in:
Multi 2015-09-19 18:36:47 +02:00
parent 6dcd3d5c8d
commit 3528130991

View file

@ -138,14 +138,16 @@ local function recMsg()
printMsg("Type /logout to exit") printMsg("Type /logout to exit")
while true do while true do
stream = http.post(server.."update.php",head) stream = http.post(server.."update.php",head)
newMessages = textutils.unserialize(stream.readAll()) if stream then
stream.close() local newMessages = textutils.unserialize(stream.readAll())
for i,v in pairs(newMessages) do stream.close()
t = textutils.unserialize(v) for i,v in pairs(newMessages) do
if t then t = textutils.unserialize(v)
date = t["date"] if t then
mesg = "<"..t["from"].."> "..t["message"] date = t["date"]
printMsg(mesg) mesg = "<"..t["from"].."> "..t["message"]
printMsg(mesg)
end
end end
end end
end end