2019-07-08 20:23:57 -05:00
|
|
|
--[[
|
2019-12-01 19:11:07 -06:00
|
|
|
Allows players to request from another player to be teleported to them, and do much more.
|
2022-03-22 09:42:22 -06:00
|
|
|
Copyright (C) 2014-2022 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
|
|
|
|
|
|
|
|
----------------------------------------------------------------------------
|
|
|
|
|
2019-07-08 20:23:57 -05:00
|
|
|
Originally made by Traxie21 and released with the WTFPL license.
|
2019-07-17 18:04:52 -05:00
|
|
|
Forum link: https://forum.minetest.net/viewtopic.php?id=4457
|
|
|
|
|
|
|
|
Updates by Zeno, Panquesito7 and ChaosWormz.
|
2020-01-21 15:31:11 -06:00
|
|
|
License: LGPLv2.1+ for code, CC BY-SA 4.0 for sounds.
|
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,
|
2020-01-16 14:10:15 -06:00
|
|
|
tpr_list = {},
|
2020-03-04 10:41:01 -06:00
|
|
|
tphr_list = {},
|
2020-04-07 10:48:22 -05:00
|
|
|
tpc_list = {},
|
2020-03-04 10:41:01 -06:00
|
|
|
tpn_list = {}
|
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
|
2019-08-05 23:04:38 -05:00
|
|
|
minetest.log("action", S("[Teleport Request] TPS Teleport v@1 Loaded!", tp.version))
|
2019-07-15 13:52:31 -05:00
|
|
|
end
|