various cleanups

This commit is contained in:
NatureFreshMilk 2020-01-13 07:26:50 +01:00
parent 6fff4cb0c4
commit e99f8e581e
6 changed files with 6 additions and 78 deletions

View File

@ -1,20 +0,0 @@
minetest.register_chatcommand("announce_join", {
description = "join message",
privs = {no_announce=true},
func = function(player_name)
minetest.chat_send_all("*** " .. player_name .. " joined the game.")
end
})
minetest.register_chatcommand("announce_leave", {
description = "leave message",
privs = {no_announce=true},
func = function(player_name)
minetest.chat_send_all("*** " .. player_name .. " left the game.")
end
})

View File

@ -1,21 +0,0 @@
-- /dump_pos
-- prints all players with their current position into the logs
-- best used for persistent lag which could be abm/position related (mesecons)
minetest.register_chatcommand("dump_pos", {
description = "Teleport you to spawn point.",
privs = { ban = true },
func = function(name, params)
minetest.log(
"warning",
"[dump_pos] dumping player positions, initiated by player: " ..
name .. " reason: " .. (params or "")
)
for _, player in ipairs(minetest.get_connected_players()) do
local pname = player:get_player_name()
local pos = player:get_pos()
minetest.log("warning", "[dump_pos] Position of " .. pname .. ": " .. minetest.pos_to_string(pos))
end
return true, "positions dumped to log!"
end
})

View File

@ -29,9 +29,6 @@ dofile(MP.."/fix_dead_on_login.lua")
-- /spawn command
dofile(MP.."/spawn.lua")
-- /dump_pos command
dofile(MP.."/dump_pos.lua")
-- custom privs
dofile(MP.."/privs.lua")
@ -89,9 +86,6 @@ dofile(MP.."/stats.lua")
-- join priv set/revoke
dofile(MP.."/join.lua")
-- no_announce priv
dofile(MP.."/join_announce.lua")
-- craft overrides
dofile(MP.."/crafts.lua")
@ -130,9 +124,6 @@ if minetest.get_modpath("spacecannon") then
dofile(MP.."/spacecannon.lua")
end
-- announce chat cmd's
dofile(MP.."/announce.lua")
-- recipe redefinitions
dofile(MP.."/recipes.lua")
@ -144,10 +135,11 @@ if minetest.get_modpath("player_monoids") then
dofile(MP.."/spawn_fast_walk.lua")
end
if minetest.settings:get_bool("enable_integration_test") then
dofile(MP.."/integration_test.lua")
end
-- custom powered stand from scifi_nodes
if minetest.get_modpath("scifi_nodes") then
dofile(MP.."/scifi_override.lua")
end
if minetest.settings:get_bool("enable_integration_test") then
dofile(MP.."/integration_test.lua")
end

View File

@ -1,17 +0,0 @@
local old_send_join_message = minetest.send_join_message
minetest.send_join_message = function(player_name)
if minetest.check_player_privs(player_name, { no_announce=true }) then
return
end
old_send_join_message(player_name)
end
local old_send_leave_message = minetest.send_leave_message
minetest.send_leave_message = function(player_name, timed_out)
if minetest.check_player_privs(player_name, { no_announce=true }) then
return
end
old_send_leave_message(player_name, timed_out)
end

View File

@ -45,12 +45,6 @@ minetest.register_privilege("fly_event", {
description = "can toggle global fly event"
})
-- no announcements for the player
minetest.register_privilege("no_announce", {
description = "player does not get announced",
give_to_singleplayer = false
})
-- jumpdrive
minetest.register_privilege("jumpdrive_land", {

View File

@ -16,6 +16,6 @@ local function teleport_to_spawn(name)
end
minetest.register_chatcommand("spawn", {
description = "Teleport you to spawn point.",
description = "Teleports you to the spawn point.",
func = teleport_to_spawn,
})