aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/src/LSL.lua
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-02-23 01:31:05 +1000
committerDavid Walter Seikel2012-02-23 01:31:05 +1000
commitad7c55c1467fa6a205ecc29bc00c05c5d6b20ee5 (patch)
tree4ace8aeb280e76034d4482af2f33e361dbf15e65 /LuaSL/src/LSL.lua
parentJiggle some log messages a little. (diff)
downloadSledjHamr-ad7c55c1467fa6a205ecc29bc00c05c5d6b20ee5.zip
SledjHamr-ad7c55c1467fa6a205ecc29bc00c05c5d6b20ee5.tar.gz
SledjHamr-ad7c55c1467fa6a205ecc29bc00c05c5d6b20ee5.tar.bz2
SledjHamr-ad7c55c1467fa6a205ecc29bc00c05c5d6b20ee5.tar.xz
Actually test callAndWait(), then fix it.
Diffstat (limited to 'LuaSL/src/LSL.lua')
-rw-r--r--LuaSL/src/LSL.lua5
1 files changed, 2 insertions, 3 deletions
diff --git a/LuaSL/src/LSL.lua b/LuaSL/src/LSL.lua
index 676f4ad..ea16285 100644
--- a/LuaSL/src/LSL.lua
+++ b/LuaSL/src/LSL.lua
@@ -32,7 +32,6 @@ local paused = false
32 32
33-- Stuff called from the wire protocol has to be global, but I think this means just global to this file. 33-- Stuff called from the wire protocol has to be global, but I think this means just global to this file.
34function stop() paused = true end 34function stop() paused = true end
35function result(...) return {...} end
36function quit() running = false end 35function quit() running = false end
37 36
38 37
@@ -112,10 +111,10 @@ function mt.callAndWait(name, ...)
112 111
113 mt.callAndReturn(name, ...); 112 mt.callAndReturn(name, ...);
114 -- Eventually a sendForth() is called, which should end up passing through SendToChannel(). 113 -- Eventually a sendForth() is called, which should end up passing through SendToChannel().
115 -- Wait for the result, which should be something like - result({x=0.45, y=0.6, z=1.8}) 114 -- Wait for the result, which should be a Lua value as a string.
116 local message = luaproc.receive(SID) 115 local message = luaproc.receive(SID)
117 if message then 116 if message then
118 result, errorMsg = loadstring(message) -- "The environment of the returned function is the global environment." Though normally, a function inherits it's environment from the function creating it. Which is what we want. lol 117 result, errorMsg = loadstring("return " .. message) -- "The environment of the returned function is the global environment." Though normally, a function inherits it's environment from the function creating it. Which is what we want. lol
119 if nil == result then 118 if nil == result then
120 msg("Not a valid result: " .. message .. " ERROR MESSAGE: " .. errorMsg) 119 msg("Not a valid result: " .. message .. " ERROR MESSAGE: " .. errorMsg)
121 else 120 else