mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-25 12:43:09 +00:00
fix: 修复升级lua5.5后的兼容性错误 (#2123)
This commit is contained in:
@@ -102,9 +102,9 @@ local function loadconfig(tmp)
|
||||
local reload = {}
|
||||
for name,address in pairs(tmp) do
|
||||
if name:sub(1,2) == "__" then
|
||||
name = name:sub(3)
|
||||
config[name] = address
|
||||
skynet.error(string.format("Config %s = %s", name, address))
|
||||
local opt = name:sub(3)
|
||||
config[opt] = address
|
||||
skynet.error(string.format("Config %s = %s", opt, address))
|
||||
else
|
||||
assert(address == false or type(address) == "string")
|
||||
if node_address[name] ~= address then
|
||||
|
||||
@@ -96,10 +96,11 @@ function cmd.QUERY(service_name, subname)
|
||||
end
|
||||
|
||||
local function list_service()
|
||||
local val
|
||||
local result = {}
|
||||
for k,v in pairs(service) do
|
||||
if type(v) == "string" then
|
||||
v = "Error: " .. v
|
||||
val = "Error: " .. v
|
||||
elseif type(v) == "table" then
|
||||
local querying = {}
|
||||
if v.launch then
|
||||
@@ -118,12 +119,12 @@ local function list_service()
|
||||
table.insert(querying, skynet.address(detail.source) .. " " .. tostring(skynet.call(detail.source, "debug", "TASK", detail.session)))
|
||||
end
|
||||
end
|
||||
v = table.concat(querying, "\n")
|
||||
val = table.concat(querying, "\n")
|
||||
else
|
||||
v = skynet.address(v)
|
||||
val = skynet.address(v)
|
||||
end
|
||||
|
||||
result[k] = v
|
||||
result[k] = val
|
||||
end
|
||||
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user