aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLMBishop <13875753+LMBishop@users.noreply.github.com>2021-06-02 23:35:56 +0100
committerLMBishop <13875753+LMBishop@users.noreply.github.com>2021-06-03 11:24:15 +0100
commit343aed44a398911495c05d91ff9d18857eda3329 (patch)
treeacbdfa13d4fff90fbcca44aae5d4afe860d33067
parent1ec772062338d8e495ba050efc1a7ce870fc68af (diff)
Add SQL options
-rw-r--r--build.gradle4
-rw-r--r--src/main/resources/config.yml28
2 files changed, 32 insertions, 0 deletions
diff --git a/build.gradle b/build.gradle
index 4092361f..d9f61c7b 100644
--- a/build.gradle
+++ b/build.gradle
@@ -83,12 +83,16 @@ dependencies {
}
// bStats
implementation 'org.bstats:bstats-bukkit-lite:1.8'
+ // HikariCP
+ implementation 'com.zaxxer:HikariCP:4.0.3'
compileOnly fileTree(dir: 'libs', includes: ['*.jar'])
}
shadowJar {
relocate 'org.bstats', 'com.leonardobishop.quests.libs.bstats'
+ relocate 'com.zaxxer.hikari', 'com.leonardobishop.quests.libs.hikaricp'
+ relocate 'org.slf4j', 'com.leonardobishop.quests.libs.slf4j'
archiveClassifier.set('')
}
diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml
index 0386fa98..b4c94332 100644
--- a/src/main/resources/config.yml
+++ b/src/main/resources/config.yml
@@ -234,6 +234,34 @@ options:
global-task-configuration-override: false
# Whether or not the global display configuration will override per-quest display settins
global-quest-display-configuration-override: false
+ # Storage options
+ storage:
+ # Either 'yaml' (flatfile) or 'mysql' (network)
+ provider: "yaml"
+ # The following is only applicable for database storage providers (e.g. mysql)
+ database-settings:
+ # The name of the database. This database should already exist!
+ database-name: "minecraft"
+ network:
+ username: "root"
+ password: ""
+ address: "localhost"
+ port: 3306
+ # This plugin uses 'HikariCP' for connection management, the pooling configuration can be changed here
+ connection-pool-settings:
+ # The maximum number of connections to keep open with the database (def=8)
+ maximum-pool-size: 8
+ # The minimum number of connections to keep open with the database (def=8)
+ minimum-pool-size: 8
+ # The maximum time (in milliseconds) to keep a single connection open (def=1800000 - 30 min)
+ connection-lifetime: 1800000
+ # The time (in milliseconds) to ping the database (0 to disable, def=0)
+ heartbeat-time: 0
+ # The time (in milliseconds) the plugin will wait for a response by the database (def=0)
+ timeout: 5000
+ # The prefix each table will use
+ table-prefix: "quests_"
+
# This switches up the entire quest system.
# By enabling daily-quests, players will no longer be presented with the standard Quest GUI.