2019-07-08 20:23:57 -05:00
|
|
|
--[[
|
2024-01-16 13:10:50 -06:00
|
|
|
Allows players to request from another player to be teleported to them.
|
|
|
|
Includes many more teleporting features. Built for Minetest.
|
|
|
|
|
|
|
|
Copyright (C) 2014-2024 ChaosWormz and contributors
|
2019-07-17 18:04:52 -05:00
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2.1 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Lesser General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
|
|
License along with this library; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
|
|
|
|
USA
|
|
|
|
|
|
|
|
----------------------------------------------------------------------------
|
|
|
|
|
2024-01-16 13:10:50 -06:00
|
|
|
Originally made by Traxie21 and released under the WTFPL license.
|
|
|
|
Forum link: https://forum.minetest.net/viewtopic.php?t=4457
|
2019-07-08 20:23:57 -05:00
|
|
|
--]]
|
2014-07-26 09:20:32 +03:00
|
|
|
|
2019-07-15 13:52:31 -05:00
|
|
|
local MP = minetest.get_modpath(minetest.get_current_modname())
|
2023-09-27 18:55:57 -06:00
|
|
|
local S = minetest.get_translator(minetest.get_current_modname())
|
2019-07-15 13:52:31 -05:00
|
|
|
|
2020-01-01 20:00:50 -06:00
|
|
|
tp = {
|
2023-09-27 18:55:57 -06:00
|
|
|
S = S,
|
2023-10-24 12:13:44 -06:00
|
|
|
tpr_list = { },
|
|
|
|
tphr_list = { },
|
|
|
|
tpc_list = { },
|
|
|
|
tpn_list = { },
|
|
|
|
tpf_update_time = { }
|
2020-01-01 20:00:50 -06:00
|
|
|
}
|
|
|
|
|
2019-07-28 18:03:32 -05:00
|
|
|
-- Clear requests when the player leaves
|
|
|
|
minetest.register_on_leaveplayer(function(name)
|
2019-08-05 23:04:38 -05:00
|
|
|
if tp.tpr_list[name] then
|
|
|
|
tp.tpr_list[name] = nil
|
2019-07-28 18:03:32 -05:00
|
|
|
return
|
|
|
|
end
|
2020-01-16 14:10:15 -06:00
|
|
|
|
2019-08-05 23:04:38 -05:00
|
|
|
if tp.tphr_list[name] then
|
|
|
|
tp.tphr_list[name] = nil
|
2019-07-28 18:03:32 -05:00
|
|
|
return
|
|
|
|
end
|
2020-03-04 10:41:01 -06:00
|
|
|
|
2020-04-07 10:48:22 -05:00
|
|
|
-- Area requests
|
|
|
|
if tp.tpc_list[name] then
|
|
|
|
tp.tpc_list[name] = nil
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
2020-03-04 10:41:01 -06:00
|
|
|
if tp.tpn_list[name] then
|
|
|
|
tp.tpn_list[name] = nil
|
|
|
|
return
|
|
|
|
end
|
2019-07-28 18:03:32 -05:00
|
|
|
end)
|
|
|
|
|
2023-09-27 18:55:57 -06:00
|
|
|
dofile(MP .. "/privileges.lua")
|
|
|
|
dofile(MP .. "/config.lua")
|
|
|
|
dofile(MP .. "/functions.lua")
|
|
|
|
dofile(MP .. "/commands.lua")
|
2014-07-30 12:30:37 +10:00
|
|
|
|
2019-07-08 20:23:57 -05:00
|
|
|
-- Log
|
2019-07-15 13:52:31 -05:00
|
|
|
if minetest.settings:get_bool("log_mods") then
|
2024-01-16 13:10:50 -06:00
|
|
|
minetest.log("action", "[MOD] Teleport Request v" .. tp.version .. " loaded!")
|
2019-07-15 13:52:31 -05:00
|
|
|
end
|