From bae0269ca495437b617db058b9cb3aca29716b9d Mon Sep 17 00:00:00 2001 From: Panquesito7 <51391473+Panquesito7@users.noreply.github.com> Date: Tue, 30 Jul 2019 19:00:07 -0500 Subject: [PATCH 01/25] Delete deprecated depends.txt In MT/MTG 5.0.0+, this is no longer needed as in "mod.conf" you can (optional) depends, description and name. --- depends.txt | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 depends.txt diff --git a/depends.txt b/depends.txt deleted file mode 100644 index 4a4c8c1..0000000 --- a/depends.txt +++ /dev/null @@ -1,2 +0,0 @@ -areas? -intllib? From 0bb0956e45c976156e4ea3f9190b90aafac27590 Mon Sep 17 00:00:00 2001 From: Panquesito7 <51391473+Panquesito7@users.noreply.github.com> Date: Wed, 31 Jul 2019 17:40:02 -0500 Subject: [PATCH 02/25] Delete LICENSE.txt --- textures/LICENSE.txt | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 textures/LICENSE.txt diff --git a/textures/LICENSE.txt b/textures/LICENSE.txt deleted file mode 100644 index abe77fe..0000000 --- a/textures/LICENSE.txt +++ /dev/null @@ -1,2 +0,0 @@ -This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. -To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. From dacf2517a16cecec2569e2809cde00c5f3621f92 Mon Sep 17 00:00:00 2001 From: Panquesito7 <51391473+Panquesito7@users.noreply.github.com> Date: Wed, 31 Jul 2019 17:40:22 -0500 Subject: [PATCH 03/25] Delete LICENSE.txt --- sounds/LICENSE.txt | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 sounds/LICENSE.txt diff --git a/sounds/LICENSE.txt b/sounds/LICENSE.txt deleted file mode 100644 index abe77fe..0000000 --- a/sounds/LICENSE.txt +++ /dev/null @@ -1,2 +0,0 @@ -This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. -To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. From c9cd16a4d2b8656b9e15fee54b7eb8249f7cd534 Mon Sep 17 00:00:00 2001 From: Panquesito7 <51391473+Panquesito7@users.noreply.github.com> Date: Wed, 31 Jul 2019 17:41:07 -0500 Subject: [PATCH 04/25] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b0d9a41..e5f9fc5 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ Report bugs or suggest ideas by [creating an issue](https://github.com/ChaosWorm If you know how to fix an issue, or want something to be added, consider opening a [pull request](https://github.com/ChaosWormz/teleport-request/compare). ## License -LGPL-2.1 for code, CC-BY-SA-4.0 for [media](https://github.com/ChaosWormz/teleport-request/blob/master/sounds/LICENSE.txt) and [textures](https://github.com/ChaosWormz/teleport-request/blob/master/textures/LICENSE.txt) (click [here](https://github.com/ChaosWormz/teleport-request/blob/master/LICENSE.md) for more information). +LGPL-2.1 for everything (click [here](https://github.com/ChaosWormz/teleport-request/blob/master/LICENSE.md) for more information). ## Contributors: - [RobbieF](https://minetest.tv) | [GitHub](https://github.com/Cat5TV) From 9aa68848c8c435734eea0c59ccb29998cbb1f61b Mon Sep 17 00:00:00 2001 From: Panquesito7 <51391473+Panquesito7@users.noreply.github.com> Date: Wed, 31 Jul 2019 17:41:45 -0500 Subject: [PATCH 05/25] Update init.lua --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index cfb85be..3bb9cb6 100644 --- a/init.lua +++ b/init.lua @@ -22,7 +22,7 @@ Originally made by Traxie21 and released with the WTFPL license. Forum link: https://forum.minetest.net/viewtopic.php?id=4457 Updates by Zeno, Panquesito7 and ChaosWormz. -License: LGPL-2.1 for code, CC-BY-SA-4.0 for media and textures. +License: LGPL-2.1 for everything. Optional dependencies: areas, intllib New release by RobbieF under new mod: tps_teleport - http://blog.minetest.tv/teleport-request/ From 2f31f0c317dab807b413938e401935842390bed0 Mon Sep 17 00:00:00 2001 From: Panquesito7 <51391473+Panquesito7@users.noreply.github.com> Date: Wed, 31 Jul 2019 19:43:40 -0500 Subject: [PATCH 06/25] Add a new function This commit improves "/tpy" command: When a player receives more than 1 teleport request and types /tpy, a message will be sent to the receiver telling him the list of the requests sent to him. He must use the player name as a param, so, he will teleport to the specified player (e.g.: /tpy foo). THIS IS AN UNTESTED FUNCTION. IT MAY RESULT IN A CRASH OR MAY CAUSE ANOTHER BUGS. CHECK IT AT YOUR OWN RISK. --- init.lua | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 3bb9cb6..b89105c 100644 --- a/init.lua +++ b/init.lua @@ -165,7 +165,6 @@ function tpr_send(sender, receiver) minetest.chat_send_player(receiver, S("@1 is requesting to teleport to you. /tpy to accept", sender)) minetest.chat_send_player(sender, S("Teleport request sent! It will timeout in @1 seconds", timeout_delay)) - -- Write name values to list and clear old values. tpr_list[receiver] = sender -- Teleport timeout delay @@ -206,7 +205,6 @@ function tphr_send(sender, receiver) minetest.chat_send_player(receiver, S("@1 is requesting that you teleport to them. /tpy to accept; /tpn to deny", sender)) minetest.chat_send_player(sender, S("Teleport request sent! It will timeout in @1 seconds", timeout_delay)) - -- Write name values to list and clear old values. tphr_list[receiver] = sender -- Teleport timeout delay @@ -306,6 +304,25 @@ function tpr_accept(name, param) target = minetest.get_player_by_name(name) chatmsg = S("You are teleporting to @1.", name2) tphr_list[name] = nil + -- Let the player choose which player to teleport to when there are multiple requests. + -- THIS IS AN UNTESTED FUNCTION. CHECK IT AT YOUR OWN RISK. + elseif tpr_list[name] > 1 then + param = param:lower() + minetest.chat_send_player(name, S("Use /tpy and choose a player to teleport to:")) + local tp = {} + for key, value in pairs(tpr_list) do + table.insert(tp, key) + end + if param == "" then + minetest.chat_send_player(name, S("Use /tpy and choose a player to teleport to:")) + for key, value in pairs(tpr_list) do + table.insert(tp, key) + end + end + -- Teleport player to the specified player + if tpr_list[param] then + tpr_teleport_player(param) + end else return end From f36d5de9de229f474e81dcae467c3e8df6fcadd4 Mon Sep 17 00:00:00 2001 From: Panquesito7 <51391473+Panquesito7@users.noreply.github.com> Date: Wed, 31 Jul 2019 21:51:53 -0500 Subject: [PATCH 07/25] Make README.md better --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index e5f9fc5..ac8583e 100644 --- a/README.md +++ b/README.md @@ -5,11 +5,11 @@ ## Privileges: Each command needs a privilege. These are the following privileges: - **tp** is requiered in order to use all commands. -- **tp_tpc** is requiered in order to use "/tpc" -- **tp_tpc** is requiered in order to use "/tpe" -- **tp_tpc** is requiered in order to use "/tpj" +- **tp_tpc** is requiered in order to use `/tpc` +- **tp_tpc** is requiered in order to use `/tpe` +- **tp_tpc** is requiered in order to use `/tpj` - **interact** is also requiered to use all commands. -**tp_admin** overrides everything: e.g. you can teleport to players even when they haven't decided to accept, or not. You can also teleport him/her to you. +**tp_admin** overrides everything: e.g. you can teleport to players even when they haven't decided to accept, or not. You can also teleport him/her to you (this happens only when `enable_immediate_teleport` is enabled on `config.lua`). Players can also teleport to coordinates, however, if the area is protected, the teleport will be denied. ## How to use: @@ -20,34 +20,34 @@ These are the following commands available in-game: ``` /tpr [playername] ``` - **Name:** Teleport Request - **Description:** Requests permission to teleport to another player, where [playername] is their exact name. -- **Required Privileges:** "interact", "tp" +- **Required Privileges:** `interact, tp` - **Example Usage:** */tpr RobbieF* - requests permission from RobbieF to teleport to them. - **Notes:** Usernames are case-sensitive. If you have "tp_admin" privilege, you will immediately teleport to the specificed player. ``` /tphr [playername] ``` - **Name:** Teleport Here Request - **Description:** Request permission to teleport another player to you. -- **Required Privileges:** "interact", "tp" +- **Required Privileges:** `interact, tp` - **Example Usage:** /tphr RobbieF - requests RobbieF to teleport to you. - **Notes:** Usernames are case-sensitive. If you have "tp_admin" privilege, RobbieF will teleport to you immediately. ``` /tpc [x,y,z] ``` - **Name:** Teleport to Coordinates - **Description:** Teleport to coordinates. -- **Required Privileges:** "interact", "tp_tpc", "tp" +- **Required Privileges:** `interact, tp_tpc, tp` - **Notes:** Honors area protection: if the area is protected, it must be owned by you in order to teleport to it, or you must have "areas" privilege in order to teleport to those coordinates (this does not apply if "areas" mod is not detected). ``` /tpj [axis] [distance] ``` - **Name:** Teleport Jump - **Description:** Teleport a specified distance along a single specified axis. -- **Required Privilege:** "interact", "tp", "tp_tpc" +- **Required Privilege:** `interact", tp, tp_tpc` - **Available Options for *axis*:** x, y, z - **Example Usage:** '/tpj y 10' - teleport 10 nodes into the air. ``` /tpe ``` - **Name:** Teleport Evade - **Description:** In a sticky situation? Evade your enemy by teleporting to several nearby coordinates in random pattern. There's no knowing where you'll end up. -- **Required Privileges:** "interact", "tp_tpc", "tp" +- **Required Privileges:** `interact, tp_tpc, tp` - **Example Usage:** '/tpe' - teleports you to a random number of random coordinates in an evasive pattern. ``` /tpy ``` @@ -71,7 +71,7 @@ Report bugs or suggest ideas by [creating an issue](https://github.com/ChaosWorm If you know how to fix an issue, or want something to be added, consider opening a [pull request](https://github.com/ChaosWormz/teleport-request/compare). ## License -LGPL-2.1 for everything (click [here](https://github.com/ChaosWormz/teleport-request/blob/master/LICENSE.md) for more information). +[LGPL-2.1](https://github.com/ChaosWormz/teleport-request/blob/master/LICENSE.md) for everything. ## Contributors: - [RobbieF](https://minetest.tv) | [GitHub](https://github.com/Cat5TV) From 5f424b9b1f84904ba59b2c4bd01269dfc7f0dda4 Mon Sep 17 00:00:00 2001 From: Panquesito7 <51391473+Panquesito7@users.noreply.github.com> Date: Wed, 31 Jul 2019 22:05:14 -0500 Subject: [PATCH 08/25] Update init.lua --- init.lua | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/init.lua b/init.lua index b89105c..64d6eac 100644 --- a/init.lua +++ b/init.lua @@ -307,6 +307,8 @@ function tpr_accept(name, param) -- Let the player choose which player to teleport to when there are multiple requests. -- THIS IS AN UNTESTED FUNCTION. CHECK IT AT YOUR OWN RISK. elseif tpr_list[name] > 1 then + name2 = tpr_list[name] + chatmsg = S("@1 is teleporting to you.", name2) param = param:lower() minetest.chat_send_player(name, S("Use /tpy and choose a player to teleport to:")) local tp = {} @@ -322,6 +324,31 @@ function tpr_accept(name, param) -- Teleport player to the specified player if tpr_list[param] then tpr_teleport_player(param) + minetest.chat_send_player(param, S("Request Accepted!")) + minetest.chat_send_player(name, chatmsg) + --tpr_list[name] = nil + end + elseif tphr_list[name] > 1 then + name2 = tphr_list[name] + chatmsg = S("You are teleporting to @1.", name2) + param = param:lower() + minetest.chat_send_player(name, S("Use /tpy and choose a player to teleport to:")) + local tp = {} + for key, value in pairs(tphr_list) do + table.insert(tp, key) + end + if param == "" then + minetest.chat_send_player(name, S("Use /tpy and choose a player to teleport to:")) + for key, value in pairs(tphr_list) do + table.insert(tp, key) + end + end + -- Teleport player to the specified player + if tphr_list[param] then + tpr_teleport_player(param) + minetest.chat_send_player(param, S("Request Accepted!")) + minetest.chat_send_player(name, chatmsg) + --tpr_list[name] = nil end else return From c6b8df9d6f4445fa4b6e3ab25513e11111230571 Mon Sep 17 00:00:00 2001 From: Panquesito7 <51391473+Panquesito7@users.noreply.github.com> Date: Fri, 2 Aug 2019 19:31:03 -0500 Subject: [PATCH 09/25] Big improvement Almost done, looking into some issues that needs fixing. --- init.lua | 70 ++++++++++---------------------------------------------- 1 file changed, 12 insertions(+), 58 deletions(-) diff --git a/init.lua b/init.lua index 64d6eac..f62145b 100644 --- a/init.lua +++ b/init.lua @@ -287,83 +287,37 @@ end function tpr_accept(name, param) -- Check to prevent constant teleporting. if not tpr_list[name] - and not tphr_list[name] then - minetest.chat_send_player(name, S("Usage: /tpy allows you to accept teleport requests sent to you by other players")) + and not tphr_list[name] + or param == "" then + minetest.chat_send_player(name, S("Usage: /tpy ")) return end - + if tpr_list[name] then name2 = tpr_list[name] source = minetest.get_player_by_name(name) - target = minetest.get_player_by_name(name2) - chatmsg = S("@1 is teleporting to you.", name2) + target = minetest.get_player_by_name(param) + chatmsg = S("@1 is teleporting to you.", param) tpr_list[name] = nil elseif tphr_list[name] then name2 = tphr_list[name] - source = minetest.get_player_by_name(name2) + source = minetest.get_player_by_name(param) target = minetest.get_player_by_name(name) - chatmsg = S("You are teleporting to @1.", name2) + chatmsg = S("You are teleporting to @1.", param) tphr_list[name] = nil - -- Let the player choose which player to teleport to when there are multiple requests. - -- THIS IS AN UNTESTED FUNCTION. CHECK IT AT YOUR OWN RISK. - elseif tpr_list[name] > 1 then - name2 = tpr_list[name] - chatmsg = S("@1 is teleporting to you.", name2) - param = param:lower() - minetest.chat_send_player(name, S("Use /tpy and choose a player to teleport to:")) - local tp = {} - for key, value in pairs(tpr_list) do - table.insert(tp, key) - end - if param == "" then - minetest.chat_send_player(name, S("Use /tpy and choose a player to teleport to:")) - for key, value in pairs(tpr_list) do - table.insert(tp, key) - end - end - -- Teleport player to the specified player - if tpr_list[param] then - tpr_teleport_player(param) - minetest.chat_send_player(param, S("Request Accepted!")) - minetest.chat_send_player(name, chatmsg) - --tpr_list[name] = nil - end - elseif tphr_list[name] > 1 then - name2 = tphr_list[name] - chatmsg = S("You are teleporting to @1.", name2) - param = param:lower() - minetest.chat_send_player(name, S("Use /tpy and choose a player to teleport to:")) - local tp = {} - for key, value in pairs(tphr_list) do - table.insert(tp, key) - end - if param == "" then - minetest.chat_send_player(name, S("Use /tpy and choose a player to teleport to:")) - for key, value in pairs(tphr_list) do - table.insert(tp, key) - end - end - -- Teleport player to the specified player - if tphr_list[param] then - tpr_teleport_player(param) - minetest.chat_send_player(param, S("Request Accepted!")) - minetest.chat_send_player(name, chatmsg) - --tpr_list[name] = nil - end else return end - + -- Could happen if either player disconnects (or timeout); if so just abort if not source or not target then - minetest.chat_send_player(name, S("@1 just disconnected/left (by timeout).", name2)) + minetest.chat_send_player(name, S("@1 doesn't exist, or just disconnected/left (by timeout).", param)) return end - - minetest.chat_send_player(name2, S("Request Accepted!")) - minetest.chat_send_player(name, chatmsg) tpr_teleport_player() + minetest.chat_send_player(param, S("Request Accepted!")) + minetest.chat_send_player(name, chatmsg) end -- Teleport Jump - Relative Position Teleportation by number of nodes From adbee45fb58ee2e8b623c1769015abed5bf2a6af Mon Sep 17 00:00:00 2001 From: Panquesito7 <51391473+Panquesito7@users.noreply.github.com> Date: Sun, 4 Aug 2019 20:46:33 -0500 Subject: [PATCH 10/25] Update es.po --- locale/es.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/es.po b/locale/es.po index 4c29abe..d684d1e 100644 --- a/locale/es.po +++ b/locale/es.po @@ -97,12 +97,12 @@ msgid "Usage: /tpn allows you to deny teleport requests sent to you by other pla msgstr "Uso: /tpn te permite denegar solicitudes enviadas para ti de otros jugadores." #: init.lua:278 -msgid "Usage: /tpy allows you to accept teleport requests sent to you by other players" -msgstr "Uso: /tpy te permite aceptar solicitudes enviadas para ti de otros jugadores" +msgid "Usage: /tpy " +msgstr "Uso: /tpy " #: init.lua -msgid "@1 just disconnected/left (by timeout)." -msgstr "@1 se desconecto/fue." +msgid "@1 doesn't exist, or just disconnected/left (by timeout)." +msgstr "@1 no existe, o se desconecto/fue." #: init.lua:317 msgid "Request Accepted!" From 59d59f83b2497edff79040451f4f033ea5fe301b Mon Sep 17 00:00:00 2001 From: Panquesito7 <51391473+Panquesito7@users.noreply.github.com> Date: Sun, 4 Aug 2019 20:47:22 -0500 Subject: [PATCH 11/25] Update template.pot --- locale/template.pot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/template.pot b/locale/template.pot index 4db33ca..5f84f33 100644 --- a/locale/template.pot +++ b/locale/template.pot @@ -97,11 +97,11 @@ msgid "Usage: /tpn allows you to deny teleport requests sent to you by other pla msgstr "" #: init.lua:278 -msgid "Usage: /tpy allows you to accept teleport requests sent to you by other players" +msgid "Usage: /tpy " msgstr "" #: init.lua -msgid "@1 just disconnected/left (by timeout)." +msgid "@1 doesn't exist, or just disconnected/left (by timeout)." msgstr "" #: init.lua:317 From d6cf75676917f9b038c9b3c546464ee764041a9c Mon Sep 17 00:00:00 2001 From: Panquesito7 <51391473+Panquesito7@users.noreply.github.com> Date: Mon, 5 Aug 2019 23:04:38 -0500 Subject: [PATCH 12/25] Support for beerchat (UNTESTED) Thanks to @6r1d for the idea! This commit also improves the mod and makes the mod better. --- init.lua | 194 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 104 insertions(+), 90 deletions(-) diff --git a/init.lua b/init.lua index f62145b..364114a 100644 --- a/init.lua +++ b/init.lua @@ -28,6 +28,8 @@ Optional dependencies: areas, intllib New release by RobbieF under new mod: tps_teleport - http://blog.minetest.tv/teleport-request/ --]] +tp = {} + -- Load support for intllib. local MP = minetest.get_modpath(minetest.get_current_modname()) local S, NS = dofile(MP.."/intllib.lua") @@ -35,43 +37,43 @@ local S, NS = dofile(MP.."/intllib.lua") -- Load configuration. dofile(MP.."/config.lua") -local tpr_list = {} -local tphr_list = {} +tp.tpr_list = {} +tp.tphr_list = {} local map_size = 30912 -local function can_teleport(to) +function tp.can_teleport(to) return to.x < map_size and to.x > -map_size and to.y < map_size and to.y > -map_size and to.z < map_size and to.z > -map_size end -- Teleport player to a player (used in "/tpr" and in "/tphr" command). -function tpr_teleport_player() +function tp.tpr_teleport_player() local target_coords = source:get_pos() local target_sound = target:get_pos() - target:set_pos(find_free_position_near(target_coords)) + target:set_pos(tp.find_free_position_near(target_coords)) minetest.sound_play("whoosh", {pos = target_coords, gain = 0.5, max_hear_distance = 10}) minetest.sound_play("whoosh", {pos = target_sound, gain = 0.5, max_hear_distance = 10}) - --parti2(target_coords) + --tp.parti2(target_coords) end -- TPC & TPJ -function tpc_teleport_player(player) +function tp.tpc_teleport_player(player) local pname = minetest.get_player_by_name(player) minetest.sound_play("whoosh", {pos = pname:get_pos(), gain = 0.5, max_hear_distance = 10}) - pname:set_pos(find_free_position_near(target_coords)) + pname:set_pos(tp.find_free_position_near(target_coords)) minetest.sound_play("whoosh", {pos = target_coords, gain = 0.5, max_hear_distance = 10}) - --parti2(target_coords) + --tp.parti2(target_coords) end -- TPP -function tpp_teleport_player(player) +function tp.tpp_teleport_player(player) local pname = minetest.get_player_by_name(player) minetest.sound_play("whoosh", {pos = pname:get_pos(), gain = 0.5, max_hear_distance = 10}) - pname:set_pos(find_free_position_near(pos)) + pname:set_pos(tp.find_free_position_near(pos)) minetest.sound_play("whoosh", {pos = pos, gain = 0.5, max_hear_distance = 10}) - --parti2(target_coords) + --tp.parti2(target_coords) end -function find_free_position_near(pos) +function tp.find_free_position_near(pos) local tries = { {x=1,y=0,z=0}, {x=-1,y=0,z=0}, @@ -87,7 +89,7 @@ function find_free_position_near(pos) return pos, false end -function parti(pos) +function tp.parti(pos) minetest.add_particlespawner(50, 0.4, {x=pos.x + 0.5, y=pos.y, z=pos.z + 0.5}, {x=pos.x - 0.5, y=pos.y, z=pos.z - 0.5}, {x=0, y=5, z=0}, {x=0, y=0, z=0}, @@ -98,7 +100,7 @@ function parti(pos) "tps_portal_parti.png") end -function parti2(pos) +function tp.parti2(pos) minetest.add_particlespawner(50, 0.4, {x=pos.x + 0.5, y=pos.y + 10, z=pos.z + 0.5}, {x=pos.x - 0.5, y=pos.y, z=pos.z - 0.5}, {x=0, y=-5, z=0}, {x=0, y=0, z=0}, @@ -110,35 +112,42 @@ function parti2(pos) end -- Teleport Request System -function clear_tpr_list(name) - if tpr_list[name] then - tpr_list[name] = nil +function tp.clear_tpr_list(name) + if tp.tpr_list[name] then + tp.tpr_list[name] = nil return end end -function clear_tphr_list(name) - if tphr_list[name] then - tphr_list[name] = nil +function tp.clear_tphr_list(name) + if tp.tphr_list[name] then + tp.tphr_list[name] = nil return end end -- Clear requests when the player leaves minetest.register_on_leaveplayer(function(name) - if tpr_list[name] then - tpr_list[name] = nil + if tp.tpr_list[name] then + tp.tpr_list[name] = nil return end - if tphr_list[name] then - tphr_list[name] = nil + if tp.tphr_list[name] then + tp.tphr_list[name] = nil return end end) -function tpr_send(sender, receiver) - if minetest.check_player_privs(sender, {tp_admin = true}) and enable_immediate_teleport then +function tp.tpr_send(sender, receiver) + -- Compatibility with beerchat (UNTESTED) + if minetest.get_modpath("beerchat") and not minetest.check_player_privs(sender, {tp_admin = true}) then + if minetest.get_player_by_name(sender):get_attribute("beerchat:muted:" .. sender) then + minetest.chat_send_player(sender, S("You are not allowed to send requests because you're muted.")) + return + end + end + if minetest.check_player_privs(sender, {tp_admin = true}) and tp.enable_immediate_teleport then if receiver == "" then minetest.chat_send_player(sender, S("Usage: /tpr ")) return @@ -147,8 +156,8 @@ function tpr_send(sender, receiver) minetest.chat_send_player(sender, S("There is no player by that name. Keep in mind this is case-sensitive, and the player must be online")) return end - tpr_list[receiver] = sender - tpr_accept(receiver) + tp.tpr_list[receiver] = sender + tp.tpr_accept(receiver) minetest.chat_send_player(sender, S("You are teleporting to @1.", receiver)) return end @@ -166,11 +175,11 @@ function tpr_send(sender, receiver) minetest.chat_send_player(receiver, S("@1 is requesting to teleport to you. /tpy to accept", sender)) minetest.chat_send_player(sender, S("Teleport request sent! It will timeout in @1 seconds", timeout_delay)) -- Write name values to list and clear old values. - tpr_list[receiver] = sender + tp.tpr_list[receiver] = sender -- Teleport timeout delay - minetest.after(timeout_delay, function(name) - if tpr_list[name] then - tpr_list[name] = nil + minetest.after(tp.timeout_delay, function(name) + if tp.tpr_list[name] then + tp.tpr_list[name] = nil minetest.chat_send_player(sender, S("Request timed-out.")) minetest.chat_send_player(receiver, S("Request timed-out.")) return @@ -178,8 +187,15 @@ function tpr_send(sender, receiver) end, receiver) end -function tphr_send(sender, receiver) - if minetest.check_player_privs(sender, {tp_admin = true}) and enable_immediate_teleport then +function tp.tphr_send(sender, receiver) + -- Compatibility with beerchat (UNTESTED) + if minetest.get_modpath("beerchat") and not minetest.check_player_privs(sender, {tp_admin = true}) then + if minetest.get_player_by_name(sender):get_attribute("beerchat:muted:" .. sender) then + minetest.chat_send_player(sender, S("You are not allowed to send requests because you're muted.")) + return + end + end + if minetest.check_player_privs(sender, {tp_admin = true}) and tp.enable_immediate_teleport then if receiver == "" then minetest.chat_send_player(sender, S("Usage: /tphr ")) return @@ -188,8 +204,8 @@ function tphr_send(sender, receiver) minetest.chat_send_player(sender, S("There is no player by that name. Keep in mind this is case-sensitive, and the player must be online")) return end - tphr_list[receiver] = sender - tpr_accept(receiver) + tp.tphr_list[receiver] = sender + tp.tpr_accept(receiver) minetest.chat_send_player(sender, S("@1 is teleporting to you.", receiver)) return end @@ -206,11 +222,11 @@ function tphr_send(sender, receiver) minetest.chat_send_player(receiver, S("@1 is requesting that you teleport to them. /tpy to accept; /tpn to deny", sender)) minetest.chat_send_player(sender, S("Teleport request sent! It will timeout in @1 seconds", timeout_delay)) -- Write name values to list and clear old values. - tphr_list[receiver] = sender + tp.tphr_list[receiver] = sender -- Teleport timeout delay - minetest.after(timeout_delay, function(name) - if tphr_list[name] then - tphr_list[name] = nil + minetest.after(tp.timeout_delay, function(name) + if tp.tphr_list[name] then + tp.tphr_list[name] = nil minetest.chat_send_player(sender, S("Request timed-out.")) minetest.chat_send_player(receiver, S("Request timed-out.")) return @@ -218,7 +234,7 @@ function tphr_send(sender, receiver) end, receiver) end -function tpc_send(player, coordinates) +function tp.tpc_send(player, coordinates) local posx,posy,posz = string.match(coordinates, "^(-?%d+), (-?%d+), (-?%d+)$") local pname = minetest.get_player_by_name(player) @@ -236,7 +252,7 @@ function tpc_send(player, coordinates) target_coords = {x=posx, y=posy, z=posz} - if can_teleport(target_coords) == false then + if tp.can_teleport(target_coords) == false then minetest.chat_send_player(player, S("You cannot teleport to a location outside the map!")) return nil end @@ -244,8 +260,8 @@ function tpc_send(player, coordinates) -- If the area is protected, reject the user's request to teleport to these coordinates -- In future release we'll actually query the player who owns the area, if they're online, and ask for their permission. -- Admin user (priv "tp_admin") overrides all protection - if minetest.check_player_privs(pname, {tp_admin=true}) then - tpc_teleport_player(player) + if minetest.check_player_privs(pname, {tp_admin = true}) then + tp.tpc_teleport_player(player) minetest.chat_send_player(player, S("Teleporting to: @1, @2, @3", posx, posy, posz)) else if minetest.check_player_privs(pname, {tp_tpc = true}) then @@ -257,7 +273,7 @@ function tpc_send(player, coordinates) return end end - tpc_teleport_player(player) + tp.tpc_teleport_player(player) minetest.chat_send_player(player, S("Teleporting to: @1, @2, @3", posx, posy, posz)) else minetest.chat_send_player(player, S("Error: You do not have permission to teleport to coordinates.")) @@ -266,17 +282,17 @@ function tpc_send(player, coordinates) end end -function tpr_deny(name) - if tpr_list[name] then - name2 = tpr_list[name] +function tp.tpr_deny(name) + if tp.tpr_list[name] then + name2 = tp.tpr_list[name] minetest.chat_send_player(name2, S("Teleport request denied.")) minetest.chat_send_player(name, S("You denied the request @1 sent you.", name2)) - tpr_list[name] = nil - elseif tphr_list[name] then + tp.tpr_list[name] = nil + elseif tp.tphr_list[name] then name2 = tphr_list[name] minetest.chat_send_player(name2, S("Teleport request denied.")) minetest.chat_send_player(name, S("You denied the request @1 sent you.", name2)) - tphr_list[name] = nil + tp.tphr_list[name] = nil else minetest.chat_send_player(name, S("Usage: /tpn allows you to deny teleport requests sent to you by other players.")) return @@ -284,27 +300,26 @@ function tpr_deny(name) end -- Teleport Accept Systems -function tpr_accept(name, param) +function tp.tpr_accept(name, param) -- Check to prevent constant teleporting. - if not tpr_list[name] - and not tphr_list[name] - or param == "" then + if not tp.tpr_list[name] + and not tp.tphr_list[name] minetest.chat_send_player(name, S("Usage: /tpy ")) return end - if tpr_list[name] then - name2 = tpr_list[name] + if tp.tpr_list[name] then + name2 = tp.tpr_list[name] source = minetest.get_player_by_name(name) - target = minetest.get_player_by_name(param) - chatmsg = S("@1 is teleporting to you.", param) - tpr_list[name] = nil - elseif tphr_list[name] then - name2 = tphr_list[name] - source = minetest.get_player_by_name(param) + target = minetest.get_player_by_name(name2) + chatmsg = S("@1 is teleporting to you.", name2) + tp.tpr_list[name] = nil + elseif tp.tphr_list[name] then + name2 = tp.tphr_list[name] + source = minetest.get_player_by_name(name2) target = minetest.get_player_by_name(name) - chatmsg = S("You are teleporting to @1.", param) - tphr_list[name] = nil + chatmsg = S("You are teleporting to @1.", name2) + tp.tphr_list[name] = nil else return end @@ -312,16 +327,16 @@ function tpr_accept(name, param) -- Could happen if either player disconnects (or timeout); if so just abort if not source or not target then - minetest.chat_send_player(name, S("@1 doesn't exist, or just disconnected/left (by timeout).", param)) + minetest.chat_send_player(name, S("@1 doesn't exist, or just disconnected/left (by timeout).", name2)) return end - tpr_teleport_player() - minetest.chat_send_player(param, S("Request Accepted!")) + tp.tpr_teleport_player() + minetest.chat_send_player(name2, S("Request Accepted!")) minetest.chat_send_player(name, chatmsg) end -- Teleport Jump - Relative Position Teleportation by number of nodes -function tpj(player, param) +function tp.tpj(player, param) local pname = minetest.get_player_by_name(player) if param == "" then @@ -351,15 +366,15 @@ function tpj(player, param) minetest.chat_send_player(player, S("Not a valid axis. Valid options are X, Y or Z.")) return end - if can_teleport(target_coords) == false then + if tp.can_teleport(target_coords) == false then minetest.chat_send_player(player, S("You cannot teleport to a location outside the map!")) return end - tpc_teleport_player(player) + tp.tpc_teleport_player(player) end -- Evade -function tpe(player) +function tp.tpe(player) minetest.chat_send_player(player, S("EVADE!")) local mindistance = 15 local maxdistance = 50 @@ -378,7 +393,7 @@ function tpe(player) distance = isnegative .. math.random(mindistance,maxdistance) -- the distance to jump axis = options[math.random(3)] local command = axis .. " " .. distance - tpj(player, command) + tp.tpj(player, command) end ) iteration = iteration + 0.5 @@ -386,20 +401,19 @@ function tpe(player) end -- Register chatcommands -if enable_tpp_command then +if tp.enable_tpp_command then minetest.register_chatcommand("tpp", { description = S("Teleport to a place (i.e., spawn, shop)."), params = S(" | leave empty to see available places"), privs = {}, func = function(player, param) local pname = minetest.get_player_by_name(player) - param = param:lower() -- Show the available places to the player (taken from shivajiva101's POI mod, thanks!). if param == "" then local places = {} - if not available_places then available_places = {} end - for key, value in pairs(available_places) do + if not tp.available_places then tp.available_places = {} end + for key, value in pairs(tp.available_places) do table.insert(places, key) end if #places == 0 then @@ -408,12 +422,12 @@ if enable_tpp_command then table.insert(places, S("Usage: /tpp ")) return true, table.concat(places, "\n") -- Teleport player to the specified place (taken from shivajiva101's POI mod, thanks!). - elseif available_places[param] then - pos = {x = available_places[param].x, y = available_places[param].y, z = available_places[param].z} - tpp_teleport_player(player) + elseif tp.available_places[param] then + pos = {x = tp.available_places[param].x, y = tp.available_places[param].y, z = tp.available_places[param].z} + tp.tpp_teleport_player(player) minetest.chat_send_player(player, S("Teleporting to @1.", param)) -- Check if the place exists. - elseif not available_places[param] then + elseif not tp.available_places[param] then minetest.chat_send_player(player, S("There is no place by that name. Keep in mind this is case-sensitive.")) return end @@ -425,49 +439,49 @@ minetest.register_chatcommand("tpr", { description = S("Request teleport to another player"), params = S(" | leave playername empty to see help message"), privs = {interact = true, tp = true}, - func = tpr_send + func = tp.tpr_send }) minetest.register_chatcommand("tphr", { description = S("Request player to teleport to you"), params = S(" | leave playername empty to see help message"), privs = {interact = true, tp = true}, - func = tphr_send + func = tp.tphr_send }) minetest.register_chatcommand("tpc", { description = S("Teleport to coordinates"), params = S(" | leave coordinates empty to see help message"), privs = {interact = true, tp_tpc = true, tp = true}, - func = tpc_send + func = tp.tpc_send }) minetest.register_chatcommand("tpj", { description = S("Teleport to relative position"), params = S(" | leave empty to see help message"), privs = {interact = true, tp_tpc = true, tp = true}, - func = tpj + func = tp.tpj }) minetest.register_chatcommand("tpe", { description = S("Evade Enemy"), privs = {interact = true, tp_tpc = true, tp = true}, - func = tpe + func = tp.tpe }) minetest.register_chatcommand("tpy", { description = S("Accept teleport requests from another player"), privs = {interact = true, tp = true}, - func = tpr_accept + func = tp.tpr_accept }) minetest.register_chatcommand("tpn", { description = S("Deny teleport requests from another player"), privs = {interact = true, tp = true}, - func = tpr_deny + func = tp.tpr_deny }) -- Log if minetest.settings:get_bool("log_mods") then - minetest.log("action", S("[Teleport Request] TPS Teleport v@1 Loaded!", version)) + minetest.log("action", S("[Teleport Request] TPS Teleport v@1 Loaded!", tp.version)) end From b24e687c80b37a25a387d7f01417e0fd10b81c36 Mon Sep 17 00:00:00 2001 From: Panquesito7 <51391473+Panquesito7@users.noreply.github.com> Date: Mon, 5 Aug 2019 23:05:39 -0500 Subject: [PATCH 13/25] Update config.lua --- config.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config.lua b/config.lua index 3194ce9..cec0f52 100644 --- a/config.lua +++ b/config.lua @@ -24,22 +24,22 @@ local MP = minetest.get_modpath(minetest.get_current_modname()) local S, NS = dofile(MP.."/intllib.lua") -- Timeout delay and mod version. -timeout_delay = 60 -version = "1.5" +tp.timeout_delay = 60 +tp.version = "1.5" -- Enable teleporting immediately to the player with "tp_admin" privilege. -enable_immediate_teleport = true +tp.enable_immediate_teleport = true local chatmsg, source, target, name2, target_coords, pos -- Set the values of the positions of your places, players will be able to teleport to them (no matter if it is protected, or not). -available_places = { +tp.available_places = { spawn = {x = 0, y = 0, z = 0}, -- Set coordinates of spawn here. shop = {x = 0, y = 0, z = 0}, -- Set coordinates of the shop here. } -- Enable tpp command -enable_tpp_command = false +tp.enable_tpp_command = false -- Register privileges minetest.register_privilege("tp", { From 6c0f492fc297927b07ad78d6b5356667ec520b69 Mon Sep 17 00:00:00 2001 From: Panquesito7 <51391473+Panquesito7@users.noreply.github.com> Date: Mon, 5 Aug 2019 23:07:02 -0500 Subject: [PATCH 14/25] Update init.lua --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 364114a..18264e0 100644 --- a/init.lua +++ b/init.lua @@ -304,7 +304,7 @@ function tp.tpr_accept(name, param) -- Check to prevent constant teleporting. if not tp.tpr_list[name] and not tp.tphr_list[name] - minetest.chat_send_player(name, S("Usage: /tpy ")) + minetest.chat_send_player(name, S("Usage: /tpy allows you to accept teleport requests sent to you by other players")) return end From 2ccccd6c5fdf4c26f1230af8509bde03fe971c71 Mon Sep 17 00:00:00 2001 From: Panquesito7 <51391473+Panquesito7@users.noreply.github.com> Date: Mon, 5 Aug 2019 23:07:54 -0500 Subject: [PATCH 15/25] Update template.pot --- locale/template.pot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locale/template.pot b/locale/template.pot index 5f84f33..90d1bf8 100644 --- a/locale/template.pot +++ b/locale/template.pot @@ -97,7 +97,7 @@ msgid "Usage: /tpn allows you to deny teleport requests sent to you by other pla msgstr "" #: init.lua:278 -msgid "Usage: /tpy " +msgid "Usage: /tpy allows you to accept teleport requests sent to you by other players" msgstr "" #: init.lua From 4123932afb8bb57938f74edbf04b477bcc89377e Mon Sep 17 00:00:00 2001 From: Panquesito7 <51391473+Panquesito7@users.noreply.github.com> Date: Mon, 5 Aug 2019 23:08:35 -0500 Subject: [PATCH 16/25] Update es.po --- locale/es.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/es.po b/locale/es.po index d684d1e..183b267 100644 --- a/locale/es.po +++ b/locale/es.po @@ -97,8 +97,8 @@ msgid "Usage: /tpn allows you to deny teleport requests sent to you by other pla msgstr "Uso: /tpn te permite denegar solicitudes enviadas para ti de otros jugadores." #: init.lua:278 -msgid "Usage: /tpy " -msgstr "Uso: /tpy " +msgid "Usage: /tpy allows you to accept teleport requests sent to you by other players" +msgstr "Uso: /tpy te permite aceptar solicitudes enviadas para ti de otros jugadores" #: init.lua msgid "@1 doesn't exist, or just disconnected/left (by timeout)." From e4ed515d1f5739a4949de862069435de609da8c8 Mon Sep 17 00:00:00 2001 From: Panquesito7 <51391473+Panquesito7@users.noreply.github.com> Date: Tue, 6 Aug 2019 22:19:30 -0500 Subject: [PATCH 17/25] Add chat2 support This commit adds chat2 support (https://github.com/minetest-mods/chat2). Tested with MT/MTG 5.0.1 and works pretty well. If there's any bug/error/typo, please tell me, so, I can fix it. --- README.md | 2 + config.lua | 1 + init.lua | 138 ++++++++++++++++++++++++++++++++++++++++++++++++----- mod.conf | 2 +- 4 files changed, 131 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index ac8583e..4db9e37 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,8 @@ There are no dependencies. However, optional dependencies are: - [areas](https://github.com/minetest-mods/areas) - [intllib](https://github.com/minetest-mods/intllib) +- [beerchat](https://github.com/pandorabox-io/beerchat) +- [chat2](https://github.com/minetest-mods/chat2) ## Requirements This mod requieres MT/MTG 5.0.0+ to run. diff --git a/config.lua b/config.lua index cec0f52..dd76363 100644 --- a/config.lua +++ b/config.lua @@ -33,6 +33,7 @@ tp.enable_immediate_teleport = true local chatmsg, source, target, name2, target_coords, pos -- Set the values of the positions of your places, players will be able to teleport to them (no matter if it is protected, or not). +-- You must activate "enable_tpp_command" in order to make this to work. tp.available_places = { spawn = {x = 0, y = 0, z = 0}, -- Set coordinates of spawn here. shop = {x = 0, y = 0, z = 0}, -- Set coordinates of the shop here. diff --git a/init.lua b/init.lua index 18264e0..e95b02a 100644 --- a/init.lua +++ b/init.lua @@ -144,34 +144,55 @@ function tp.tpr_send(sender, receiver) if minetest.get_modpath("beerchat") and not minetest.check_player_privs(sender, {tp_admin = true}) then if minetest.get_player_by_name(sender):get_attribute("beerchat:muted:" .. sender) then minetest.chat_send_player(sender, S("You are not allowed to send requests because you're muted.")) + if minetest.get_modpath("chat2") then + chat2.send_message(minetest.get_player_by_name(sender), S("You are not allowed to send requests because you're muted."), 0xFFFFFF) + end return end end if minetest.check_player_privs(sender, {tp_admin = true}) and tp.enable_immediate_teleport then if receiver == "" then minetest.chat_send_player(sender, S("Usage: /tpr ")) - return + if minetest.get_modpath("chat2") then + chat2.send_message(minetest.get_player_by_name(sender), S("Usage: /tpr "), 0xFFFFFF) + end + return end if not minetest.get_player_by_name(receiver) then minetest.chat_send_player(sender, S("There is no player by that name. Keep in mind this is case-sensitive, and the player must be online")) + if minetest.get_modpath("chat2") then + chat2.send_message(minetest.get_player_by_name(sender), S("There is no player by that name. Keep in mind this is case-sensitive, and the player must be online"), 0xFFFFFF) + end return end tp.tpr_list[receiver] = sender tp.tpr_accept(receiver) minetest.chat_send_player(sender, S("You are teleporting to @1.", receiver)) + if minetest.get_modpath("chat2") then + chat2.send_message(minetest.get_player_by_name(sender), S("You are teleporting to @1.", receiver), 0xFFFFFF) + end return end if receiver == "" then minetest.chat_send_player(sender, S("Usage: /tpr ")) + if minetest.get_modpath("chat2") then + chat2.send_message(minetest.get_player_by_name(sender), S("Usage: /tpr "), 0xFFFFFF) + end return end if not minetest.get_player_by_name(receiver) then - minetest.chat_send_player(sender, S("There is no player by that name. Keep in mind this is case-sensitive, and the player must be online.")) + minetest.chat_send_player(sender, S("There is no player by that name. Keep in mind this is case-sensitive, and the player must be online")) + if minetest.get_modpath("chat2") then + chat2.send_message(minetest.get_player_by_name(sender), S("There is no player by that name. Keep in mind this is case-sensitive, and the player must be online"), 0xFFFFFF) + end return end - + if minetest.get_modpath("chat2") then + chat2.send_message(minetest.get_player_by_name(receiver), S("@1 is requesting to teleport to you. /tpy to accept", sender), 0xFFFFFF) + chat2.send_message(minetest.get_player_by_name(sender), S("Teleport request sent! It will timeout in @1 seconds", tp.timeout_delay), 0xFFFFFF) + end minetest.chat_send_player(receiver, S("@1 is requesting to teleport to you. /tpy to accept", sender)) minetest.chat_send_player(sender, S("Teleport request sent! It will timeout in @1 seconds", timeout_delay)) -- Write name values to list and clear old values. @@ -182,6 +203,10 @@ function tp.tpr_send(sender, receiver) tp.tpr_list[name] = nil minetest.chat_send_player(sender, S("Request timed-out.")) minetest.chat_send_player(receiver, S("Request timed-out.")) + if minetest.get_modpath("chat2") then + chat2.send_message(minetest.get_player_by_name(sender), S("Request timed-out."), 0xFFFFFF) + chat2.send_message(minetest.get_player_by_name(receiver), S("Request timed-out."), 0xFFFFFF) + end return end end, receiver) @@ -192,33 +217,54 @@ function tp.tphr_send(sender, receiver) if minetest.get_modpath("beerchat") and not minetest.check_player_privs(sender, {tp_admin = true}) then if minetest.get_player_by_name(sender):get_attribute("beerchat:muted:" .. sender) then minetest.chat_send_player(sender, S("You are not allowed to send requests because you're muted.")) + if minetest.get_modpath("chat2") then + chat2.send_message(minetest.get_player_by_name(sender), S("You are not allowed to send requests because you're muted."), 0xFFFFFF) + end return end end if minetest.check_player_privs(sender, {tp_admin = true}) and tp.enable_immediate_teleport then if receiver == "" then minetest.chat_send_player(sender, S("Usage: /tphr ")) + if minetest.get_modpath("chat2") then + chat2.send_message(minetest.get_player_by_name(sender), S("Usage. /tphr "), 0xFFFFFF) + end return end if not minetest.get_player_by_name(receiver) then minetest.chat_send_player(sender, S("There is no player by that name. Keep in mind this is case-sensitive, and the player must be online")) + if minetest.get_modpath("chat2") then + chat2.send_message(minetest.get_player_by_name(sender), S("There is no player by that name. Keep in mind this is case-sensitive, and the player must be online"), 0xFFFFFF) + end return end tp.tphr_list[receiver] = sender tp.tpr_accept(receiver) minetest.chat_send_player(sender, S("@1 is teleporting to you.", receiver)) + if minetest.get_modpath("chat2") then + chat2.send_message(minetest.get_player_by_name(sender), S("@1 is teleporting to you.", receiver), 0xFFFFFF) + end return end if receiver == "" then - minetest.chat_send_player(sender, S("Usage: /tphr ")) + minetest.chat_send_player(sender, S("Usage: /tphr ")) + if minetest.get_modpath("chat2") then + chat2.send_message(minetest.get_player_by_name(sender), S("Usage. /tphr "), 0xFFFFFF) + end return end if not minetest.get_player_by_name(receiver) then - minetest.chat_send_player(sender, S("There is no player by that name. Keep in mind this is case-sensitive, and the player must be online.")) + minetest.chat_send_player(sender, S("There is no player by that name. Keep in mind this is case-sensitive, and the player must be online")) + if minetest.get_modpath("chat2") then + chat2.send_message(minetest.get_player_by_name(sender), S("There is no player by that name. Keep in mind this is case-sensitive, and the player must be online"), 0xFFFFFF) + end return end - + if minetest.get_modpath("chat2") then + chat2.send_message(minetest.get_player_by_name(receiver), S("@1 is requesting that you teleport to them. /tpy to accept; /tpn to deny", sender), 0xFFFFFF) + chat2.send_message(minetest.get_player_by_name(sender), S("Teleport request sent! It will timeout in @1 seconds", tp.timeout_delay), 0xFFFFFF) + end minetest.chat_send_player(receiver, S("@1 is requesting that you teleport to them. /tpy to accept; /tpn to deny", sender)) minetest.chat_send_player(sender, S("Teleport request sent! It will timeout in @1 seconds", timeout_delay)) -- Write name values to list and clear old values. @@ -229,6 +275,10 @@ function tp.tphr_send(sender, receiver) tp.tphr_list[name] = nil minetest.chat_send_player(sender, S("Request timed-out.")) minetest.chat_send_player(receiver, S("Request timed-out.")) + if minetest.get_modpath("chat2") then + chat2.send_message(minetest.get_player_by_name(sender), S("Request timed-out"), 0xFFFFFF) + chat2.send_message(minetest.get_player_by_name(receiver), S("Request timed-out"), 0xFFFFFF) + end return end end, receiver) @@ -247,6 +297,9 @@ function tp.tpc_send(player, coordinates) if posx==nil or posy==nil or posz==nil or string.len(posx) > 6 or string.len(posy) > 6 or string.len(posz) > 6 then minetest.chat_send_player(player, S("Usage: /tpc ")) + if minetest.get_modpath("chat2") then + chat2.send_message(minetest.get_player_by_name(player), S("Usage: /tpc "), 0xFFFFFF) + end return nil end @@ -254,6 +307,9 @@ function tp.tpc_send(player, coordinates) if tp.can_teleport(target_coords) == false then minetest.chat_send_player(player, S("You cannot teleport to a location outside the map!")) + if minetest.get_modpath("chat2") then + chat2.send_message(minetest.get_player_by_name(player), S("You cannot teleport to a location outside the map!"), 0xFFFFFF) + end return nil end @@ -263,6 +319,9 @@ function tp.tpc_send(player, coordinates) if minetest.check_player_privs(pname, {tp_admin = true}) then tp.tpc_teleport_player(player) minetest.chat_send_player(player, S("Teleporting to: @1, @2, @3", posx, posy, posz)) + if minetest.get_modpath("chat2") then + chat2.send_message(minetest.get_player_by_name(player), S("Teleporting to: @1, @2, @3", posx, posy, posz), 0xFFFFFF) + end else if minetest.check_player_privs(pname, {tp_tpc = true}) then local protected = minetest.is_protected(target_coords,pname) @@ -270,13 +329,22 @@ function tp.tpc_send(player, coordinates) if not areas:canInteract(target_coords, player) then local owners = areas:getNodeOwners(target_coords) minetest.chat_send_player(player, S("Error: @1 is protected by @2.", minetest.pos_to_string(target_coords), table.concat(owners, ", "))) + if minetest.get_modpath("chat2") then + chat2.send_message(minetest.get_player_by_name(player), S("Error: @1 is protected by @2.", minetest.pos_to_string(target_coords), table.concat(owners, ", ")), 0xFFFFFF) + end return end end tp.tpc_teleport_player(player) minetest.chat_send_player(player, S("Teleporting to: @1, @2, @3", posx, posy, posz)) + if minetest.get_modpath("chat2") then + chat2.send_message(minetest.get_player_by_name(player), S("Teleporting to: @1, @2, @3", posx, posy, posz), 0xFFFFFF) + end else - minetest.chat_send_player(player, S("Error: You do not have permission to teleport to coordinates.")) + minetest.chat_send_player(player, S("Error: You do not have permission to teleport to those coordinates.")) + if minetest.get_modpath("chat2") then + chat2.send_message(minetest.get_player_by_name(player), S("Error: You do not have permission to teleport to those coordinates."), 0xFFFFFF) + end return end end @@ -287,14 +355,25 @@ function tp.tpr_deny(name) name2 = tp.tpr_list[name] minetest.chat_send_player(name2, S("Teleport request denied.")) minetest.chat_send_player(name, S("You denied the request @1 sent you.", name2)) + if minetest.get_modpath("chat2") then + chat2.send_message(minetest.get_player_by_name(name2), S("Teleport request denied."), 0xFFFFFF) + chat2.send_message(minetest.get_player_by_name(name), S("You denied the request @1 sent you.", name2), 0xFFFFFF) + end tp.tpr_list[name] = nil elseif tp.tphr_list[name] then - name2 = tphr_list[name] + name2 = tp.tphr_list[name] minetest.chat_send_player(name2, S("Teleport request denied.")) minetest.chat_send_player(name, S("You denied the request @1 sent you.", name2)) + if minetest.get_modpath("chat2") then + chat2.send_message(minetest.get_player_by_name(name2), S("Teleport request denied."), 0xFFFFFF) + chat2.send_message(minetest.get_player_by_name(name), S("You denied the request @1 sent you.", name2), 0xFFFFFF) + end tp.tphr_list[name] = nil else minetest.chat_send_player(name, S("Usage: /tpn allows you to deny teleport requests sent to you by other players.")) + if minetest.get_modpath("chat2") then + chat2.send_message(minetest.get_player_by_name(name), S("Usage: /tpn allows you to deny teleport requests sent to you by other players."), 0xFFFFFF) + end return end end @@ -305,6 +384,9 @@ function tp.tpr_accept(name, param) if not tp.tpr_list[name] and not tp.tphr_list[name] minetest.chat_send_player(name, S("Usage: /tpy allows you to accept teleport requests sent to you by other players")) + if minetest.get_modpath("chat2") then + chat2.send_message(minetest.get_player_by_name(name), S("Usage: /tpy allows you to accept teleport requests sent to you by other players"), 0xFFFFFF) + end return end @@ -333,6 +415,10 @@ function tp.tpr_accept(name, param) tp.tpr_teleport_player() minetest.chat_send_player(name2, S("Request Accepted!")) minetest.chat_send_player(name, chatmsg) + if minetest.get_modpath("chat2") then + chat2.send_message(minetest.get_player_by_name(name2), S("Request Accepted!"), 0xFFFFFF) + chat2.send_message(minetest.get_player_by_name(name), chatmsg, 0xFFFFFF) + end end -- Teleport Jump - Relative Position Teleportation by number of nodes @@ -340,13 +426,19 @@ function tp.tpj(player, param) local pname = minetest.get_player_by_name(player) if param == "" then - minetest.chat_send_player(player, S("Usage: ")) + minetest.chat_send_player(player, S("Usage: ")) + if minetest.get_modpath("chat2") then + chat2.send_message(minetest.get_player_by_name(player), S("Usage: "), 0xFFFFFF) + end return false end local args = param:split(" ") -- look into this. Can it crash if the player does not have two parameters? if #args < 2 then - minetest.chat_send_player(player, S("Usage: ")) + minetest.chat_send_player(player, S("Usage: ")) + if minetest.get_modpath("chat2") then + chat2.send_message(minetest.get_player_by_name(player), S("Usage: "), 0xFFFFFF) + end return false end @@ -363,11 +455,17 @@ function tp.tpj(player, param) elseif args[1] == "z" then target_coords["z"] = target_coords["z"] + tonumber(args[2]) else - minetest.chat_send_player(player, S("Not a valid axis. Valid options are X, Y or Z.")) + minetest.chat_send_player(player, S("Not a valid axis. Valid options are X, Y or Z")) + if minetest.get_modpath("chat2") then + chat2.send_message(minetest.get_player_by_name(player), S("Not a valid axis. Valid options are X, Y or Z"), 0xFFFFFF) + end return end if tp.can_teleport(target_coords) == false then minetest.chat_send_player(player, S("You cannot teleport to a location outside the map!")) + if minetest.get_modpath("chat2") then + chat2.send_message(minetest.get_player_by_name(player), S("You cannot teleport to a location outside the map!"), 0xFFFFFF) + end return end tp.tpc_teleport_player(player) @@ -375,6 +473,9 @@ end -- Evade function tp.tpe(player) + if minetest.get_modpath("chat2") then + chat2.send_message(minetest.get_player_by_name(player), S("EVADE!"), 0xFFFFFF) + end minetest.chat_send_player(player, S("EVADE!")) local mindistance = 15 local maxdistance = 50 @@ -414,11 +515,20 @@ if tp.enable_tpp_command then local places = {} if not tp.available_places then tp.available_places = {} end for key, value in pairs(tp.available_places) do + if minetest.get_modpath("chat2") then + chat2.send_message(minetest.get_player_by_name(player), key, 0xFFFFFF) + end table.insert(places, key) end if #places == 0 then + if minetest.get_modpath("chat2") then + chat2.send_message(minetest.get_player_by_name(player), S("There are no places yet."), 0xFFFFFF) + end return true, S("There are no places yet.") end + if minetest.get_modpath("chat2") then + chat2.send_message(minetest.get_player_by_name(player), S("Usage: /tpp "), 0xFFFFFF) + end table.insert(places, S("Usage: /tpp ")) return true, table.concat(places, "\n") -- Teleport player to the specified place (taken from shivajiva101's POI mod, thanks!). @@ -426,9 +536,15 @@ if tp.enable_tpp_command then pos = {x = tp.available_places[param].x, y = tp.available_places[param].y, z = tp.available_places[param].z} tp.tpp_teleport_player(player) minetest.chat_send_player(player, S("Teleporting to @1.", param)) + if minetest.get_modpath("chat2") then + chat2.send_message(minetest.get_player_by_name(player), S("Teleporting to @1.", param), 0xFFFFFF) + end -- Check if the place exists. elseif not tp.available_places[param] then minetest.chat_send_player(player, S("There is no place by that name. Keep in mind this is case-sensitive.")) + if minetest.get_modpath("chat2") then + chat2.send_message(minetest.get_player_by_name(player), S("There is no place by that name. Keep in mind this is case-sensitive."), 0xFFFFFF) + end return end end, diff --git a/mod.conf b/mod.conf index 811629e..0ed6a1d 100644 --- a/mod.conf +++ b/mod.conf @@ -1,3 +1,3 @@ name = tpr -optional_depends = areas, intllib +optional_depends = areas, intllib, beerchat, chat2 description = Allows players to send a request to other players to teleport to them, and do much more. From 23e3c917e6f52b1fe16d3f8e875583545e1ea7ae Mon Sep 17 00:00:00 2001 From: Panquesito7 <51391473+Panquesito7@users.noreply.github.com> Date: Wed, 7 Aug 2019 17:42:50 -0500 Subject: [PATCH 18/25] Tidied and tweaked README.md --- README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4db9e37..07a9420 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Teleport Request - -[The Pixel Shadow](https://minetest.tv/) Minetest game servers have switched from "teleport" to "teleport request" via the *teleport-request* mod. This mod makes it so players must send a request to another player in order to teleport to them. Before they will be allowed to do so, the player must accept the request. This prevents malicious users from teleporting to players' private areas without their permission. It also enhances the overall privacy of our services since if denied teleport, a player must instead travel to the area and "use the front door" so to speak... which might be a locked iron door. +A mod that allows players to send a teleport request. +**(See "How to use" below for more information.)** ## Privileges: Each command needs a privilege. These are the following privileges: @@ -22,20 +22,20 @@ These are the following commands available in-game: - **Description:** Requests permission to teleport to another player, where [playername] is their exact name. - **Required Privileges:** `interact, tp` - **Example Usage:** */tpr RobbieF* - requests permission from RobbieF to teleport to them. -- **Notes:** Usernames are case-sensitive. If you have "tp_admin" privilege, you will immediately teleport to the specificed player. +- **Notes:** Usernames are case-sensitive. If you have "tp_admin" privilege, you will immediately teleport to the specificed player (does not apply if `enable_immediate_teleport` setting is disabled, enabled by default). ``` /tphr [playername] ``` - **Name:** Teleport Here Request - **Description:** Request permission to teleport another player to you. - **Required Privileges:** `interact, tp` - **Example Usage:** /tphr RobbieF - requests RobbieF to teleport to you. -- **Notes:** Usernames are case-sensitive. If you have "tp_admin" privilege, RobbieF will teleport to you immediately. +- **Notes:** Usernames are case-sensitive. If you have "tp_admin" privilege, RobbieF will teleport to you immediately (does not apply if `enable_immediate_teleport` setting is disabled, enabled by default). ``` /tpc [x,y,z] ``` - **Name:** Teleport to Coordinates - **Description:** Teleport to coordinates. - **Required Privileges:** `interact, tp_tpc, tp` -- **Notes:** Honors area protection: if the area is protected, it must be owned by you in order to teleport to it, or you must have "areas" privilege in order to teleport to those coordinates (this does not apply if "areas" mod is not detected). +- **Notes:** Honors area protection: if the area is protected, it must be owned by you in order to teleport to it, or you must have "areas" privilege in order to teleport to those coordinates (this works only when [areas](https://github.com/minetest-mods/areas) is installed). ``` /tpj [axis] [distance] ``` - **Name:** Teleport Jump @@ -106,3 +106,5 @@ https://wiki.minetest.net/Installing_Mods - Create a better sound effect for teleport and apply it to all teleport methods (not just /tpc) - Rewrite to place all chat commands into one single command much like how /teleport works. - Make evade respect land: no teleporting inside land, but instead make sure player is standing on surface or in water. + +If you think something else should be added to this list, [submit an issue](https://github.com/ChaosWormz/teleport-request/issues/new). From 415fcdb7dccb6cc3014fba6bd85a5231f61d482a Mon Sep 17 00:00:00 2001 From: Panquesito7 <51391473+Panquesito7@users.noreply.github.com> Date: Wed, 7 Aug 2019 19:40:40 -0500 Subject: [PATCH 19/25] Create settingtypes.txt Players can now use "minetest.conf" or go to the Settings tab and configure it. --- settingtypes.txt | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 settingtypes.txt diff --git a/settingtypes.txt b/settingtypes.txt new file mode 100644 index 0000000..7a40d9d --- /dev/null +++ b/settingtypes.txt @@ -0,0 +1,8 @@ +# Timeout delay (default is 60) +tp.timeout_delay (Timeout delay after a request is sent) int 60 + +# Enables immediate teleport to players for those who have tp_admin privilege (enabled by default) +tp.enable_immediate_teleport (Immediate teleport for those with tp_admin privilege) bool true + +# Enables Teleport To Place command (disabled by default) +tp.enable_tpp_command (Enable Teleport To Place command) bool false From 91ffafc98ee4ee04394dc15d3ec28eafc241a4f9 Mon Sep 17 00:00:00 2001 From: Panquesito7 <51391473+Panquesito7@users.noreply.github.com> Date: Wed, 7 Aug 2019 19:44:03 -0500 Subject: [PATCH 20/25] Update config.lua --- config.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config.lua b/config.lua index dd76363..d240a8a 100644 --- a/config.lua +++ b/config.lua @@ -24,11 +24,11 @@ local MP = minetest.get_modpath(minetest.get_current_modname()) local S, NS = dofile(MP.."/intllib.lua") -- Timeout delay and mod version. -tp.timeout_delay = 60 +tp.timeout_delay = tonumber(minetest.settings:get("tp.timeout_delay")) or 60 tp.version = "1.5" --- Enable teleporting immediately to the player with "tp_admin" privilege. -tp.enable_immediate_teleport = true +-- Enable teleporting immediately to the specified player for those with "tp_admin" privilege. +tp.enable_immediate_teleport = minetest.settings:get_bool("tp.enable_immediate_teleport") local chatmsg, source, target, name2, target_coords, pos @@ -40,7 +40,7 @@ tp.available_places = { } -- Enable tpp command -tp.enable_tpp_command = false +tp.enable_tpp_command = minetest.settings:get_bool("tp.enable_tpp_command") -- Register privileges minetest.register_privilege("tp", { From 32d9aebd38c4aa7444a539dea4fb4a8f385cf9e8 Mon Sep 17 00:00:00 2001 From: Panquesito7 <51391473+Panquesito7@users.noreply.github.com> Date: Wed, 7 Aug 2019 19:51:36 -0500 Subject: [PATCH 21/25] Make README.md better --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 07a9420..e6421c7 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,20 @@ If you know how to fix an issue, or want something to be added, consider opening All those who contributed to the original mod (please see `init.lua`). +## Configuring the mod +Open your `minetest.conf` located in your Minetest directory. +Set the values of the settings you'd like to. + +Available options are: +``` +tp.timeout_delay = 60 +tp.enable_immediate_teleport = true +tp_enable_tpp_command = false +``` +Those values are the default values of the mod. +You can also go to your Minetest, Settings tab, All settings, Mods, and you'll find `tpr` there. +Or another way to do it, is changing the values in `settingstypes.txt`. + ## Installation - Unzip the archive, rename the folder to tpr and place it in ..minetest/mods/ From b318a5e1afc0eb9da844fc92a8dfcefd6dc8dc55 Mon Sep 17 00:00:00 2001 From: Panquesito7 <51391473+Panquesito7@users.noreply.github.com> Date: Wed, 7 Aug 2019 20:01:53 -0500 Subject: [PATCH 22/25] Remove useless specified lines... ...and add some missing translations. --- locale/template.pot | 78 ++++++++++++++++++++++++--------------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/locale/template.pot b/locale/template.pot index 90d1bf8..349e9c4 100644 --- a/locale/template.pot +++ b/locale/template.pot @@ -16,35 +16,39 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: init.lua:19 +#: config.lua msgid "Let players teleport to other players (request will be sent)" msgstr "" -#: init.lua:43 +#: config.lua msgid "Gives full admin-access to a player." msgstr "" -#: init.lua:50 +#: config.lua msgid "Allow player to teleport to coordinates (if allowed by area protection)" msgstr "" -#: init.lua:105 -msgid "You are teleporting to @1." +#: init.lua +msgid "You are not allowed to send requests because you're muted." msgstr "" -#: init.lua:111 +#: init.lua msgid "Usage: /tpr " msgstr "" -#: init.lua:116 +#: init.lua msgid "There is no player by that name. Keep in mind this is case sensitive, and the player must be online" msgstr "" -#: init.lua:120 +#: init.lua +msgid "You are teleporting to @1." +msgstr "" + +#: init.lua msgid "@1 is requesting to teleport to you. /tpy to accept" msgstr "" -#: init.lua:121 +#: init.lua msgid "Teleport request sent! It will timeout in @1 seconds" msgstr "" @@ -52,39 +56,39 @@ msgstr "" msgid "Request timed-out." msgstr "" -#: init.lua:147 +#: init.lua msgid "@1 is teleporting to you." msgstr "" -#: init.lua:152 +#: init.lua msgid "Usage: /tphr " msgstr "" -#: init.lua:160 +#: init.lua msgid "@1 is requesting that you teleport to them. /tpy to accept; /tpn to deny" msgstr "" -#: init.lua:187 +#: init.lua msgid "Usage: /tpc " msgstr "" -#: init.lua:194 +#: init.lua msgid "You cannot teleport to a location outside the map!" msgstr "" -#: init.lua:204 +#: init.lua msgid "Teleporting to: @1, @2, @3" msgstr "" -#: init.lua:215 +#: init.lua msgid "Error: @1 is protected by @2." msgstr "" -#: init.lua:240 +#: init.lua msgid "Error: You do not have permission to teleport to those coordinates." msgstr "" -#: init.lua:258 +#: init.lua msgid "Teleport request denied." msgstr "" @@ -96,7 +100,7 @@ msgstr "" msgid "Usage: /tpn allows you to deny teleport requests sent to you by other players." msgstr "" -#: init.lua:278 +#: init.lua msgid "Usage: /tpy allows you to accept teleport requests sent to you by other players" msgstr "" @@ -104,23 +108,23 @@ msgstr "" msgid "@1 doesn't exist, or just disconnected/left (by timeout)." msgstr "" -#: init.lua:317 +#: init.lua msgid "Request Accepted!" msgstr "" -#: init.lua:330 +#: init.lua msgid "Usage: " msgstr "" -#: init.lua:353 -msgid "Not a valid axis. Valid options are X, Y or Z" -msgstr "" - #: init.lua msgid "Not a number!" msgstr "" -#: init.lua:367 +#: init.lua +msgid "Not a valid axis. Valid options are X, Y or Z" +msgstr "" + +#: init.lua msgid "EVADE!" msgstr "" @@ -148,46 +152,46 @@ msgstr "" msgid "There is no place by that name. Keep in mind this is case-sensitive." msgstr "" -#: init.lua:394 +#: init.lua msgid "Request teleport to another player." msgstr "" -#: init.lua:395 +#: init.lua msgid " | leave playername empty to see help message" msgstr "" -#: init.lua:401 +#: init.lua msgid "Request player to teleport to you" msgstr "" -#: init.lua:408 +#: init.lua msgid "Teleport to coordinates" msgstr "" -#: init.lua:409 +#: init.lua msgid " | leave coordinates empty to see help message" msgstr "" -#: init.lua:415 +#: init.lua msgid "Teleport to relative position" msgstr "" -#: init.lua:416 +#: init.lua msgid " | leave empty to see help message" msgstr "" -#: init.lua:422 +#: init.lua msgid "Evade Enemy" msgstr "" -#: init.lua:428 +#: init.lua msgid "Accept teleport requests from another player" msgstr "" -#: init.lua:434 +#: init.lua msgid "Deny teleport requests from another player" msgstr "" -#: init.lua:441 +#: init.lua msgid "[Teleport Request] TPS Teleport v@1 Loaded!" msgstr "" From 981b2d9abcc45def051fceb9878b212f71831e66 Mon Sep 17 00:00:00 2001 From: Panquesito7 <51391473+Panquesito7@users.noreply.github.com> Date: Wed, 7 Aug 2019 20:06:37 -0500 Subject: [PATCH 23/25] Update es.po --- locale/es.po | 74 +++++++++++++++++++++++++++------------------------- 1 file changed, 39 insertions(+), 35 deletions(-) diff --git a/locale/es.po b/locale/es.po index 183b267..e3a0a17 100644 --- a/locale/es.po +++ b/locale/es.po @@ -16,35 +16,39 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: init.lua:19 +#: config.lua msgid "Let players teleport to other players (request will be sent)" msgstr "Permite que los jugadores se teletransporten a otros jugadores (se enviará una solicitud)" -#: init.lua:43 +#: config.lua msgid "Gives full admin-access to a player." msgstr "Da acceso total de administrador a un jugador." -#: init.lua:50 +#: config.lua msgid "Allow player to teleport to coordinates (if allowed by area protection)" msgstr "Permite a los jugadores teletransportarse a las coordenadas especificadas (si esta permitido por la protección de la área)" -#: init.lua:105 -msgid "You are teleporting to @1." -msgstr "Te estas teletransportando a @1." +#: init.lua +msgid "You are not allowed to send requests because you're muted." +msgstr "No tienes permiso para mandar solicitudes de teletransporte porque estás silenciado." -#: init.lua:111 +#: init.lua msgid "Usage: /tpr " msgstr "Uso: /tpr " -#: init.lua:116 +#: init.lua msgid "There is no player by that name. Keep in mind this is case-sensitive, and the player must be online" msgstr "No hay jugador con ese nombre. Tenga en cuenta que esto es caso-sensitivo, y el jugador debe de estar én linea." -#: init.lua:120 +#: init.lua +msgid "You are teleporting to @1." +msgstr "Te estas teletransportando a @1." + +#: init.lua msgid "@1 is requesting to teleport to you. /tpy to accept" msgstr "@1 esta pidiendo teletransportarse a ti. /tpy para aceptar" -#: init.lua:121 +#: init.lua msgid "Teleport request sent! It will timeout in @1 seconds" msgstr "¡Solicitud enviada! Se agotara en @1 segundos" @@ -52,39 +56,39 @@ msgstr "¡Solicitud enviada! Se agotara en @1 segundos" msgid "Request timed-out." msgstr "La solicitud enviada expiró." -#: init.lua:147 +#: init.lua msgid "@1 is teleporting to you." msgstr "@1 se esta teletransportando a ti." -#: init.lua:152 +#: init.lua msgid "Usage: /tphr " msgstr "Uso: /tphr " -#: init.lua:160 +#: init.lua msgid "@1 is requesting that you teleport to them. /tpy to accept; /tpn to deny" msgstr "@1 esta pidiendo que tu te teletransportes a el/ella. /tpy para aceptar, /tpn para denegar" -#: init.lua:187 +#: init.lua msgid "Usage: /tpc " msgstr "Uso: /tpc " -#: init.lua:194 +#: init.lua msgid "You cannot teleport to a location outside the map!" msgstr "¡No puedes teletransportarte afuera del mundo!" -#: init.lua:204 +#: init.lua msgid "Teleporting to: @1, @2, @3" msgstr "Teletransportandose a: @1, @2, @3" -#: init.lua:215 +#: init.lua msgid "Error: @1 is protected by @2." msgstr "Error: @1 esta protegido por @2." -#: init.lua:240 +#: init.lua msgid "Error: You do not have permission to teleport to those coordinates." msgstr "Error: No tienes permiso para teletransportarte a esas coordenadas." -#: init.lua:258 +#: init.lua msgid "Teleport request denied." msgstr "Solicitud denegada." @@ -96,7 +100,7 @@ msgstr "Tú denegaste la solicitud de teletransporte que @1 te mando." msgid "Usage: /tpn allows you to deny teleport requests sent to you by other players." msgstr "Uso: /tpn te permite denegar solicitudes enviadas para ti de otros jugadores." -#: init.lua:278 +#: init.lua msgid "Usage: /tpy allows you to accept teleport requests sent to you by other players" msgstr "Uso: /tpy te permite aceptar solicitudes enviadas para ti de otros jugadores" @@ -104,15 +108,15 @@ msgstr "Uso: /tpy te permite aceptar solicitudes enviadas para ti de otros jugad msgid "@1 doesn't exist, or just disconnected/left (by timeout)." msgstr "@1 no existe, o se desconecto/fue." -#: init.lua:317 +#: init.lua msgid "Request Accepted!" msgstr "¡Solicitud aceptada!" -#: init.lua:330 +#: init.lua msgid "Usage: " msgstr "Uso: " -#: init.lua:353 +#: init.lua msgid "Not a valid axis. Valid options are X, Y or Z" msgstr "Eje invalido. Opciones validas son x, y, o z" @@ -120,39 +124,39 @@ msgstr "Eje invalido. Opciones validas son x, y, o z" msgid "Not a number!" msgstr "¡No un número!" -#: init.lua:367 +#: init.lua msgid "EVADE!" msgstr "¡EVADIR!" -#: init.lua:394 +#: init.lua msgid "Request teleport to another player." msgstr "Enviar solicitud para teletransportarte a otro jugador." -#: init.lua:395 +#: init.lua msgid " | leave playername empty to see help message" msgstr " | Deje el nombre del jugador vacío para ver el mensaje de ayuda" -#: init.lua:401 +#: init.lua msgid "Request player to teleport to you" msgstr "Solicita al jugador que se teletransporte a ti." -#: init.lua:408 +#: init.lua msgid "Teleport to coordinates" msgstr "Teletransportarse a las coordenadas especificadas." -#: init.lua:409 +#: init.lua msgid " | leave coordinates empty to see help message" msgstr " | Deje las coordenadas vacías para ver el mensaje de ayuda" -#: init.lua:415 +#: init.lua msgid "Teleport to relative position" msgstr "Teletransportarse a la posición relativa." -#: init.lua:416 +#: init.lua msgid " | leave empty to see help message" msgstr " | Deje vacío para ver el mensaje de ayuda" -#: init.lua:422 +#: init.lua msgid "Evade Enemy" msgstr "Evadir enemigo." @@ -180,14 +184,14 @@ msgstr "Teletransportandose a @1." msgid "There is no place by that name. Keep in mind this is case-sensitive." msgstr "No hay lugar con ese nombre. Tenga en cuenta que esto es caso-sensitivo." -#: init.lua:428 +#: init.lua msgid "Accept teleport requests from another player" msgstr "Aceptar solicitudes de otro jugador." -#: init.lua:434 +#: init.lua msgid "Deny teleport requests from another player" msgstr "Denegar solicitudos de otro jugador." -#: init.lua:441 +#: init.lua msgid "[Teleport Request] TPS Teleport v@1 Loaded!" msgstr "[TPS] Solicitud de teletransporte v@1 Cargado!" From 4c595cfc49d886566cf065742201aa6bcfe7ef46 Mon Sep 17 00:00:00 2001 From: Panquesito7 <51391473+Panquesito7@users.noreply.github.com> Date: Wed, 7 Aug 2019 20:10:47 -0500 Subject: [PATCH 24/25] Update es.po --- locale/es.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/es.po b/locale/es.po index e3a0a17..ba399cc 100644 --- a/locale/es.po +++ b/locale/es.po @@ -116,14 +116,14 @@ msgstr "¡Solicitud aceptada!" msgid "Usage: " msgstr "Uso: " -#: init.lua -msgid "Not a valid axis. Valid options are X, Y or Z" -msgstr "Eje invalido. Opciones validas son x, y, o z" - #: init.lua msgid "Not a number!" msgstr "¡No un número!" +#: init.lua +msgid "Not a valid axis. Valid options are X, Y or Z" +msgstr "Eje invalido. Opciones validas son x, y, o z" + #: init.lua msgid "EVADE!" msgstr "¡EVADIR!" From 413ffb43d75f8594c808ab3278aa5dc3f1c4b9bb Mon Sep 17 00:00:00 2001 From: Panquesito7 <51391473+Panquesito7@users.noreply.github.com> Date: Wed, 7 Aug 2019 22:56:30 -0500 Subject: [PATCH 25/25] Update README.md --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e6421c7..f280925 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,12 @@ Players can also teleport to coordinates, however, if the area is protected, the ## How to use: Each command does a function. "**Example Usage**" is an example of how to use the command. -Note there must be 2 players in order to make the commands to work: a player must send a request to another player (**see https://wiki.minetest.net/Server or see https://wiki.minetest.net/Setting_up_a_server for more information**). +Note there must be 2 players in order to make the commands to work: a player must send a request to another player (**see https://wiki.minetest.net/Server or see https://wiki.minetest.net/Setting_up_a_server for more information**). +There are two methods of sending a request: +1. A request which teleports you to the specified player (command `/tpr `). +2. A request which teleports the specified player to you (command `/tphr `). + +To accept a request some sent you, you must use `/tpy`. These are the following commands available in-game: ``` /tpr [playername] ``` @@ -82,6 +87,9 @@ If you know how to fix an issue, or want something to be added, consider opening - [ChaosWormz](https://github.com/ChaosWormz) - [Panquesito7](https://github.com/Panquesito7) - [coil0](https://github.com/coil0) +- [Zeno-](https://github.com/Zeno-) +- [indriApollo](https://github.com/indriApollo) +- [Billy-S](https://github.com/Billy-S) - Traxie21, the original creator of this mod (however, he/she does not have a GitHub account anymore). All those who contributed to the original mod (please see `init.lua`).