Commit Graph

52 Commits

Author SHA1 Message Date
Luke aka SwissalpS
d6e7c62b84
Updated 5.9.0 (#12)
* Store hashes of passwords

cleartext password storage is bad practice.

* Depricate factions.get_password()

returns nil after first run

* loaded message

* Properly use the configurable admin priv in output

* Don't show password, since we can't anymore

* remove code that is never reached

* chown: reorder to first check if player has any factions at all

There is no point in checking other params if this part fails.

* chown: fix command signature

password is required

* proper admin priv listing in help for invite

* wrap fixup code in do-block

variable save_needed is not used for anything else

* locale: many -> multiple

* locale: remove unused entry

* locale: ownership rephrasing

* locale: tweak and add "No factions found."

* locale: exists -> exist

* locale: this -> that or better

also fixed a french mistake: player doesn't own these -> player owns
these

* locale: reuse string for missing name

besides, "nil" is a valid name. This way there is no confusion.

* locale: reuse "missing player name"

* locale: reuse "faction x doesn't exist"

* locale: faction x already exists

* locale: the player -> player x

* locale: some more de-Frenching

* add local is_admin

stash commit...

* disband: allow admin

- permit admin to disband a faction without having any factions himself
- permit admin to skip password check (he can supply any placeholder)
- permit admin to disband his own single faction
- don't call get_owner or valid_password if is admin
- streamline duplicate code

* list: check for true first instead of using negation

- check for no factions first -> simpler code
- whitespace: linebreak for easier reading

* info: cleanup

- whitespace linebreaks for easier reading and consistancy
- update helptext signiture (also for disband) to reflect actual
requirements and standard
- loop members into table for consistant and easier to read code

* player_info: cleanup

- move depricated log entry to start of get_player_faction(), no point
in skipping warning.
- simplify get_player_factions()
- whitespace linebreaks for easier reading and consistancy
- loop members into table for consistant and easier to read code
- simplify get_owned_factions()
- make player_name param optional, default to caller (still need to
check as caller name can be missing)
- loop factions into table for consistant and easier to read code (also
presumpted faster)

* join: cleanup

- don't call get_player_factions() unless needed
- use get_player_factions() instead of depricated get_player_faction()
- truth check of password in valid_password() for easier understanding
of code
- remove explicit nil check where not needed

* leave: cleanup

- update help text to standard syntax
- remove unnecessary param count checks
- simplify leave_faction() argument checking

* kick: cleanup

- simplify and reduce calls of core.get_player_privs()
- update help text to standard syntax
- streamline duplicate code
- remove unnecessary param count checks
- remove explicit nil check where not needed
- don't call get_owner if is admin (until needed)

* passwd: cleanup

- update help text to standard syntax
- streamline duplicate code
- remove unnecessary param count checks
- remove explicit nil check where not needed
- don't call get_owner if is admin

* chown: cleanup and tweak

- update help text to standard syntax
- streamline duplicate code
- remove unnecessary param count checks
- remove explicit nil check where not needed
- updated locale to be neutral to admin or owner
- don't call get_owner or valid_password if is admin
- remove core.player_exists() call since target was checked when joined
faction
- abort early if no target or password provided

* invite: cleanup and tweaks

- reduced needed indents
- remove explicit nil check where not needed
- use get_player_factions() instead of depricated get_player_faction()
and reduce calls of it
- tweaked join_faction()
- adds check if player already is in that faction

* more tweaks

- join: check if already member
- leave: checks if user is in given faction at all
- kick: early abort if no player provided
- create: early abort if no faction or password are provided
- create: use get_player_factions() instead of get_player_faction()
- create: reduce explicit nil checks
- disband: early abort if missing password
- disband: reduce param-count-checks and use table.getn()
- info: reduce explicit nil checks and use table.getn()
- passwd: early abort if no password provided
- in general remove explicit nil-checks where not needed

* is_admin -> not_admin

for slightly easier reading and shorter lines

* fix translator missing argument

* some facepalm fixes

and tweaks of table.getn() for consistency, here # would work just as
well.

* set minimum server version to 5.9.0

* another facepalm moment

* add mtt support

* refactor handle_command for mtt

It could've been done by only exposing handle_command, but this is
cleaner for future maintenance as tasks are well separated.

* bundle mtt related lines

* needs fakelib, not areas

areas will need this mod for testing

* remove unused arguments

* add owner to members on cleanup

* rename chat to cc

also no need to expose cc directly to mtt

* register the actually set priv when it is missing

* label data correctly

* move settings higher up where they are expected to be

* consistancy with variable names

use faction_name, player_name, target_name, password etc.
instead of a jumble of pw, fname, name, player_name etc.

* reduce needles table-copy

* fail to register same named factions

* no-op depricated and useless get_password

* some more checks in some API methods

* whitespace and comments

* pass translator to mtt

* bugfix cc.disband inverted password check

* standardize var name and reduce looping

* add get_members() api-method and use it

* player_info: count empty string as no player

* player_info: switch if-else to avoid negation

* unreachable comments

* simpler check

* add mtt-checks for front and backend commands

* update french locale

- informal tone
- adds missing entries

* add Spanish locale

* add German locale

* whitespace cleanup

* add fakelib comment

* provide alternative to table.pack()

* add disband hook support

* remove local f == factions
2024-12-31 19:45:10 +01:00
Luke aka SwissalpS
c629b298f9
general overhaul for 5.0.0 (#11)
* general overhaul for 5.0.0

- overhauled English language
- overhauled French language
- adds Spanish locale
- adds German locale
- adds mtt integration testing
- adds github workflow for mtt
- refactores handle_command
- standardizes usage of table.getn() (nothing crucial in this mod)
- standardizes variables to have same format and same name for same
purpouse
- DB-fix also adds missing owners to members
- fixes some situations where admins couldn't do things
- fixes display of dynamic admin priv and registration
- alows uppercase for subcommands
- adds valid_password() for cleaner checks
- ensures that existing factions don't get overwritten

* provide alternative to table.pack()

* add disband hooks support

* remove local f == factions
min5.0.0
2024-10-13 22:24:58 -04:00
wsor4035
72f52af392
fix french translation error detected by cdb 2024-10-13 12:36:14 -04:00
Niklp
755a780122
allow custom factions_admin priv (#7) 2023-04-14 18:35:31 +02:00
Luke aka SwissalpS
77fe095ac8
nil check patch (#5)
* nil check patch
2021-12-21 07:15:29 +02:00
BuckarooBanzay
19cb21ee1a add luacheck, workflow and fix some issues 2021-05-16 18:52:10 +02:00
ulysse
0d19660379 fix error in case handling 2021-04-02 22:03:19 +02:00
ulysse
0c0e7548c1 changed command outcomes in chat message to return string 2021-04-02 22:03:19 +02:00
ulysse
83a63c1335 removed extra parameter 2021-04-02 22:03:19 +02:00
Buckaroo Banzai
18eef7c90e
Merge pull request #2 from IRI-Research/master
Add checks on command args to avoid server crashes
2021-04-01 19:55:13 +02:00
Yves-Marie Haussonne
0612afb338 Add checks on command args to avoid server crashes 2021-03-31 18:25:36 +02:00
BuckarooBanzay
639f5aa716 check if player faction is nil 2020-10-27 13:32:02 +01:00
Louis Royer
50335b7ceb Add missing french translations I forgot in my last PR
because of the "exclude all files by default" policy in .gitignore.
2020-08-23 14:32:56 +02:00
Supergoat666
d77af6ecac Fix grammar and add README 2020-08-22 23:58:18 +00:00
Supergoat666
cc0ae096d8 fix player name in /factions player_info 2020-08-22 23:58:18 +00:00
Supergoat666
44ffad45b9 Improve get_player_factions, get_owned_factions and get_administred_factions to return nil if there is no faction corresponding 2020-08-22 23:58:18 +00:00
Supergoat666
cac9740440 Add a command to see what faction a player is in, and what of them are owned by himself + improve get_player_factions, get_owned_factions and get_administred_factions to return nil if there is no faction corresponding 2020-08-22 23:58:18 +00:00
Supergoat666
d90a6d6dda fix get_facts 2020-08-22 23:58:18 +00:00
Louis Royer
8b6730afe6 Port from intllib to builting MT5 client-side translation system
- Add french translations
2020-08-20 18:57:22 +02:00
Katherine Peeters
8d6d699f45
Updated credits 2020-08-20 11:19:16 -04:00
Supergoat666
fd8680b3f6 Change the way to configure : now using minetest.conf 2020-08-20 03:06:02 +02:00
Supergoat666
fa20136630 Remove test function 'ses' that I forget 2020-08-18 14:03:21 +02:00
Supergoat666
63485e4b7a Improve settings reading 2020-08-18 13:55:55 +02:00
Supergoat666
4aed28e53e changing the name of get_owned_factions by get_administered_factions 2020-08-18 11:35:51 +02:00
Supergoat666
3e7190edc6 Code Improvement 2020-08-18 11:25:28 +02:00
Supergoat666
600c721299 debug automatic corrector 2020-07-29 12:57:36 +02:00
Basile
c8dc189e92 Update README.md 2020-07-29 10:48:30 +00:00
Basile
c6b09cee66 Update README.md 2020-07-29 10:44:38 +00:00
Basile
be035ca716 Update README.md 2020-07-29 10:42:19 +00:00
Basile
1eae826e00 Update README.md 2020-07-29 10:41:40 +00:00
Supergoat666
0b799f3c5f Show list members only if the members are less than 50 in the /factions info command 2020-07-29 09:28:33 +02:00
Supergoat666
7d77eb3a41 Made some grammatical corrections 2020-07-29 09:20:46 +02:00
Supergoat666
6f681a2f4c Update README.md to fit with modifications 2020-07-28 23:04:02 +02:00
Supergoat666
b756738148 Add the line for config mode to facilitate the activation of multi-faction : all it takes is switching to false 2020-07-28 22:56:38 +02:00
Supergoat666
abdf4d25d9 Add factions.version variable + factions.get_facts() + factions.player_is_in_faction(fname,player_name) to make easier the integration in other mods 2020-07-28 22:50:31 +02:00
Supergoat666
15ec2ad3e1 Add the multi-factions mode to support multi factions 2020-07-28 22:47:50 +02:00
Supergoat666
95a35e2671 Add the /factions invite command to add a player to a faction, only playerfactions_admin can use it 2020-07-28 22:42:57 +02:00
Supergoat666
26074eedd9 Add playerfactions_admin privs 2020-07-28 22:36:04 +02:00
Supergoat666
8e4aa0db51 Add the member list in /faction info 2020-07-28 22:29:38 +02:00
Katherine Peeters
d9844f27e4
Protector integration has been merged; updated README
Closes #4
2020-04-25 12:26:33 -04:00
Katherine Peeters
c255afbbf0
Temporarily fixed bug with offline players
Player storage isn't available when players are offline, so get_player_faction wouldn't work. Fixed by adding a secondary data structure, which will be removed once a mechanism for offline player storage has been added to the engine
2020-02-08 12:08:01 -05:00
Alden Peeters
807cb6400e
More helpful error messages 2019-09-18 16:52:14 -04:00
Alden Peeters
38dfc451e5
Fixed typo 2019-09-16 17:12:10 -04:00
Alden Peeters
d865323726
Renamed factions to playerfactions to avoid confusion 2019-09-09 19:44:59 -04:00
Alden Peeters
9adfb56b3b
Fixed create, disband, and chown commands 2019-09-09 18:20:58 -04:00
Alden Peeters
f9ce04c4c4
Fixed critical bugs 2019-09-09 17:59:09 -04:00
Alden Peeters
db86cabb04
Added GPLv3 license 2019-09-09 16:06:33 -04:00
Alden Peeters
9ed73d6da1
Refactored to clean the global namespace 2019-09-09 15:56:38 -04:00
Alden Peeters
21537393ff
We don't really need beerchat integration 2019-09-09 00:11:43 -04:00
Alden Peeters
7a77f6cb07
Added README.md 2019-09-08 23:53:15 -04:00