Bans in MySQL

Discussion in 'Plugin Development' started by KAM202, Jul 1, 2019.

Thread Status:
Not open for further replies.
  1. Offline

    KAM202

    Hello.
    I make a plugin for ban, which saves everything in the database. I have question for you: How to check if a person is banned (when entering) - search in the database or variables? If variables, when must be the update of them from the database? That it would be maximally optimal?
     
  2. Offline

    timtower Administrator Administrator Moderator

    @KAM202 You need to do a select query and check if the user exists in the database, if so then he is probably banned.
    You can also load everything in memory and update every ... time but then you might be better of using a config instead.
     
  3. Offline

    KAM202

    @timtower What will be better performance? Query or memory ?
     
  4. Offline

    timtower Administrator Administrator Moderator

    Memory, query requires a network call every time.
     
  5. Offline

    KAM202

    @timtower And what about the expiration of bans - check them after updating? ;)
     
  6. Offline

    timtower Administrator Administrator Moderator

    Check them on an interval.
     
Thread Status:
Not open for further replies.

Share This Page