diff --git a/Makefile b/Makefile index b4a94090..c54703c9 100644 --- a/Makefile +++ b/Makefile @@ -46,7 +46,7 @@ update3rd : CSERVICE = snlua logger gate harbor LUA_CLIB = skynet \ - clientsocket \ + client \ bson md5 sproto lpeg LUA_CLIB_SKYNET = \ @@ -100,7 +100,7 @@ $(LUA_CLIB_PATH)/bson.so : lualib-src/lua-bson.c | $(LUA_CLIB_PATH) $(LUA_CLIB_PATH)/md5.so : 3rd/lua-md5/md5.c 3rd/lua-md5/md5lib.c 3rd/lua-md5/compat-5.2.c | $(LUA_CLIB_PATH) $(CC) $(CFLAGS) $(SHARED) -I3rd/lua-md5 $^ -o $@ -$(LUA_CLIB_PATH)/clientsocket.so : lualib-src/lua-clientsocket.c | $(LUA_CLIB_PATH) +$(LUA_CLIB_PATH)/client.so : lualib-src/lua-clientsocket.c lualib-src/lua-crypt.c lualib-src/lsha1.c | $(LUA_CLIB_PATH) $(CC) $(CFLAGS) $(SHARED) $^ -o $@ -lpthread $(LUA_CLIB_PATH)/sproto.so : lualib-src/sproto/sproto.c lualib-src/sproto/lsproto.c | $(LUA_CLIB_PATH) diff --git a/examples/client.lua b/examples/client.lua index 92aaa16e..740732f8 100644 --- a/examples/client.lua +++ b/examples/client.lua @@ -5,7 +5,7 @@ if _VERSION ~= "Lua 5.3" then error "Use lua 5.3" end -local socket = require "clientsocket" +local socket = require "client.socket" local proto = require "proto" local sproto = require "sproto" diff --git a/examples/login/client.lua b/examples/login/client.lua index f7c48018..4143f941 100644 --- a/examples/login/client.lua +++ b/examples/login/client.lua @@ -1,7 +1,7 @@ package.cpath = "luaclib/?.so" -local socket = require "clientsocket" -local crypt = require "crypt" +local socket = require "client.socket" +local crypt = require "client.crypt" if _VERSION ~= "Lua 5.3" then error "Use lua 5.3" diff --git a/examples/login/gated.lua b/examples/login/gated.lua index 0b8c53b7..86fa31fc 100644 --- a/examples/login/gated.lua +++ b/examples/login/gated.lua @@ -1,5 +1,5 @@ local msgserver = require "snax.msgserver" -local crypt = require "crypt" +local crypt = require "skynet.crypt" local skynet = require "skynet" local loginservice = tonumber(...) diff --git a/examples/login/logind.lua b/examples/login/logind.lua index dd003f2f..5c739a8a 100644 --- a/examples/login/logind.lua +++ b/examples/login/logind.lua @@ -1,5 +1,5 @@ local login = require "snax.loginserver" -local crypt = require "crypt" +local crypt = require "skynet.crypt" local skynet = require "skynet" local server = { diff --git a/lualib-src/lua-clientsocket.c b/lualib-src/lua-clientsocket.c index def0bff6..25189032 100644 --- a/lualib-src/lua-clientsocket.c +++ b/lualib-src/lua-clientsocket.c @@ -186,7 +186,7 @@ lreadstdin(lua_State *L) { } LUAMOD_API int -luaopen_clientsocket(lua_State *L) { +luaopen_client_socket(lua_State *L) { luaL_checkversion(L); luaL_Reg l[] = { { "connect", lconnect }, diff --git a/lualib-src/lua-crypt.c b/lualib-src/lua-crypt.c index 7a182db7..888fe544 100644 --- a/lualib-src/lua-crypt.c +++ b/lualib-src/lua-crypt.c @@ -933,3 +933,8 @@ luaopen_skynet_crypt(lua_State *L) { luaL_newlib(L,l); return 1; } + +LUAMOD_API int +luaopen_client_crypt(lua_State *L) { + return luaopen_skynet_crypt(L); +}