Update sPhone.lua

This commit is contained in:
Ale32bit 2015-11-20 18:38:55 +01:00
parent 522016322c
commit d22999053a

View file

@ -580,6 +580,10 @@ end
--f.write("Ignore me") --f.write("Ignore me")
--f.close() --f.close()
--end --end
if not sPhone.locked then
login()
end
if fs.exists("/.sPhone/config/resetDBNews") then if fs.exists("/.sPhone/config/resetDBNews") then
fs.delete("/.sPhone/config/resetDBNews") fs.delete("/.sPhone/config/resetDBNews")
end end
@ -691,6 +695,7 @@ end
end end
function login() function login()
sPhone.locked = true
if fs.exists("/.sPhone/config/.password") then if fs.exists("/.sPhone/config/.password") then
while true do while true do
term.clear() term.clear()
@ -876,9 +881,12 @@ end
term.clearLine() term.clearLine()
sertextext.center(14," Have fun with sPhone") sertextext.center(14," Have fun with sPhone")
sleep(2) sleep(2)
home() sPhone.locked = false
return
end end
end end
sPhone.lock = login
local newVersion = http.get("https://raw.githubusercontent.com/Sertex-Team/sPhone/master/src/version").readLine() local newVersion = http.get("https://raw.githubusercontent.com/Sertex-Team/sPhone/master/src/version").readLine()
if newVersion ~= sPhone.version then if newVersion ~= sPhone.version then
@ -887,7 +895,7 @@ end
sPhone.newUpdate = false sPhone.newUpdate = false
end end
login() home()
end end