Commit Graph

5 Commits

Author SHA1 Message Date
George Kiagiadakis
43aa2d4952 scripts: don't use 'local' for file-wide scoped variables
Since all scripts run in a sandbox with their own global environment,
it means that they don't interfere with each other's global variables.
Therefore, all file-wide variables can be declared global without
any change in behavior. In my understanding, it is better to do so
because this means that any code accessing those variables is going
to access them directly from the global environment table with a simple
lookup rather than having each variable referenced in the local closure
of each function separately.
2023-09-29 23:13:28 +03:00
Ashok Sidipotu
0dcd28e50f Lua scripts: replace "policy" with "linking" 2023-09-26 10:09:03 +03:00
Julian Bouzas
dcee74fcca scripts: do not store the link in si_flags
Otherwise the link is not destroyed right away when doing silink:remove()
2023-08-15 16:32:19 -04:00
George Kiagiadakis
982bebe5aa scripts: use log topics 2023-05-19 20:12:08 +03:00
Julian Bouzas
d2123827f7 scripts: use the event stack to handle virtual session items
This removes both the policy-virtual-client.lua and policy-virtual-device.lua
scripts, and creates a new linking/find-virtual-target.lua script to link
clients with virtual session items if one of them can be found. In addition to
this, this patch also ports the policy-virtual-client-links.lua into a new
scripts/rescan-virtual-links.lua to use the event stack. The idea is for the
scripts/link-target.lua to create all links but only activate non virtual links,
and for the scripts/rescan-virtual-links.lua to activate/deactivate virtual
links based on role priorities.
2023-04-17 07:48:18 -04:00