aboutsummaryrefslogtreecommitdiff
path: root/games/minimal
diff options
context:
space:
mode:
Diffstat (limited to 'games/minimal')
-rw-r--r--games/minimal/mods/experimental/init.lua2
-rw-r--r--games/minimal/mods/experimental/modchannels.lua16
2 files changed, 18 insertions, 0 deletions
diff --git a/games/minimal/mods/experimental/init.lua b/games/minimal/mods/experimental/init.lua
index afa136777..657148dce 100644
--- a/games/minimal/mods/experimental/init.lua
+++ b/games/minimal/mods/experimental/init.lua
@@ -2,6 +2,8 @@
-- Experimental things
--
+dofile(minetest.get_modpath("experimental").."/modchannels.lua")
+
-- For testing random stuff
experimental = {}
diff --git a/games/minimal/mods/experimental/modchannels.lua b/games/minimal/mods/experimental/modchannels.lua
new file mode 100644
index 000000000..8fce6cfc4
--- /dev/null
+++ b/games/minimal/mods/experimental/modchannels.lua
@@ -0,0 +1,16 @@
+--
+-- Mod channels experimental handlers
+--
+local mod_channel = core.mod_channel_join("experimental_preview")
+
+core.register_on_modchannel_message(function(channel, sender, message)
+ print("[minimal][modchannels] Server received message `" .. message
+ .. "` on channel `" .. channel .. "` from sender `" .. sender .. "`")
+
+ if mod_channel:is_writeable() then
+ mod_channel:send_all("experimental answers to preview")
+ mod_channel:leave()
+ end
+end)
+
+print("[minimal][modchannels] Code loaded!")