2019-07-09 03:23:57 +02:00
|
|
|
--[[
|
2019-12-02 02:11:07 +01:00
|
|
|
Allows players to request from another player to be teleported to them, and do much more.
|
2021-01-12 21:24:17 +01:00
|
|
|
Copyright (C) 2014-2021 ChaosWormz and contributors
|
2019-07-18 01:04:52 +02: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
|
|
|
|
|
|
|
|
----------------------------------------------------------------------------
|
|
|
|
|
2019-07-09 03:23:57 +02:00
|
|
|
Originally made by Traxie21 and released with the WTFPL license.
|
2019-07-18 01:04:52 +02:00
|
|
|
Forum link: https://forum.minetest.net/viewtopic.php?id=4457
|
|
|
|
|
|
|
|
Updates by Zeno, Panquesito7 and ChaosWormz.
|
2020-01-21 22:31:11 +01:00
|
|
|
License: LGPLv2.1+ for code, CC BY-SA 4.0 for sounds.
|
2019-07-09 03:23:57 +02:00
|
|
|
--]]
|
2014-07-26 08:20:32 +02:00
|
|
|
|
2019-07-15 20:52:31 +02:00
|
|
|
-- Load support for intllib.
|
|
|
|
local MP = minetest.get_modpath(minetest.get_current_modname())
|
2020-01-16 21:10:15 +01:00
|
|
|
local S = dofile(MP.."/intllib.lua")
|
2019-07-15 20:52:31 +02:00
|
|
|
|
2020-01-02 03:00:50 +01:00
|
|
|
tp = {
|
2020-01-16 21:10:15 +01:00
|
|
|
intllib = S,
|
|
|
|
tpr_list = {},
|
2020-03-04 17:41:01 +01:00
|
|
|
tphr_list = {},
|
2020-04-07 17:48:22 +02:00
|
|
|
tpc_list = {},
|
2020-03-04 17:41:01 +01:00
|
|
|
tpn_list = {}
|
2020-01-02 03:00:50 +01:00
|
|
|
}
|
|
|
|
|
2019-07-29 01:03:32 +02:00
|
|
|
-- Clear requests when the player leaves
|
|
|
|
minetest.register_on_leaveplayer(function(name)
|
2019-08-06 06:04:38 +02:00
|
|
|
if tp.tpr_list[name] then
|
|
|
|
tp.tpr_list[name] = nil
|
2019-07-29 01:03:32 +02:00
|
|
|
return
|
|
|
|
end
|
2020-01-16 21:10:15 +01:00
|
|
|
|
2019-08-06 06:04:38 +02:00
|
|
|
if tp.tphr_list[name] then
|
|
|
|
tp.tphr_list[name] = nil
|
2019-07-29 01:03:32 +02:00
|
|
|
return
|
|
|
|
end
|
2020-03-04 17:41:01 +01:00
|
|
|
|
2020-04-07 17:48:22 +02:00
|
|
|
-- Area requests
|
|
|
|
if tp.tpc_list[name] then
|
|
|
|
tp.tpc_list[name] = nil
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
2020-03-04 17:41:01 +01:00
|
|
|
if tp.tpn_list[name] then
|
|
|
|
tp.tpn_list[name] = nil
|
|
|
|
return
|
|
|
|
end
|
2019-07-29 01:03:32 +02:00
|
|
|
end)
|
|
|
|
|
2020-01-10 04:13:59 +01:00
|
|
|
dofile(MP.."/privileges.lua")
|
|
|
|
dofile(MP.."/config.lua")
|
|
|
|
dofile(MP.."/functions.lua")
|
|
|
|
dofile(MP.."/commands.lua")
|
2014-07-30 04:30:37 +02:00
|
|
|
|
2019-07-09 03:23:57 +02:00
|
|
|
-- Log
|
2019-07-15 20:52:31 +02:00
|
|
|
if minetest.settings:get_bool("log_mods") then
|
2019-08-06 06:04:38 +02:00
|
|
|
minetest.log("action", S("[Teleport Request] TPS Teleport v@1 Loaded!", tp.version))
|
2019-07-15 20:52:31 +02:00
|
|
|
end
|