add lua loader

This commit is contained in:
Cloud Wu
2014-04-29 19:59:04 +08:00
parent a4a21bd793
commit d16159c166
9 changed files with 105 additions and 161 deletions

View File

@@ -5,10 +5,11 @@ skynet.start(function()
skynet.name(".launcher", launcher)
if skynet.getenv "standalone" then
local datacenter = assert(skynet.newservice "datacenter")
local datacenter = assert(skynet.newservice "datacenterd")
skynet.name("DATACENTER", datacenter)
local smgr = assert(skynet.newservice "service_mgr")
end
skynet.uniqueservice("multicastd")
assert(skynet.newservice(skynet.getenv "start" or "main"))
skynet.exit()
end)

View File

@@ -1,5 +1,6 @@
local skynet = require "skynet"
local mc = require "multicast.c"
local datacenter = require "datacenter"
local command = {}
local channel = {}
@@ -49,4 +50,8 @@ skynet.start(function()
local f = assert(command[cmd])
skynet.ret(skynet.pack(f(source, ...)))
end)
local self = skynet.self()
local id = skynet.harbor(self)
assert(datacenter.set("multicast", id, self) == nil)
end)