网路库加载失败不会报错

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 end
do--httpRequest do--httpRequest
client=LOADLIB("NETlib") client=LOADLIB("NETlib")
function httpRequest(tick,url,method) if client then
local task,err=client.httpraw{ function httpRequest(tick,url,method)
url=url, local task,err=client.httpraw{
method=method or"GET", url=url,
-- header={}, method=method or"GET",
-- body="", -- header={},
} -- body="",
if task then }
TASK.new(tick,{task=task,time=0}) if task then
else TASK.new(tick,{task=task,time=0})
LOG.print("NETlib error: "..err,"warn") 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 end
end end