Commit Graph

76 Commits

Author SHA1 Message Date
Luke aka SwissalpS
a27dcfd62c 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.
2024-09-16 01:03:57 +02:00
Luke aka SwissalpS
b6f312b9db add mtt support 2024-09-16 01:00:34 +02:00
Luke aka SwissalpS
607c6f8d1f another facepalm moment 2024-09-15 10:08:26 +02:00
Luke aka SwissalpS
7d9b343db2 some facepalm fixes
and tweaks of table.getn() for consistency, here # would work just as
well.
2024-09-15 09:35:18 +02:00
Luke aka SwissalpS
307141d7e3 fix translator missing argument 2024-09-15 08:34:01 +02:00
Luke aka SwissalpS
f1489b486d is_admin -> not_admin
for slightly easier reading and shorter lines
2024-09-15 08:26:01 +02:00
Luke aka SwissalpS
f2380e0bb1 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
2024-09-15 08:23:12 +02:00
Luke aka SwissalpS
67436bffcf 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
2024-09-15 07:31:01 +02:00
Luke aka SwissalpS
f130b50565 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
2024-09-15 07:01:48 +02:00
Luke aka SwissalpS
e7bc7a5da8 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
2024-09-15 06:35:18 +02:00
Luke aka SwissalpS
c68ccd6f44 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)
2024-09-15 06:09:33 +02:00
Luke aka SwissalpS
6efb00ec69 leave: cleanup
- update help text to standard syntax
- remove unnecessary param count checks
- simplify leave_faction() argument checking
2024-09-15 05:31:25 +02:00
Luke aka SwissalpS
d0520d2221 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
2024-09-15 05:14:11 +02:00
Luke aka SwissalpS
86ba332441 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)
2024-09-15 04:58:57 +02:00
Luke aka SwissalpS
9a646d213e 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
2024-09-15 04:19:04 +02:00
Luke aka SwissalpS
f02f6d56e6 list: check for true first instead of using negation
- check for no factions first -> simpler code
- whitespace: linebreak for easier reading
2024-09-15 03:53:42 +02:00
Luke aka SwissalpS
fb8f7baf4f 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
2024-09-15 03:47:50 +02:00
Luke aka SwissalpS
978861ae3e add local is_admin
stash commit...
2024-09-15 02:32:21 +02:00
Luke aka SwissalpS
f021427f04 locale: some more de-Frenching 2024-09-15 02:18:21 +02:00
Luke aka SwissalpS
9e3276ad9e locale: the player -> player x 2024-09-15 01:59:52 +02:00
Luke aka SwissalpS
4ed325039d locale: faction x already exists 2024-09-15 01:53:36 +02:00
Luke aka SwissalpS
f5c68e3c5d locale: reuse "faction x doesn't exist" 2024-09-15 01:50:53 +02:00
Luke aka SwissalpS
827751f562 locale: reuse "missing player name" 2024-09-15 01:35:25 +02:00
Luke aka SwissalpS
44d01cc834 locale: reuse string for missing name
besides, "nil" is a valid name. This way there is no confusion.
2024-09-15 01:22:41 +02:00
Luke aka SwissalpS
c28b0a0b04 locale: this -> that or better
also fixed a french mistake: player doesn't own these -> player owns
these
2024-09-15 01:21:48 +02:00
Luke aka SwissalpS
37e70987d0 locale: exists -> exist 2024-09-15 00:41:29 +02:00
Luke aka SwissalpS
bf9905e238 locale: tweak and add "No factions found." 2024-09-15 00:34:13 +02:00
Luke aka SwissalpS
116bc756e1 locale: ownership rephrasing 2024-09-15 00:33:37 +02:00
Luke aka SwissalpS
ea58047369 locale: many -> multiple 2024-09-15 00:17:45 +02:00
Luke aka SwissalpS
a87e59afee wrap fixup code in do-block
variable save_needed is not used for anything else
2024-09-15 00:06:17 +02:00
Luke aka SwissalpS
e21bd17ace proper admin priv listing in help for invite 2024-09-15 00:03:20 +02:00
Luke aka SwissalpS
27449b6534 chown: fix command signature
password is required
2024-09-14 23:57:57 +02:00
Luke aka SwissalpS
75ff73a45c chown: reorder to first check if player has any factions at all
There is no point in checking other params if this part fails.
2024-09-14 23:33:49 +02:00
Luke aka SwissalpS
442c2c5209 remove code that is never reached 2024-09-14 23:27:22 +02:00
Luke aka SwissalpS
0063990b28 Don't show password, since we can't anymore 2024-09-14 14:20:04 +02:00
Luke aka SwissalpS
8f249e27cc Properly use the configurable admin priv in output 2024-09-11 11:03:32 +02:00
Luke aka SwissalpS
d09b01a397 loaded message 2024-09-11 10:51:57 +02:00
Luke aka SwissalpS
0163900ce9 Depricate factions.get_password()
returns nil after first run
2024-09-11 10:50:52 +02:00
Luke aka SwissalpS
b864fcafe1 Store hashes of passwords
cleartext password storage is bad practice.
2024-09-11 10:49:17 +02: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
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