diff options
author | Gowa2017 <33367355+Gowa2017@users.noreply.github.com> | 2021-10-03 22:30:10 +0800 |
---|---|---|
committer | Gowa2017 <33367355+Gowa2017@users.noreply.github.com> | 2021-10-03 22:30:10 +0800 |
commit | 52492c42c6c4831a25992d5f82e8d7c57ca833e5 (patch) | |
tree | d309f2d6661070548f1d5805ca64f57b82d0b112 | |
parent | e94c50ab8f22c4e502e0f1660f893c71460f16f1 (diff) | |
download | lua-language-server-52492c42c6c4831a25992d5f82e8d7c57ca833e5.zip |
delete some variables not in skynet and alias a skynet message handler
-rw-r--r-- | meta/3rd/skynet/library/skynet.lua | 66 |
1 files changed, 28 insertions, 38 deletions
diff --git a/meta/3rd/skynet/library/skynet.lua b/meta/3rd/skynet/library/skynet.lua index 060cf95d..4fdb29d0 100644 --- a/meta/3rd/skynet/library/skynet.lua +++ b/meta/3rd/skynet/library/skynet.lua @@ -1,6 +1,4 @@ ---@meta ----@alias MESSAGETYPE ----|+ PTYPE_TEXT = 0 文字类型 ---@alias MESSAGENAME ---|+'"lua"' ---|+'"socket"' @@ -14,42 +12,35 @@ ---|+'"debug"' ---|+'"trace"' ---@alias SERVICEADDR '".servicename"' | '":0000000C"' | integer +---@alias MESSAGEHANDLER fun(session:integer, source:integer, ...) local skynet = { -- read skynet.h - PTYPE_TEXT = 0, - PTYPE_RESPONSE = 1, - PTYPE_MULTICAST = 2, - PTYPE_CLIENT = 3, - PTYPE_SYSTEM = 4, - PTYPE_HARBOR = 5, - PTYPE_SOCKET = 6, - PTYPE_ERROR = 7, - PTYPE_QUEUE = 8, -- used in deprecated mqueue, use skynet.queue instead - PTYPE_DEBUG = 9, - PTYPE_LUA = 10, - PTYPE_SNAX = 11, - PTYPE_TRACE = 12, -- use for debug trace - --- add by self - PTYPE_CLIENT_MERGE = 13, - --- 域逻辑信息,用与服务间通信 - PTYPE_LOGIC = 100, - PTYPE_ROUTER = 101, - PNAME_TEXT = "text", - PNAME_RESPONSE = "response", - PNAME_MULTICAST = "muliticast", - PNAME_CLIENT = "client", - PNAME_SYSTEM = "system", - PNAME_HARBOR = "harbor", - PNAME_SOCKET = "socket", - PNAME_ERROR = "error", - PNAME_QUEUE = "queue", - PNAME_DEBUG = "debug", - PNAME_LUA = "lua", - PNAME_SNAX = "snax", - PNAME_TRACE = "trace", - PNAME_CLIENT_MERGE = "client_merge", - PNAME_LOGIC = "logic", - PNAME_ROUTER = "router", + PTYPE_TEXT = 0, + PTYPE_RESPONSE = 1, + PTYPE_MULTICAST = 2, + PTYPE_CLIENT = 3, + PTYPE_SYSTEM = 4, + PTYPE_HARBOR = 5, + PTYPE_SOCKET = 6, + PTYPE_ERROR = 7, + PTYPE_QUEUE = 8, -- used in deprecated mqueue, use skynet.queue instead + PTYPE_DEBUG = 9, + PTYPE_LUA = 10, + PTYPE_SNAX = 11, + PTYPE_TRACE = 12, -- use for debug trace + PNAME_TEXT = "text", + PNAME_RESPONSE = "response", + PNAME_MULTICAST = "muliticast", + PNAME_CLIENT = "client", + PNAME_SYSTEM = "system", + PNAME_HARBOR = "harbor", + PNAME_SOCKET = "socket", + PNAME_ERROR = "error", + PNAME_QUEUE = "queue", + PNAME_DEBUG = "debug", + PNAME_LUA = "lua", + PNAME_SNAX = "snax", + PNAME_TRACE = "trace", } @@ -100,7 +91,7 @@ end ---* f(...) ---* end) ---@param typename MESSAGENAME ----@param func fun(session:integer, source:integer,...) +---@param func MESSAGEHANDLER function skynet.dispatch(typename, func) end @@ -385,7 +376,6 @@ end function skynet.fork(func, ...) end - -------------- 日志跟踪 API ------------- ---* 写日志 |