Git Product home page Git Product logo

teleport-request's Introduction

Teleport Request

LuaCheck status ContentDB

Allows players to send a request to other players to teleport to them. Includes many more teleporting features.

Installation

  • Unzip the archive, rename the folder to tpr and place it in .. minetest/mods/

  • GNU/Linux: If you use a system-wide installation place it in ~/.minetest/mods/.

  • If you only want this to be used in a single world, place the folder in .. worldmods/ in your world directory.

For further information or help, see:
https://wiki.minetest.net/Installing_Mods

Privileges

Each command needs a privilege. These are the following privileges:

  • tp is required in order to use all commands.

  • tp_tpc is required in order to use /tpc.

  • tp_tpc is required in order to use /tpe.

  • tp_tpc is required in order to use /tpj.

  • interact is required to use all commands.

  • tp_admin gives more control to admins:

    • Admins can teleport to players even when they haven't decided to accept, or not.
    • Admins can teleport players to him/her, if the enable_immediate_teleport setting is enabled.
    • Admins can teleport to protected coordinates.

Players can also teleport to coordinates, however, if the area is protected, the teleport will be denied.

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.

There are two ways of sending a request:

  1. A request which teleports you to the specified player (command /tpr <player>).
  2. A request which teleports the specified player to you (command /tphr <player>).

To accept a request some sent you, you must use /tpy.
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
  • Example usage: /tpr RobbieF requests permission from RobbieF to teleport to them.
  • Notes: Usernames are case-sensitive. If you have the 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 the 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 the areas privilege in order to teleport to those coordinates.

/tpj [axis] [distance]

  • Name: Teleport Jump
  • Description: Teleport a specified distance along a single specified axis.
  • 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
  • Example usage: /tpe teleports you to a random number of random coordinates in an evasive pattern.

/tpy

  • Description: Accept a user's request to teleport to you or teleport you to them.
  • Required privileges: interact, tp

/tpn

  • Description: Deny a user's request to teleport to you or teleport you to them.
  • Required privileges: interact, tp

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 settingtypes.txt.

TODO

  • Add limitations to /tpc which only allow a user to teleport X number of blocks. Prevents users from teleporting to the edge of the world.
  • Assess value in changing all tpr-based chat commands to one global command such as /tp to reduce the chance of confusion between tps_admin and the original mod (and also make it so people don't have to remember so many commands).
  • 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.

License

See LICENSE.txt for full license information and AUTHORS.md for all the contributors.

teleport-request's People

Contributors

cat5tv avatar chaoswormz avatar coil0 avatar donbatman avatar indriapollo avatar krypticbit avatar luk3yx avatar nathansalapat avatar ogelgames avatar oversword avatar panquesito7 avatar tuedel avatar zeno- avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

teleport-request's Issues

Crash in init.lua

2020-01-05 14:41:17: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod '' in callback on_chat_message(): /data/world//worldmods/tpr/init.lua:146: attempt to index a nil value
2020-01-05 14:41:17: ERROR[Main]: stack traceback:
2020-01-05 14:41:17: ERROR[Main]: 	/data/world//worldmods/tpr/init.lua:146: in function 'func'
2020-01-05 14:41:17: ERROR[Main]: 	/usr/local/share/minetest/builtin/game/chat.lua:55: in function </usr/local/share/minetest/builtin/game/chat.lua:34>
2020-01-05 14:41:17: ERROR[Main]: 	/usr/local/share/minetest/builtin/game/register.lua:429: in function </usr/local/share/minetest/builtin/game/register.lua:413>

/tpc protection check uses player object

The tpc command sends the player object instead of player name when doing a protection check. The check is bypassed with priv tp_admin. This causes a crash if /tpc is used by a player with priv tp_tpc but not tp_admin.

change mod name

Could you change the mod's name to teleport_request ? The character "-" isn't allowed by minetest in mod names

Brazilian Portuguese translation

Hello good afternoon!

I developed the "pt.po" file for your mod with the Brazilian Portuguese translation.

How can I get you to add it to the mod repository?

Allow muting players

Related: #36.

Allow users to disallow other users to send requests to them.
If player1 mutes player2, then player2 cant send requests to player1 until they unmute player2.

Move to minetest-mods

It would be great to see this mod in minetest-mods.
IMHO, it would be much more maintained.

Users will be able to find this repository easier, too.

Crash: `player::get_player_name()` called on a nil player

Observed on EdenLost, which is running multicraft-2.0.0 (Not sure if server version is related). Appears to have happened when a player with multiple active teleport requests responds with /tpy and the tpr mod attempts to ask the player which request to accept.

ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'tpr' in callback on_chat_message(): /home/1hit/worlds/world/worldmods/tpr/functions.lua:204: attempt to call method 'get_player_name' (a nil value)
stack traceback:
        /home/1hit/worlds/world/worldmods/tpr/functions.lua:204: in function 'list_requests'
        /home/1hit/worlds/world/worldmods/tpr/functions.lua:816: in function 'func'
        /home/1hit/multicraft/bin/../builtin/game/chat.lua:74: in function </home/1hit/multicraft/bin/../builtin/game/chat.lua:48>
        /home/1hit/multicraft/bin/../builtin/game/register.lua:441: in function </home/1hit/multicraft/bin/../builtin/game/register.lua:425>

The server logs suggest the following relevant events occured:

  1. Player A and B are logged in.
  2. [T + 0] Player A issues /tpr B
  3. [T + 15] Player A issues /tphr B
  4. [T + 18] Crash.

I assume that during the crash that player B issued /tpy, but that was not logged.

Two incoming tpy crash

Two or more incoming TPR will crash when reciever types TPY.

2023-11-14 18:02:21: ACTION[Main]: Server: Shutting down 2023-11-14 18:02:22: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'tpr' in callback on_chat_message(): /home/mcbride/.minetest/mods/teleport-request/functions.lua:204: attempt to call method 'get_player_name' (a nil value) 2023-11-14 18:02:22: ERROR[Main]: stack traceback: 2023-11-14 18:02:22: ERROR[Main]: /home/mcbride/.minetest/mods/teleport-request/functions.lua:204: in function 'list_requests' 2023-11-14 18:02:22: ERROR[Main]: /home/mcbride/.minetest/mods/teleport-request/functions.lua:816: in function 'func' 2023-11-14 18:02:22: ERROR[Main]: /usr/local/share/minetest/builtin/game/chat.lua:79: in function </usr/local/share/minetest/builtin/game/chat.lua:52>

Do not show 60 seconds only on the timeout delay

Description

If player A sends a request to player B, and player B denies it, there will be a delay of 60 seconds (this can be customized and changed) before player A can send more requests to player B. However, when player A tries to send a request again, it will always show 60 seconds even if more seconds have passed.
This could confuse the player and potentially see it as a bug. We should show the current time left instead, which should be saved in an array for every specific player.

Will work on this soon. However, if anyone else wants to work on it, let me know here and I'll gladly let you work on it. ๐Ÿ™‚

Muted players (beerchat) using the tpr command

Hello, there is a beerchat mod, which allows you to mute some players. But people don't stop on that and some muted players are constantly using their /tpr command for fun.

I was wondering if this mod can check if Beerchat exists on the server and the player making this teleport request is not muted?

rename the mod

Minetest doesn't support mods with "-" in its name so i recommend changing the name of the mod to "teleport_request" instead of "teleport-request"
error

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.