diff --git a/service/launcher.lua b/service/launcher.lua index b9aaace6..d6ff9270 100644 --- a/service/launcher.lua +++ b/service/launcher.lua @@ -77,8 +77,6 @@ end local instance = {} -skynet.register(".launcher") - skynet.start(function() skynet.dispatch("text" , function(session, address , cmd) if cmd == "" then diff --git a/service/main.lua b/service/main.lua index bd3c03ce..e63760fc 100644 --- a/service/main.lua +++ b/service/main.lua @@ -3,12 +3,12 @@ local skynet = require "skynet" skynet.start(function() print("Server start") skynet.launch("socket",128) - local service = skynet.launch("snlua","service_mgr") - local lualog = skynet.launch("snlua","lualog") - local console = skynet.launch("snlua","console") - local remoteroot = skynet.launch("snlua","remote_root") - local watchdog = skynet.launch("snlua","watchdog","8888 4 0") - local db = skynet.launch("snlua","simpledb") + local service = skynet.newservice("service_mgr") + local lualog = skynet.newservice("lualog") + local console = skynet.newservice("console") + local remoteroot = skynet.newservice("remote_root") + local watchdog = skynet.newservice("watchdog","8888 4 0") + local db = skynet.newservice("simpledb") -- skynet.launch("snlua","testgroup") skynet.exit() diff --git a/skynet-src/skynet_start.c b/skynet-src/skynet_start.c index 5df90fef..1f61b307 100644 --- a/skynet-src/skynet_start.c +++ b/skynet-src/skynet_start.c @@ -130,6 +130,7 @@ skynet_start(struct skynet_config * config) { } ctx = skynet_context_new("snlua", "launcher"); if (ctx) { + skynet_command(ctx, "REG", ".launcher"); ctx = skynet_context_new("snlua", config->start); }