Skip to content

Commit

Permalink
Merge branch 'master' into updated_5.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
SwissalpS authored Dec 26, 2024
2 parents 7131896 + c629b29 commit 0a8276f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,17 @@ function factions.disband_faction(faction_name)
return true
end


function factions.hash_password(password)
return minetest.sha256(password)
end


function factions.valid_password(faction_name, password)
if not facts[faction_name] or not password then
return false
end

return factions.hash_password(password) == facts[faction_name].password256
end

Expand All @@ -199,6 +202,7 @@ function factions.set_password(faction_name, password)
if not (facts[faction_name] and 'string' == type(password)) then
return false
end

facts[faction_name].password256 = factions.hash_password(password)
save_factions()
return true
Expand Down Expand Up @@ -287,6 +291,7 @@ function cc.list()
end
end


function cc.info(player_name, params)
local faction_name = params[2]
if not faction_name then
Expand Down
2 changes: 1 addition & 1 deletion locale/playerfactions.fr.tr
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Missing faction name.=Nom de faction manquant.
Missing password.=Mot de passe manquant.
Missing player name.=Nom de joueur manquant.
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.
Permission denied: Wrong password.=Permission refusée : mauvais mot de passe.

Expand Down

0 comments on commit 0a8276f

Please sign in to comment.