mirror of
https://github.com/Kiritow/OpenComputerScripts.git
synced 2024-03-22 13:10:46 +08:00
Update libevent
Fix GetNextEvent. Now GetNextEvent will wait infinitely by default. Update transport system due to libnetbox api update.
This commit is contained in:
parent
5c5ee4da37
commit
757d965bf2
|
@ -290,13 +290,17 @@ function GetNextEvent(t,wait_second)
|
|||
checktable(t)
|
||||
if(wait_second~=nil) then
|
||||
checknumber(wait_second)
|
||||
else
|
||||
-- This has caused thousands of error! Now, without wait_second, by default, it means wait infinitely.
|
||||
-- If you want a non-blocking check, call GetNextEvent(bus,0) instead!
|
||||
wait_second=-1
|
||||
end
|
||||
|
||||
if(t.events[1]~=nil) then
|
||||
local e=t.events[1]
|
||||
table.remove(t.events,1)
|
||||
return e
|
||||
elseif(wait_second~=nil) then
|
||||
else
|
||||
if(wait_second<0) then
|
||||
while t.events[1]==nil do
|
||||
os.sleep(1)
|
||||
|
@ -316,8 +320,6 @@ function GetNextEvent(t,wait_second)
|
|||
else
|
||||
return nil
|
||||
end
|
||||
else
|
||||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ end
|
|||
|
||||
local function main()
|
||||
checkDevice()
|
||||
clientServiceStart()
|
||||
NetBoxInit()
|
||||
|
||||
OpenPort(10010)
|
||||
|
||||
|
@ -57,7 +57,7 @@ local function main()
|
|||
end
|
||||
|
||||
ClosePort(10010)
|
||||
clientServiceStop()
|
||||
NetBoxCleanUp()
|
||||
end
|
||||
|
||||
print("Transport System Center Started.")
|
||||
|
|
|
@ -342,7 +342,7 @@ local function main()
|
|||
checkDevice()
|
||||
resetDevice()
|
||||
|
||||
clientServiceStart()
|
||||
NetBoxInit()
|
||||
|
||||
while true do
|
||||
print(
|
||||
|
@ -367,7 +367,7 @@ local function main()
|
|||
resetDevice()
|
||||
unlockUnloadChest()
|
||||
|
||||
clientServiceStop()
|
||||
NetBoxCleanUp()
|
||||
end
|
||||
|
||||
print("Transport System Client Started.")
|
||||
|
|
Loading…
Reference in New Issue
Block a user