mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 20:23:06 +00:00
Add gameserver embed mode, see #1326
This commit is contained in:
@@ -141,7 +141,7 @@ function gateserver.start(handler)
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
skynet.start(function()
|
local function init()
|
||||||
skynet.dispatch("lua", function (_, address, cmd, ...)
|
skynet.dispatch("lua", function (_, address, cmd, ...)
|
||||||
local f = CMD[cmd]
|
local f = CMD[cmd]
|
||||||
if f then
|
if f then
|
||||||
@@ -150,7 +150,13 @@ function gateserver.start(handler)
|
|||||||
skynet.ret(skynet.pack(handler.command(cmd, address, ...)))
|
skynet.ret(skynet.pack(handler.command(cmd, address, ...)))
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end)
|
end
|
||||||
|
|
||||||
|
if handler.embed then
|
||||||
|
init()
|
||||||
|
else
|
||||||
|
skynet.start(init)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return gateserver
|
return gateserver
|
||||||
|
|||||||
Reference in New Issue
Block a user