Skip to content

Commit

Permalink
fix indents, log dfkick in action log
Browse files Browse the repository at this point in the history
  • Loading branch information
BuckarooBanzay committed May 20, 2021
1 parent a474671 commit 68bdd5b
Showing 1 changed file with 19 additions and 20 deletions.
39 changes: 19 additions & 20 deletions df_detect.lua
Original file line number Diff line number Diff line change
Expand Up @@ -188,27 +188,26 @@ local df = {
local function dfver(s) for _,v in ipairs(df) do if s:find(v) then return v end end end

minetest.register_on_joinplayer(function(player)
local name = player:get_player_name()
local info = minetest.get_player_information(name)
local version = info.version_string
local name = player:get_player_name()
local info = minetest.get_player_information(name)
local version = info.version_string

if not version then
-- version not available
return
end
if not version then
-- version not available
return
end

local dfv = version:find("dragonfire") or dfver(version)
if dfv then
if has_beerchat then
beerchat.send_on_channel(
"DF-Detect",
beerchat.moderator_channel_name,
"Unsupported client detected: " .. dfv .. " player: " .. name
)
end
if minetest.settings:get_bool("beowulf.dfdetect.enable_kick", false) then
minetest.kick_player(name, "Unsupported client")
end
end
local dfv = version:find("dragonfire") or dfver(version)
if dfv then
local msg = "Unsupported client detected: " .. dfv .. " player: " .. name
minetest.log("action", "[beowulf] " .. msg)
if has_beerchat then
beerchat.send_on_channel("DF-Detect", beerchat.moderator_channel_name, msg)
end

if minetest.settings:get_bool("beowulf.dfdetect.enable_kick", false) then
minetest.kick_player(name, "Unsupported client")
end
end

end)

0 comments on commit 68bdd5b

Please sign in to comment.