From 880a81f65515b894064f71f3a7136bb61fdb9bf6 Mon Sep 17 00:00:00 2001 From: "kepler155c@gmail.com" Date: Thu, 29 Nov 2018 15:12:25 -0500 Subject: [PATCH] socket dim / clock issue --- sys/apis/socket.lua | 2 +- sys/apis/sound.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/apis/socket.lua b/sys/apis/socket.lua index bdd1ff5..7926234 100644 --- a/sys/apis/socket.lua +++ b/sys/apis/socket.lua @@ -173,7 +173,7 @@ local function trusted(msg, port) local data = Crypto.decrypt(msg.t or '', pubKey) --local sharedKey = modexp(pubKey, exchange.secretKey, public.primeMod) - return data.ts and tonumber(data.ts) and math.abs(os.time() - data.ts) < 10 + return data.ts and tonumber(data.ts) and math.abs(os.time() - data.ts) < 24 end end diff --git a/sys/apis/sound.lua b/sys/apis/sound.lua index 888131a..28ca11c 100644 --- a/sys/apis/sound.lua +++ b/sys/apis/sound.lua @@ -1,9 +1,9 @@ local peripheral = _G.peripheral -local speaker = peripheral.find('speaker') local Sound = { } function Sound.play(sound, vol) + local speaker = peripheral.find('speaker') if speaker then speaker.playSound('minecraft:' .. sound, vol or 1) end