aboutsummaryrefslogtreecommitdiffstats
path: root/alv/copilot
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2020-07-11 17:25:50 +0000
committers-ol <s+removethis@s-ol.nu>2025-03-02 14:24:49 +0000
commit936c7106f93de650bf985984b76e03b9ea0d328e (patch)
treea5faee11c746c5d93e46ebf9a6e8a97aac2cd62b /alv/copilot
parentrename time/sequence to time/val-seq and add time/bang-seq (diff)
downloadalive-936c7106f93de650bf985984b76e03b9ea0d328e.tar.gz
alive-936c7106f93de650bf985984b76e03b9ea0d328e.zip
add vis field to Ops
Diffstat (limited to 'alv/copilot')
-rw-r--r--alv/copilot/udp.moon13
1 files changed, 2 insertions, 11 deletions
diff --git a/alv/copilot/udp.moon b/alv/copilot/udp.moon
index c0ea86e..5bf2ad4 100644
--- a/alv/copilot/udp.moon
+++ b/alv/copilot/udp.moon
@@ -2,7 +2,7 @@ import udp from require 'socket'
import encode, decode from require 'dkjson'
import fn_invoke, op_invoke from require 'alv.invoke'
-encode_res = (copilot) =>
+encode_res = =>
return unless @
{
@@ -45,22 +45,13 @@ class UDPServer
if builtin and builtin.__class.__name ~= 'DummyReg'
res.head_meta = builtin.head.meta
res.result = encode_res builtin.node.result
+ res.vis = if builtin.op then builtin.op.vis
res.kind = switch builtin.__class
when op_invoke then 'op'
when fn_invoke then 'fn'
else 'builtin'
else
res.error = 'not_registered'
- when 'state'
- res.tag = msg.tag
- res.module = msg.module or '__root'
- mod = @copilot.last_modules[res.module]
- builtin = mod.registry\last msg.tag
- if builtin and builtin.__class.__name ~= 'DummyReg'
- res.value = encode_res builtin.node.result, @copilot
- res.state = if builtin.op then builtin.op.state
- else
- res.error = 'not_registered'
else
res.error = 'unknown_type'
return res