Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 4 additions & 29 deletions meta/3rd/luaecs/library/ecs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,6 @@ end
function meta:select(pat)
end

---Sync C memory data to the iter which contains the index id and component id by then pattern the entity meet.
---Read component with in, and write component to C which with out.
---This is a additional featur, we use select most times.
---@param pat string #pattern whcih the iter specified entity meet.
---@param iter ITER # {pool index, cid}
---@see ECSWorld#_sync
function meta:sync(pat, iter)
end

---Sync all then component of the eneity represent by a iter
---@param iter number|ITER #ITER or entity id
---@return table
Expand Down Expand Up @@ -121,15 +112,6 @@ end
function meta:update(tagname)
end

---Select a singleton component. Singleton component only hava a instance, the pool index is 1.
---`pattern` and `iter` must gived or not the same time.
---@param name string Component name
---@param pattern? string #key [opt inout] , opt is : or ?, inout is in, out, update, like t:in, b:out, id?update. **Used to select other component into the Singleton Component.
---@param iter? table # when give, is update and return it.
---@return table {1, cid, component...}
function meta:singleton(name, pattern, iter)
end

local M = {
_MAXTYPE = 255,
_METHODS = meta,
Expand Down Expand Up @@ -342,22 +324,15 @@ end
function meta:_object(ref, cv, index)
end

---C API
---Sync data from iter to C memory.
---@param iter userdata #iter function
---@param t ITER
---@return table
---@see ECSWorld#sync
function meta:_sync(iter, t)
end

---@param pattern string
---@param iter ITER
function meta:_read(pattern, iter)
end

---No use
function meta:submit(...) end
---C API
---Commit an mod of a group iter with out or new
---@param iter ITER
function meta:submit(iter) end

---@see ECSWorld:#first
function meta:_first(...) end
Expand Down
68 changes: 36 additions & 32 deletions meta/3rd/skynet/library/skynet.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,34 @@
---|+'"trace"'
---@alias SERVICEADDR '".servicename"' | '":0000000C"' | integer
---@alias MESSAGEHANDLER fun(session:integer, source:integer, cmd:string, ...)
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
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",
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
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",

}

Expand Down Expand Up @@ -103,8 +103,8 @@ end
---* 你需要挂起一个请求,等将来时机满足,再回应它。而回应的时候已经在别的 coroutine 中了。
---针对这种情况,你可以调用 skynet.response(skynet.pack) 获得一个闭包,以后调用这个闭包即可把回应消息发回。
---这里的参数 skynet.pack 是可选的,你可以传入其它打包函数,默认即是 skynet.pack 。
---@param msg lightuserdata
---@param sz integer
---@param msg lightuserdata|string
---@param sz? integer
function skynet.ret(msg, sz)
end

Expand Down Expand Up @@ -227,8 +227,8 @@ end
---* 挂起期间,状态可能会变更,造成重入
---@param addr SERVICEADDR @目标服务地址
---@param typename string @类型名
---@param msg lightuserdata
---@param sz number
---@param msg lightuserdata|string
---@param sz? number
function skynet.rawcall(addr, typename, msg, sz)
end

Expand All @@ -240,15 +240,18 @@ request.__call = request.add
---@param obj table # {addr, typename, ...}
function request:add(obj)
end

function request:close()
end

function request:select(timeout)
end

---@param obj? table
---@return request
function skynet.request(obj)
end

---* 返回一个唯一的会话ID
---@return number
function skynet.genid()
Expand Down Expand Up @@ -546,4 +549,5 @@ end
function skynet.info_func(fun)

end

return skynet