mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-29 16:46:46 +01:00
Configurable :P
This commit is contained in:
parent
ed82a838c8
commit
9a12d86eac
@ -313,6 +313,8 @@ public class Config extends AutoUpdateConfigLoader {
|
||||
public int getMySQLServerPort() { return config.getInt("MySQL.Server.Port", 3306); }
|
||||
public String getMySQLServerName() { return config.getString("MySQL.Server.Address", "localhost"); }
|
||||
public String getMySQLUserPassword() { return getStringIncludingInts("MySQL.Database.User_Password"); }
|
||||
public int getMySQLMaxConnections() { return config.getInt("MySQL.Database.MaxConnections"); }
|
||||
public int getMySQLMaxPoolSize() { return config.getInt("MySQL.Database.MaxPoolSize"); }
|
||||
|
||||
private String getStringIncludingInts(String key) {
|
||||
String str = config.getString(key);
|
||||
|
@ -52,8 +52,8 @@ public final class SQLDatabaseManager implements DatabaseManager {
|
||||
connectionProperties.put("autoReconnect", "false");
|
||||
connectionPool = new ConnectionPool("mcMMO-Pool",
|
||||
1 /*Minimum of one*/,
|
||||
10 /*max pool size */, // TODO Configurable?
|
||||
10 /*max num connections*/, // TODO Configurable?
|
||||
Config.getInstance().getMySQLMaxPoolSize() /*max pool size */,
|
||||
Config.getInstance().getMySQLMaxConnections() /*max num connections*/,
|
||||
0 /* idle timeout of connections */,
|
||||
connectionString,
|
||||
connectionProperties);
|
||||
|
@ -122,6 +122,12 @@ MySQL:
|
||||
User_Password: UserPassword
|
||||
Name: DataBaseName
|
||||
TablePrefix: mcmmo_
|
||||
# This setting is the max simultaneous mysql connections allowed at a time, needs to be
|
||||
# high enough to support multiple player logins in quick succession
|
||||
MaxConnections: 30
|
||||
# This setting is the max size of the pool of cached connections that we hold available
|
||||
# at any given time
|
||||
MaxPoolSize: 20
|
||||
Server:
|
||||
Port: 3306
|
||||
Address: localhost
|
||||
|
Loading…
Reference in New Issue
Block a user