diff --git a/Makefile b/Makefile index 997b149d..ee5afeb5 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +.PHONY : all clean install + all : \ skynet \ service/snlua.so \ @@ -80,3 +82,31 @@ skynet-master : master/master.c master/main.c clean : rm skynet client skynet-master lualib/*.so service/*.so + +$(SKYNET_PATH) : + mkdir $@ + +install-libs : | $(SKYNET_PATH) + cp -R lualib $(SKYNET_PATH) + +install-bins : | $(SKYNET_PATH) + cp skynet $(SKYNET_PATH) + +$(SKYNET_PATH)/service : | $(SKYNET_PATH) + mkdir $@ + +install-services : | $(SKYNET_PATH)/service + cp service/connection.so $(SKYNET_PATH)/service/ + cp service/logger.so $(SKYNET_PATH)/service/ + cp service/gate.so $(SKYNET_PATH)/service/ + cp service/broker.so $(SKYNET_PATH)/service/ + cp service/snlua.so $(SKYNET_PATH)/service/ + cp service/client.so $(SKYNET_PATH)/service/ + cp service/launcher.lua $(SKYNET_PATH)/service/ + cp service/redis-cli.lua $(SKYNET_PATH)/service/ + + +install : install-libs install-bins install-services + + + \ No newline at end of file diff --git a/config b/config index a1b197bd..5d4e0950 100644 --- a/config +++ b/config @@ -1,10 +1,12 @@ +root = "./" thread = 8 mqueue = 256 -cpath = "./service/?.so" logger = nil harbor = 1 address = "tcp://127.0.0.1:2525" master = "tcp://127.0.0.1:2012" start = "main" standalone = true -luaservice = "./service/?.lua" +luaservice = root.."service/?.lua" +cpath = root.."service/?.so" +protopath = root.."proto" diff --git a/lualib/skynet.lua b/lualib/skynet.lua index 619a2eca..2f1f7826 100644 --- a/lualib/skynet.lua +++ b/lualib/skynet.lua @@ -69,6 +69,14 @@ function skynet.kill(name) c.command("KILL",name) end +function skynet.getenv(key) + return c.command("GETENV",key) +end + +function skynet.setenv(key, value) + c.command("SETENV",key .. " " ..value) +end + skynet.send = c.send skynet.pack = c.pack skynet.tostring = c.tostring