Bugzilla – Bug 3218
New flag in users.ini for permanent ban
Last modified: 2014-02-08 23:53:18 PST
Needed a new flag acess for permanent ban in users.ini
This could be a good addition. I can handle plugin changes if needed. Few things : > How to handle maximum time that is considered as a temporary ban ? I suggest a cvar that would be protected. > Should the new flag be for permanent bans or for temporary ones ? I suggest temporary, so if administrators don't make any changes in users.ini, bans behaviors gonna stay the same. > Which flag to use ? Next avalaible flag is 'v' > How should regular ban flag and temp ban flag work together ? cmd_access seems to allow command access level to contain multiple flags Should see how it works internally to amxx though, and how multiple flags would be reported in cmdaccess.ini If this is not working, it would require that admins with permanent ban access have also temp ban flag, so the 2nd point could be reviewed and the new flag could handle permanent flag instead of temporary ban flags. > What with amx_unban then ? I see 2 possibilities : - command is avalaible only to admins with perm ban access - add a new flag for this command (don't think it is worth) > 3 places to implement new ban flag : admincmd plugin : commands amx_ban and amx_banip plmenu plugin : menu amx_banmenu amx_unban Let's discuss this hardly and try command multiple flags access behavior before making any changes.
Multiflags should work. The flag value in cmdaccess.ini is converted as sum of bits, and passed as it is in the function which registers the command. About amx_unban, there should be the possibility to remove temp ban for an admin without permanent ban access. We could imagine easily the admin has banned a wrong player and if he can't unban, it's not going to be awkward.
Created attachment 3532 [details] [review] new "temp ban" admin flag Here a patch adding a new flag 'v' for temp ban Admins with flag "d" ADMIN_BAN or flag "l" ADMIN_RCON have access to any bans and any unbans. Admins with flag "v" ADMIN_BAN_TEMP (and with no flag "d" and no flag "l" have only access to temp bans (limited with cvar amx_tempban_maxtime) and can only use amx_unban on bans they have made during the current map. For this, all bans are stored in a trie created in admincmd.amxx and exported via an xvar handling the trie index. Making this, i've noticed that dod and tfc plmenu plugins have not been updated as default (cstrike) and ns ones. Temp ban flag has been prefered over perm ban flag because if admins don't change anything on their current configs, ban gonna behave the same as before.
Comment on attachment 3532 [details] [review] new "temp ban" admin flag Review of attachment 3532 [details] [review]: ----------------------------------------------------------------- This looks good.
Pushed changeset: http://hg.alliedmods.net/amxmodx-central/rev/09bd5339181d Changelog: Add a new access level flag 'v' for temporary bans (bug 3218, r=arkshine)
Commit pushed to master at https://github.com/alliedmodders/amxmodx https://github.com/alliedmodders/amxmodx/commit/784f91e441318eb6f980ad4865df17b45966d47f Add a new access level flag 'v' for temporary bans (bug 3218, r=arkshine) Former-commit-id: d09b92cf6c3ffa6ea82b4c4b005056e7875ee80f