增加正在联网提示

This commit is contained in:
MrZ626
2020-10-20 13:37:08 +08:00
parent 33df3fcb49
commit 8ac1720e9d
4 changed files with 30 additions and 19 deletions

View File

@@ -164,24 +164,23 @@ do--dumpTable
end
do--httpRequest
client=LOADLIB("NETlib")
if client then
function httpRequest(tick,url,method,header,body)
local task,err=client.httpraw{
url=url,
method=method or"GET",
header=header,
body=body,
}
if task then
TASK.new(tick,{task=task,time=0})
else
LOG.print("NETlib error: "..err,"warn")
end
end
else
function httpRequest(...)
LOG.print("[NO NETlib]",5,color.yellow)
httpRequest=
client and function(tick,api,method,header,body)
local task,err=client.httpraw{
url="http://47.103.200.40/"..api,
method=method or"GET",
header=header,
body=body,
}
if task then
TASK.new(tick,{task=task,time=0,net=true})
else
LOG.print("NETlib error: "..err,"warn")
end
TASK.netTaskCount=TASK.netTaskCount+1
end or
function()
LOG.print("[NO NETlib]",5,color.yellow)
end
end
do--json