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