aboutsummaryrefslogtreecommitdiffstats
path: root/alv/copilot/base.moon
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2020-07-08 15:30:03 +0000
committers-ol <s+removethis@s-ol.nu>2025-03-02 14:24:49 +0000
commit07e2ec3155e027700e7b2e859fccd66766fbf1f8 (patch)
tree0a918081758db9be2322ec1223db1f4846213304 /alv/copilot/base.moon
parent(unecessarily) store util/switch index in state (diff)
downloadalive-07e2ec3155e027700e7b2e859fccd66766fbf1f8.tar.gz
alive-07e2ec3155e027700e7b2e859fccd66766fbf1f8.zip
add editor-support UDP server
Diffstat (limited to 'alv/copilot/base.moon')
-rw-r--r--alv/copilot/base.moon8
1 files changed, 7 insertions, 1 deletions
diff --git a/alv/copilot/base.moon b/alv/copilot/base.moon
index f7dc00a..fcd1ff4 100644
--- a/alv/copilot/base.moon
+++ b/alv/copilot/base.moon
@@ -9,7 +9,7 @@ import Error from require 'alv.error'
import RTNode from require 'alv.rtnode'
import Constant from require 'alv.result'
-parse_args = (args, out={}) ->
+parse_args = (args, out={ 'udp-server': false }) ->
local key
for a in *args
if key
@@ -40,6 +40,10 @@ class Copilot
@last_modules = {}
@open @args[1] if @args[1]
+ if @args['udp-server']
+ import UDPServer from require 'alv.copilot.udp'
+ @adapter = UDPServer @
+
--- members
-- @section members
@@ -94,6 +98,8 @@ class Copilot
--- poll for changes and tick.
tick: =>
+ @adapter\tick! if @adapter
+
assert not COPILOT, "another Copilot is already running!"
return unless @last_modules.__root