Commit Graph

92 Commits

Author SHA1 Message Date
Luke aka SwissalpS
c8c83fb4b1 standardize var name and reduce looping 2024-09-17 12:23:31 +02:00
Luke aka SwissalpS
62684884b9 bugfix cc.disband inverted password check 2024-09-16 23:53:57 +02:00
Luke aka SwissalpS
d072b2ba0c pass translator to mtt 2024-09-16 23:22:14 +02:00
Luke aka SwissalpS
279b1efe1e whitespace and comments 2024-09-16 17:07:34 +02:00
Luke aka SwissalpS
e4851ade83 some more checks in some API methods 2024-09-16 16:31:09 +02:00
Luke aka SwissalpS
b47198299b no-op depricated and useless get_password 2024-09-16 16:30:15 +02:00
Luke aka SwissalpS
d333c8fa71 fail to register same named factions 2024-09-16 16:29:02 +02:00
Luke aka SwissalpS
393b4faacb reduce needles table-copy 2024-09-16 16:28:13 +02:00
Luke aka SwissalpS
285f62871c consistancy with variable names
use faction_name, player_name, target_name, password etc.
instead of a jumble of pw, fname, name, player_name etc.
2024-09-16 16:27:27 +02:00
Luke aka SwissalpS
e03f8fe129 move settings higher up where they are expected to be 2024-09-16 15:54:34 +02:00
Luke aka SwissalpS
64d31e7d6b label data correctly 2024-09-16 15:54:00 +02:00
Luke aka SwissalpS
f99dcfa57c register the actually set priv when it is missing 2024-09-16 15:51:45 +02:00
Luke aka SwissalpS
f01e90e8eb rename chat to cc
also no need to expose cc directly to mtt
2024-09-16 01:59:56 +02:00
Luke aka SwissalpS
54c80e9242 add owner to members on cleanup 2024-09-16 01:49:38 +02:00
Luke aka SwissalpS
6ccfe35d13 remove unused arguments 2024-09-16 01:40:15 +02:00
Luke aka SwissalpS
605561d2a4 bundle mtt related lines 2024-09-16 01:38:54 +02:00
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