supercrafter333 / BetterBan

A plugin for PocketMine-MP to simply ban players for a certain period of time.
Apache License 2.0
16 stars 8 forks source link

mysql support #14

Closed tobiaskirchmaier closed 3 years ago

tobiaskirchmaier commented 3 years ago

Configuration for mysql settings is still missing. Suggestion:

mysql-settings:
    host: 127.0.0.1
    user: root
    password: password
    database: betterban

This must then still be changed in the main class.

$this->mysqlBanByName = new MySQLBanList($this->getConfig()->get('mysql-settings'), MySQLBanList::TABLE_NAMEBANS);
$this->mysqlBanByIP = new MySQLBanList($this->getConfig()->get('mysql-settings'), MySQLBanList::TABLE_IPBANS);

You should also check if the mysql banlist should be set at all. Suggestion:

mysql-banlist: false
if($this->getConfig()->get('mysql-banlist', false)) {
    $this->mysqlBanByName = new MySQLBanList($this->getConfig()->get('mysql-settings'), MySQLBanList::TABLE_NAMEBANS);
    $this->mysqlBanByIP = new MySQLBanList($this->getConfig()->get('mysql-settings'), MySQLBanList::TABLE_IPBANS);
}