forked from mtcontrib/report
Merge branch 'github'
This commit is contained in:
commit
a171a1ce2c
15
init.lua
15
init.lua
@ -8,7 +8,6 @@ local function get_modo_list()
|
|||||||
if store then
|
if store then
|
||||||
return minetest.deserialize(store) or {}
|
return minetest.deserialize(store) or {}
|
||||||
end
|
end
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -22,21 +21,19 @@ local function is_known_modo(name)
|
|||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_on_joinplayer(function(player)
|
minetest.register_on_joinplayer(function(player)
|
||||||
-- Obtenir les privs du player
|
-- Get player privs
|
||||||
local player_name = player:get_player_name()
|
local player_name = player:get_player_name()
|
||||||
local is_modo = minetest.check_player_privs(player_name, {kick = true, ban = true})
|
local is_modo = minetest.check_player_privs(player_name, {kick = true, ban = true})
|
||||||
|
|
||||||
-- Le joueur est-il un modérateur connu ?
|
-- Is player a known moderator?
|
||||||
local known = is_known_modo(player_name)
|
local known = is_known_modo(player_name)
|
||||||
|
|
||||||
-- Ajouter ou supprimer le joueur de la liste des modérateurs
|
-- Add or remove the player to/from moderators list
|
||||||
if not known and is_modo then
|
if not known and is_modo then
|
||||||
-- Ajouter nom du player dans liste modos
|
|
||||||
local modos = get_modo_list()
|
local modos = get_modo_list()
|
||||||
table.insert(modos, player_name)
|
table.insert(modos, player_name)
|
||||||
storage:set_string("report", minetest.serialize(modos))
|
storage:set_string("report", minetest.serialize(modos))
|
||||||
elseif known and not is_modo then
|
elseif known and not is_modo then
|
||||||
-- Supprimer nom du player de la liste modos
|
|
||||||
local modos = get_modo_list()
|
local modos = get_modo_list()
|
||||||
for i, modo in ipairs(modos) do
|
for i, modo in ipairs(modos) do
|
||||||
if modo == player_name then
|
if modo == player_name then
|
||||||
@ -49,14 +46,14 @@ minetest.register_on_joinplayer(function(player)
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
minetest.register_chatcommand("report", {
|
minetest.register_chatcommand("report", {
|
||||||
description = S("Report: @1 to see moderators list. @2 is the message to report to moderators.", "'modos'", "'msg'"),
|
description = S("Send a report to moderators. '/report modos_list' to get the list of moderators."),
|
||||||
params = "modos|msg",
|
params = "<msg>",
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
param = param:trim()
|
param = param:trim()
|
||||||
if param == "" then
|
if param == "" then
|
||||||
return false, S("Please write a message for the report. If it's about one or several players in particular, please give their name.")
|
return false, S("Please write a message for the report. If it's about one or several players in particular, please give their name.")
|
||||||
end
|
end
|
||||||
if param == "modos" then
|
if param == "modos_list" then
|
||||||
return true, S("Moderators list: @1", table.concat(get_modo_list(), ", "))
|
return true, S("Moderators list: @1", table.concat(get_modo_list(), ", "))
|
||||||
end
|
end
|
||||||
local _, count = string.gsub(param, " ", "")
|
local _, count = string.gsub(param, " ", "")
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# textdomain:report
|
# textdomain:report
|
||||||
Report: @1 to see moderators list. @2 is the message to report to moderators.=Report: @1 pour voir la liste des modérateurs. @2 est le message à rapporter aux modérateurs.
|
Send a report to moderators. '/report modos_list' to get the list of moderators.=Envoie un rapport aux modérateurs. '/report modos_list' pour obtenir la liste des modérateurs.
|
||||||
Please write a message for the report. If it's about one or several players in particular, please give their name.=Veuillez écrire un message pour le rapport. Si il s'agit d'un ou plusieurs joueurs en particulier, veuillez aussi indiquer leur nom.
|
Please write a message for the report. If it's about one or several players in particular, please give their name.=Veuillez écrire un message pour le rapport. Si il s'agit d'un ou plusieurs joueurs en particulier, veuillez aussi indiquer leur nom.
|
||||||
Moderators list: @1=Liste de modérateurs : @1
|
Moderators list: @1=Liste de modérateurs : @1
|
||||||
If you are reporting a player's attitude, you should also say why. (Ex: insult, sabotage)=Si vous rapportez l'attitude d'un joueur, vous devriez aussi dire quelle en est la raison. (Ex: insulte, sabotage)
|
If you are reporting a player's attitude, you should also say why. (Ex: insult, sabotage)=Si vous rapportez l'attitude d'un joueur, vous devriez aussi dire quelle en est la raison. (Ex: insulte, sabotage)
|
||||||
@ -7,4 +7,4 @@ If you are reporting a player's attitude, you should also say why. (Ex: insult,
|
|||||||
Report: @1 (online moderator(s): @2)=Rapport : @1 (moderateur(s) connecté(s) : @2)
|
Report: @1 (online moderator(s): @2)=Rapport : @1 (moderateur(s) connecté(s) : @2)
|
||||||
Reported. Online moderator(s): @1=Rapporté. Moderateur(s) connecté(s) : @1
|
Reported. Online moderator(s): @1=Rapporté. Moderateur(s) connecté(s) : @1
|
||||||
Report: @1 (no online moderator)=Rapport : @1 (pas de modérateur connecté)
|
Report: @1 (no online moderator)=Rapport : @1 (pas de modérateur connecté)
|
||||||
Reported. We will get back to you.=Rapporté. On reviendra vers vous.
|
Reported. We will get back to you.=Rapporté. On reviendra vers vous.
|
||||||
|
10
locale/template.txt
Normal file
10
locale/template.txt
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# textdomain:report
|
||||||
|
Send a report to moderators. '/report modos_list' to get the list of moderators.=
|
||||||
|
Please write a message for the report. If it's about one or several players in particular, please give their name.=
|
||||||
|
Moderators list: @1=
|
||||||
|
If you are reporting a player's attitude, you should also say why. (Ex: insult, sabotage)=
|
||||||
|
-!- @1 has reported: @2=
|
||||||
|
Report: @1 (online moderator(s): @2)=
|
||||||
|
Reported. Online moderator(s): @1=
|
||||||
|
Report: @1 (no online moderator)=
|
||||||
|
Reported. We will get back to you.=
|
Loading…
Reference in New Issue
Block a user