修改loadLib用法,准备更换联网模块

This commit is contained in:
MrZ626
2021-02-16 16:54:30 +08:00
parent 35f62f1636
commit 5943970312
5 changed files with 36 additions and 73 deletions

View File

@@ -5,7 +5,6 @@ local tasks={}
local TASK={
netTaskCount=0,
wsConnecting=false,
}
function TASK.getCount()
return #tasks
@@ -18,9 +17,6 @@ function TASK.update()
if T.net then
TASK.netTaskCount=TASK.netTaskCount-1
end
if T.ws then
TASK.wsConnecting=false
end
rem(tasks,i)
end
end
@@ -48,20 +44,6 @@ function TASK.newNet(code,...)
}
end
end
function TASK.newWS(code,...)
TASK.wsConnecting=true
local thread=ct.create(code)
ct.resume(thread,...)
if ct.status(thread)~="dead"then
tasks[#tasks+1]={
thread=thread,
code=code,
args={...},
net=true,
ws=true,
}
end
end
function TASK.removeTask_code(code)
for i=#tasks,1,-1 do
if tasks[i].code==code then