Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom MOTD priorities #40

Open
Phosphorshy opened this issue Feb 19, 2022 · 2 comments
Open

Custom MOTD priorities #40

Phosphorshy opened this issue Feb 19, 2022 · 2 comments
Assignees
Labels
feature New feature or request

Comments

@Phosphorshy
Copy link

Is it possible to add support for both ban and whitelist MOTDs?

like have it check if the player is banned, if they are then display the ban MOTD, if not then move on to the whitelist MOTD checks?

@Phosphorshy Phosphorshy added the feature New feature or request label Feb 19, 2022
@strumswell
Copy link
Owner

Currently, it only works the other way around as the whitelist motd has a higher priority than the ban motd. But you want the ban motd to appear instead of the whitelist motd if a player is banned, right?

A priority field in the config would be a possibility to implement your request. Like:

ClassicMotd:
  Regulars: '&2Welcome back, &e%player%&2! %line%&aIt''s a %weather% %time%.'
  Newbies: '&2Welcome newbie! %line%&aIt''s a %weather% %time%.'
RandomMotd:
  Enable: false
  PRIORITY: 30
  Regulars:
    - '&bHey %player%! %line%&3Those Motds change totally random!'
  Newbies:
    - '&bHey Newbie. %line%&3Those Motds change totally random!'
BanMotd:
  Enable: false
  PRIORITY: 40
  MessageTempBan: '&cYou are banned! Reason: &e%reason%%line%&cExpiration: &e%expdate% at %exptime%'
  MessageForeverBan: '&cYou are banned! Reason: &e%reason%%line%&cExpiration: &eNEVER'
  Format:
    Date: 'DD/MM/YYYY'
    Time: 'hh:mm:ss'
WhitelistMotd:
  Enable: false
  PRIORITY: 50
  MessageWhitelisted: '&cWelcome back, &e%player%&c!%line%&c&oYou are on the whitelist.'
  MessageNotWhitelisted: '&cYou are &lNOT &cwhitelisted.%line%&c&oPlease contact the server owner.'

(Higher priority value motds can overwrite lower priority value motds)

This also introduces more complexity to the configuration I'm not sure everyone "understands" or at least reads the docs. I can already see the issue tickets fly in here after people unknowingly messing with priority value and complaining "the plugin not working at all". (almost like #39, which is probably invalid...)

Do you have a better idea to implement such a priority system in the config?

@strumswell strumswell changed the title Stack ban and whitelist MOTDs Custom MOTD priorities Feb 19, 2022
@Phosphorshy
Copy link
Author

Could possibly do that yeah

maybe to prevent some tickets you could move priority to it's own section like

# Advanced settings - only edit if you know what you are doing!
# Set these to default values before reporting an issue

Priority:
  RandomMotd: 30
  BanMotd: 40
  WhitelistMotd: 50

or maybe just change the built in priorities to have ban above whitelist because only one config would allow them both to work

(I should note I have no plugin dev experience so I have no idea if anything I'm saying is actually possible)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants