forked from minecartchris/CC-Casnio
Fix crash with nil messages
This commit is contained in:
@@ -24,6 +24,11 @@ local function interactWithCard(userUUID, mode, money)
|
|||||||
sleep(30)
|
sleep(30)
|
||||||
--shell.run("reboot")
|
--shell.run("reboot")
|
||||||
end
|
end
|
||||||
|
if not message then
|
||||||
|
print("WTF!? I got a rednet message with no data!?")
|
||||||
|
print("Rebooting...")
|
||||||
|
sleep(5)
|
||||||
|
end
|
||||||
if message.type == "account_data" and message.cardId == cardUUID then
|
if message.type == "account_data" and message.cardId == cardUUID then
|
||||||
local money = message.balance
|
local money = message.balance
|
||||||
local playerUUID = message.uuid
|
local playerUUID = message.uuid
|
||||||
|
|||||||
@@ -25,6 +25,11 @@ local function interactWithCard(userUUID, mode, money)
|
|||||||
sleep(30)
|
sleep(30)
|
||||||
--shell.run("reboot")
|
--shell.run("reboot")
|
||||||
end
|
end
|
||||||
|
if not message then
|
||||||
|
print("WTF!? I got a rednet message with no data!?")
|
||||||
|
print("Rebooting...")
|
||||||
|
sleep(5)
|
||||||
|
end
|
||||||
if message.type == "account_data" and message.cardId == cardUUID then
|
if message.type == "account_data" and message.cardId == cardUUID then
|
||||||
local money = message.balance
|
local money = message.balance
|
||||||
local playerUUID = message.uuid
|
local playerUUID = message.uuid
|
||||||
@@ -37,6 +42,7 @@ local function interactWithCard(userUUID, mode, money)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
sleep(0.25)
|
sleep(0.25)
|
||||||
|
|
||||||
nfc = peripheral.wrap("bottom")
|
nfc = peripheral.wrap("bottom")
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
--slot2
|
--slot2
|
||||||
rednet.open("back")
|
rednet.open("back")
|
||||||
|
|
||||||
|
|
||||||
local function interactWithCard(userUUID, mode, money)
|
local function interactWithCard(userUUID, mode, money)
|
||||||
if mode == "updateBalance" then
|
if mode == "updateBalance" then
|
||||||
rednet.broadcast({
|
rednet.broadcast({
|
||||||
@@ -24,6 +25,11 @@ local function interactWithCard(userUUID, mode, money)
|
|||||||
sleep(30)
|
sleep(30)
|
||||||
--shell.run("reboot")
|
--shell.run("reboot")
|
||||||
end
|
end
|
||||||
|
if not message then
|
||||||
|
print("WTF!? I got a rednet message with no data!?")
|
||||||
|
print("Rebooting...")
|
||||||
|
sleep(5)
|
||||||
|
end
|
||||||
if message.type == "account_data" and message.cardId == cardUUID then
|
if message.type == "account_data" and message.cardId == cardUUID then
|
||||||
local money = message.balance
|
local money = message.balance
|
||||||
local playerUUID = message.uuid
|
local playerUUID = message.uuid
|
||||||
@@ -35,6 +41,7 @@ local function interactWithCard(userUUID, mode, money)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
os.pullEvent= function(...)
|
os.pullEvent= function(...)
|
||||||
while true do
|
while true do
|
||||||
local t = table.pack(os.pullEventRaw(...))
|
local t = table.pack(os.pullEventRaw(...))
|
||||||
|
|||||||
Reference in New Issue
Block a user