bugs and some more testing
general bug fixes
This commit is contained in:
parent
b3b9e12fb8
commit
91090e6dea
1
.gitignore
vendored
1
.gitignore
vendored
@ -12,3 +12,4 @@ test.lua
|
|||||||
test.lua
|
test.lua
|
||||||
*.code-workspace
|
*.code-workspace
|
||||||
*.dat
|
*.dat
|
||||||
|
multi\integration\networkManager
|
||||||
@ -1786,16 +1786,16 @@ function multi.initThreads(justThreads)
|
|||||||
if not _ then
|
if not _ then
|
||||||
threads[i].OnError:Fire(threads[i],ret)
|
threads[i].OnError:Fire(threads[i],ret)
|
||||||
end
|
end
|
||||||
if coroutine.status(threads[i].thread)=="dead" then
|
if threads[i] and coroutine.status(threads[i].thread)=="dead" then
|
||||||
threads[i].OnDeath:Fire(threads[i],"ended",ret,r1,r2,r3,r4,r5,r6)
|
threads[i].OnDeath:Fire(threads[i],"ended",ret,r1,r2,r3,r4,r5,r6)
|
||||||
table.remove(threads,i)
|
table.remove(threads,i)
|
||||||
elseif threads[i].task == "skip" then
|
elseif threads[i] and threads[i].task == "skip" then
|
||||||
threads[i].pos = threads[i].pos + 1
|
threads[i].pos = threads[i].pos + 1
|
||||||
if threads[i].count==threads[i].pos then
|
if threads[i].count==threads[i].pos then
|
||||||
threads[i].task = ""
|
threads[i].task = ""
|
||||||
threads[i].__ready = true
|
threads[i].__ready = true
|
||||||
end
|
end
|
||||||
elseif threads[i].task == "hold" then --GOHERE
|
elseif threads[i] and threads[i].task == "hold" then --GOHERE
|
||||||
t0,t1,t2,t3,t4,t5,t6 = threads[i].func()
|
t0,t1,t2,t3,t4,t5,t6 = threads[i].func()
|
||||||
if t0 then
|
if t0 then
|
||||||
if t0==multi.NIL then
|
if t0==multi.NIL then
|
||||||
@ -1804,12 +1804,12 @@ function multi.initThreads(justThreads)
|
|||||||
threads[i].task = ""
|
threads[i].task = ""
|
||||||
threads[i].__ready = true
|
threads[i].__ready = true
|
||||||
end
|
end
|
||||||
elseif threads[i].task == "sleep" then
|
elseif threads[i] and threads[i].task == "sleep" then
|
||||||
if clock() - threads[i].time>=threads[i].sec then
|
if clock() - threads[i].time>=threads[i].sec then
|
||||||
threads[i].task = ""
|
threads[i].task = ""
|
||||||
threads[i].__ready = true
|
threads[i].__ready = true
|
||||||
end
|
end
|
||||||
elseif threads[i].task == "holdF" then
|
elseif threads[i] and threads[i].task == "holdF" then
|
||||||
t0,t1,t2,t3,t4,t5,t6 = threads[i].func()
|
t0,t1,t2,t3,t4,t5,t6 = threads[i].func()
|
||||||
if t0 then
|
if t0 then
|
||||||
threads[i].task = ""
|
threads[i].task = ""
|
||||||
@ -1820,7 +1820,7 @@ function multi.initThreads(justThreads)
|
|||||||
t0 = nil
|
t0 = nil
|
||||||
t1 = "TIMEOUT"
|
t1 = "TIMEOUT"
|
||||||
end
|
end
|
||||||
elseif threads[i].task == "holdW" then
|
elseif threads[i] and threads[i].task == "holdW" then
|
||||||
threads[i].pos = threads[i].pos + 1
|
threads[i].pos = threads[i].pos + 1
|
||||||
t0,t1,t2,t3,t4,t5,t6 = threads[i].func()
|
t0,t1,t2,t3,t4,t5,t6 = threads[i].func()
|
||||||
if t0 then
|
if t0 then
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
return function(self,data)
|
return function(self,data)
|
||||||
local cmd,data = data:match("!(.-)!(.*)")
|
local cmd,data = data:match("!(.-)!(.*)")
|
||||||
|
--print(">",cmd,data)
|
||||||
if cmd == "PONG" then
|
if cmd == "PONG" then
|
||||||
--
|
self:send("!PONG!")
|
||||||
elseif cmd == "CHANNEL" then
|
elseif cmd == "CHANNEL" then
|
||||||
--
|
--
|
||||||
elseif cmd == "RETURNS" then
|
elseif cmd == "RETURNS" then
|
||||||
|
|||||||
@ -5,11 +5,18 @@ return function(self,data,client)
|
|||||||
if cmd == "PING" then
|
if cmd == "PING" then
|
||||||
self:send(client,"!PONG!")
|
self:send(client,"!PONG!")
|
||||||
elseif cmd == "N_THREAD" then
|
elseif cmd == "N_THREAD" then
|
||||||
|
print(1)
|
||||||
local dat = bin.new(data)
|
local dat = bin.new(data)
|
||||||
|
print(2)
|
||||||
local t = dat:getBlock("t")
|
local t = dat:getBlock("t")
|
||||||
|
print(3)
|
||||||
local ret = bin.new()
|
local ret = bin.new()
|
||||||
|
print(4)
|
||||||
ret:addBlock{ID = t.id,rets = {t.func(unpack(t.args))}}
|
ret:addBlock{ID = t.id,rets = {t.func(unpack(t.args))}}
|
||||||
|
print(5)
|
||||||
|
print(client,"!RETURNS!"..ret:getData())
|
||||||
self:send(client,"!RETURNS!"..ret:getData())
|
self:send(client,"!RETURNS!"..ret:getData())
|
||||||
|
print(6)
|
||||||
elseif cmd == "CHANNEL" then
|
elseif cmd == "CHANNEL" then
|
||||||
local dat = bin.new(data):getBlock("t")
|
local dat = bin.new(data):getBlock("t")
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user