aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-02-05 17:38:01 +1000
committerDavid Walter Seikel2012-02-05 17:38:01 +1000
commit43510cab3feffebe1de8598759c15db47fb2132a (patch)
tree7cbeead98ab2cf4dbdef001a3cc5ada004247053
parentFix up the Lua output filenames and fake SID. (diff)
downloadSledjHamr-43510cab3feffebe1de8598759c15db47fb2132a.zip
SledjHamr-43510cab3feffebe1de8598759c15db47fb2132a.tar.gz
SledjHamr-43510cab3feffebe1de8598759c15db47fb2132a.tar.bz2
SledjHamr-43510cab3feffebe1de8598759c15db47fb2132a.tar.xz
Enable the Lua main loop loopiness, and add a quit option.
-rw-r--r--LuaSL/src/LSL.lua11
1 files changed, 6 insertions, 5 deletions
diff --git a/LuaSL/src/LSL.lua b/LuaSL/src/LSL.lua
index 975f219..59f706d 100644
--- a/LuaSL/src/LSL.lua
+++ b/LuaSL/src/LSL.lua
@@ -336,9 +336,8 @@ function LSL.stateChange(x)
336end; 336end;
337 337
338function LSL.mainLoop(SID, x) 338function LSL.mainLoop(SID, x)
339 -- TODO - disabled the stuff that waits until I implement the stuff that makes it stop waiting. lol
340 local sid = SID .. ".events" 339 local sid = SID .. ".events"
341 local status, errorMsg = "disabled" -- = luaproc.newchannel(sid) 340 local status, errorMsg = luaproc.newchannel(sid)
342 local result 341 local result
343 342
344 if not status then 343 if not status then
@@ -350,9 +349,11 @@ function LSL.mainLoop(SID, x)
350 349
351 -- TODO - Need a FIFO stack of incoming events. Which will be in the C main thread, coz that's listening on the socket for us. 350 -- TODO - Need a FIFO stack of incoming events. Which will be in the C main thread, coz that's listening on the socket for us.
352 351
353-- while true do 352 while true do
354 local message = luaproc.receive(sid) 353 local message = luaproc.receive(sid)
355 if message then 354 if "quit()" == message then
355 return
356 elseif message then
356 result, errorMsg = loadstring(message) 357 result, errorMsg = loadstring(message)
357 if nil == result then 358 if nil == result then
358 print("Not a valid event: " .. message .. " ERROR MESSAGE: " .. errorMsg) 359 print("Not a valid event: " .. message .. " ERROR MESSAGE: " .. errorMsg)
@@ -368,7 +369,7 @@ function LSL.mainLoop(SID, x)
368 end 369 end
369 end 370 end
370 end 371 end
371-- end 372 end
372end 373end
373 374
374-- Typecasting stuff. 375-- Typecasting stuff.