<commit_before>-- Fails mod By Mg <mg[dot]minetest[at]gmail[dot]com>
--[[

     /-----\-\
    /  /--] \-\
    |  |-]  |-|
    \  |    /-/
     \-----/-/

    "Congratulation, you win a failpoint."

License GPLv2

]]--

-- The FailPoint mod by Mg.
-- The principal purpose of this mod is to allow FailPoints give, and the storage of them

data = {}

data.fp_file = minetest.get_worldpath().."/failpoints"
data.failpoints = {}
data.fp_version = 0.2

-- fp_create priv to create failpoints
minetest.register_privilege("fp_create","Is able to create FailPoints and give them to anybody else")

-- Check configuration fields

data.PUB_MSG = false
data.STRICT_PLAYER_CHECK = true

if minetest.setting_getbool("fp_pubmsg") ~= nil then
	data.PUB_MSG = minetest.setting_getbool("fp_pubmsg")
end
if minetest.setting_getbool("fp_strict_checking") ~= nil then
	data.STRICT_PLAYER_CHECK = minetest.setting_getbool("fp_strict_checking")
end

-- Configuration application

data.send_func = function(name, msg) minetest.chat_send_player(name, msg) end

if data.PUB_MSG then
	data.send_func = function (name, msg)
		if irc then
			irc:say(msg)
		end
		minetest.chat_send_all(msg)
	end
end

data.is_player_available = minetest.get_player_by_name

if data.STRICT_PLAYER_CHECK == false then
	data.is_player_available = function (name)
		return (io.open(minetest.get_worldpath().."/players/"..name) ~= nil)
	end<commit_msg>Check whether or not irc is enable before looking for its object<commit_after>-- Fails mod By Mg <mg[dot]minetest[at]gmail[dot]com>
--[[

     /-----\-\
    /  /--] \-\
    |  |-]  |-|
    \  |    /-/
     \-----/-/

    "Congratulation, you win a failpoint."

License GPLv2

]]--

-- The FailPoint mod by Mg.
-- The principal purpose of this mod is to allow FailPoints give, and the storage of them

data = {}

data.fp_file = minetest.get_worldpath().."/failpoints"
data.failpoints = {}
data.fp_version = 0.2

-- fp_create priv to create failpoints
minetest.register_privilege("fp_create","Is able to create FailPoints and give them to anybody else")

-- Check configuration fields

data.PUB_MSG = false
data.STRICT_PLAYER_CHECK = true

if minetest.setting_getbool("fp_pubmsg") ~= nil then
	data.PUB_MSG = minetest.setting_getbool("fp_pubmsg")
end
if minetest.setting_getbool("fp_strict_checking") ~= nil then
	data.STRICT_PLAYER_CHECK = minetest.setting_getbool("fp_strict_checking")
end

-- Configuration application

data.send_func = function(name, msg) minetest.chat_send_player(name, msg) end

if data.PUB_MSG then
	data.send_func = function (name, msg)
		if minetest.get_modpath("irc") then
			irc:say(msg)
		end
		minetest.chat_send_all(msg)
	end
end

data.is_player_available = minetest.get_player_by_name

if data.STRICT_PLAYER_CHECK == false then
	data.is_player_available = function (name)
		return (io.open(minetest.get_worldpath().."/players/"..name) ~= nil)
	end
{'fraction_non_alphanumeric': 0.12955887460923932, 'fraction_numerical': 0.0020840569642236887, 'mean_word_length': 3.7446457990115323, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7417129', 'n_tokens_mistral': 1077, 'n_tokens_neox': 1037, 'n_words': 236}