Need to rewrite the storing of callback functions in the controller itself and make a quick way to lookup them.
Now all functions are stored in different entities, it's not bad, and it's easy to lookup, but it's harder to clean.
Facepunch/garrysmod-requests#1911 (comment)
local unique_name = "i_" .. tostring( target:GetCreationID() ) .. name .. delay .. max_times
self.m_callbacks[unique_name] = fn
...
local kv = table.concat( { "gmod_outputhandler", unique_name, "", delay, max_times }, ":" )
target:Fire( "AddOutput", output .. " " .. kv, 0 )
...
-- lookup
local fn = self.m_callbacks[name]
I would experiment and see what is better.
By the way, now if the entity with Lua outputs is removed, then its functions are also removed. When they are stored in the controller it won't work(
Need to rewrite the storing of callback functions in the controller itself and make a quick way to lookup them.
Now all functions are stored in different entities, it's not bad, and it's easy to lookup, but it's harder to clean.
Facepunch/garrysmod-requests#1911 (comment)
I would experiment and see what is better.
By the way, now if the entity with Lua outputs is removed, then its functions are also removed. When they are stored in the controller it won't work(