This commit is contained in:
云风
2012-08-09 19:33:53 +08:00
parent 4e50079706
commit 8556d5225e
3 changed files with 42 additions and 2 deletions

View File

@@ -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

6
config
View File

@@ -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"

View File

@@ -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