support @name, see #823

This commit is contained in:
Cloud Wu
2018-04-19 14:54:25 +08:00
committed by 云风
parent f4d5bc7aa4
commit 182d7c7dc7
4 changed files with 47 additions and 17 deletions

View File

@@ -553,6 +553,16 @@ lconcat(lua_State *L) {
return 2;
}
static int
lisname(lua_State *L) {
const char * name = lua_tostring(L, 1);
if (name && name[0] == '@') {
lua_pushboolean(L, 1);
return 1;
}
return 0;
}
LUAMOD_API int
luaopen_skynet_cluster_core(lua_State *L) {
luaL_Reg l[] = {
@@ -563,6 +573,7 @@ luaopen_skynet_cluster_core(lua_State *L) {
{ "unpackresponse", lunpackresponse },
{ "append", lappend },
{ "concat", lconcat },
{ "isname", lisname },
{ NULL, NULL },
};
luaL_checkversion(L);