mirror of
https://github.com/mt-mods/playerfactions.git
synced 2025-04-16 11:10:21 +02:00
Merge branch 'master' into updated_5.9.0
This commit is contained in:
commit
0a8276f105
5
init.lua
5
init.lua
@ -178,14 +178,17 @@ function factions.disband_faction(faction_name)
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function factions.hash_password(password)
|
function factions.hash_password(password)
|
||||||
return minetest.sha256(password)
|
return minetest.sha256(password)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function factions.valid_password(faction_name, password)
|
function factions.valid_password(faction_name, password)
|
||||||
if not facts[faction_name] or not password then
|
if not facts[faction_name] or not password then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
return factions.hash_password(password) == facts[faction_name].password256
|
return factions.hash_password(password) == facts[faction_name].password256
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -199,6 +202,7 @@ function factions.set_password(faction_name, password)
|
|||||||
if not (facts[faction_name] and 'string' == type(password)) then
|
if not (facts[faction_name] and 'string' == type(password)) then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
facts[faction_name].password256 = factions.hash_password(password)
|
facts[faction_name].password256 = factions.hash_password(password)
|
||||||
save_factions()
|
save_factions()
|
||||||
return true
|
return true
|
||||||
@ -287,6 +291,7 @@ function cc.list()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function cc.info(player_name, params)
|
function cc.info(player_name, params)
|
||||||
local faction_name = params[2]
|
local faction_name = params[2]
|
||||||
if not faction_name then
|
if not faction_name then
|
||||||
|
@ -34,7 +34,7 @@ Missing faction name.=Nom de faction manquant.
|
|||||||
Missing password.=Mot de passe manquant.
|
Missing password.=Mot de passe manquant.
|
||||||
Missing player name.=Nom de joueur manquant.
|
Missing player name.=Nom de joueur manquant.
|
||||||
Name: @1@nOwner: @2@nMembers: @3=Nom : @1@nPropriétaire : @2@nMembres : @3
|
Name: @1@nOwner: @2@nMembers: @3=Nom : @1@nPropriétaire : @2@nMembres : @3
|
||||||
Ownership has been transferred to @1.=La propriété a été transférée à @2.
|
Ownership has been transferred to @1.=La propriété a été transférée à @1.
|
||||||
Password has been updated.=Le mot de passe a été mis à jour.
|
Password has been updated.=Le mot de passe a été mis à jour.
|
||||||
Permission denied: Wrong password.=Permission refusée : mauvais mot de passe.
|
Permission denied: Wrong password.=Permission refusée : mauvais mot de passe.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user