]> git.lizzy.rs Git - Crafter.git/commitdiff
Fixed only one person being able to teleport within the same server step
authoroilboi <47129783+oilboi@users.noreply.github.com>
Thu, 28 May 2020 05:50:57 +0000 (01:50 -0400)
committeroilboi <47129783+oilboi@users.noreply.github.com>
Thu, 28 May 2020 05:50:57 +0000 (01:50 -0400)
README.md
mods/aether/init.lua
mods/nether/init.lua

index 967e440df60a9f2436bfb157a8f1253cff27c067..79fee90c52d422d8075f841b42e20a94fd91b973 100644 (file)
--- a/README.md
+++ b/README.md
@@ -32,7 +32,8 @@ enable_mod_channels = true
 ## Alpha 0.05
 
 > Multiplayer Polishing Update
-- 
+- Fixed only one player being able to run on a server
+- Fixed only one person being able to teleport in the same server step
 
 ---
 
index 2a2df0c31b0d7620c5ceed66531dc58755532039..4cf01b5777d0b8c854bd022a835700a6be96a94e 100644 (file)
@@ -1,4 +1,10 @@
-local aether_channel = minetest.mod_channel_join("aether_teleporters")
+local aether_channels = {}
+
+minetest.register_on_joinplayer(function(player)
+       local name = player:get_player_name()
+       aether_channels[name] = minetest.mod_channel_join(name..":aether_teleporters")
+end)
+
 
 local path = minetest.get_modpath("aether")
 dofile(path.."/schem.lua")
@@ -295,7 +301,8 @@ end
 
 --this initializes all teleporter commands from the client
 minetest.register_on_modchannel_message(function(channel_name, sender, message)
-       if channel_name == "aether_teleporters" then
+       local channel_decyphered = channel_name:gsub(sender,"")
+       if channel_decyphered == ":aether_teleporters" then
                local player = minetest.get_player_by_name(sender)
                local pos = player:get_pos()
                
index ca4d67953416e7d5505060f61cd374dc9797f223..ab15282176c56b43447f5d4cb8b2d12d8b8c9edb 100644 (file)
@@ -1,4 +1,9 @@
-local nether_channel = minetest.mod_channel_join("nether_teleporters")
+local nether_channels = {}
+
+minetest.register_on_joinplayer(function(player)
+       local name = player:get_player_name()
+       nether_channels[name] = minetest.mod_channel_join(name..":nether_teleporters")
+end)
 
 local path = minetest.get_modpath("nether")
 dofile(path.."/schem.lua")
@@ -298,7 +303,8 @@ end
 
 --this initializes all teleporter commands from the client
 minetest.register_on_modchannel_message(function(channel_name, sender, message)
-       if channel_name == "nether_teleporters" then
+       local channel_decyphered = channel_name:gsub(sender,"")
+       if channel_decyphered == ":nether_teleporters" then
                local player = minetest.get_player_by_name(sender)
                local pos = player:get_pos()