网路库加载失败不会报错

This commit is contained in:
MrZ626
2020-10-13 00:16:36 +08:00
parent ef5ebd15a4
commit 92c80e075d

View File

@@ -152,17 +152,23 @@ do--dumpTable
end
do--httpRequest
client=LOADLIB("NETlib")
function httpRequest(tick,url,method)
local task,err=client.httpraw{
url=url,
method=method or"GET",
-- header={},
-- body="",
}
if task then
TASK.new(tick,{task=task,time=0})
else
LOG.print("NETlib error: "..err,"warn")
if client then
function httpRequest(tick,url,method)
local task,err=client.httpraw{
url=url,
method=method or"GET",
-- header={},
-- body="",
}
if task then
TASK.new(tick,{task=task,time=0})
else
LOG.print("NETlib error: "..err,"warn")
end
end
else
function httpRequest(tick,url,method)
LOG.print("[NO NETlib]",5,color.yellow)
end
end
end