mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-12-01 17:36: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 int getMySQLServerPort() { return config.getInt("MySQL.Server.Port", 3306); }
|
||||||
public String getMySQLServerName() { return config.getString("MySQL.Server.Address", "localhost"); }
|
public String getMySQLServerName() { return config.getString("MySQL.Server.Address", "localhost"); }
|
||||||
public String getMySQLUserPassword() { return getStringIncludingInts("MySQL.Database.User_Password"); }
|
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) {
|
private String getStringIncludingInts(String key) {
|
||||||
String str = config.getString(key);
|
String str = config.getString(key);
|
||||||
|
@ -52,8 +52,8 @@ public final class SQLDatabaseManager implements DatabaseManager {
|
|||||||
connectionProperties.put("autoReconnect", "false");
|
connectionProperties.put("autoReconnect", "false");
|
||||||
connectionPool = new ConnectionPool("mcMMO-Pool",
|
connectionPool = new ConnectionPool("mcMMO-Pool",
|
||||||
1 /*Minimum of one*/,
|
1 /*Minimum of one*/,
|
||||||
10 /*max pool size */, // TODO Configurable?
|
Config.getInstance().getMySQLMaxPoolSize() /*max pool size */,
|
||||||
10 /*max num connections*/, // TODO Configurable?
|
Config.getInstance().getMySQLMaxConnections() /*max num connections*/,
|
||||||
0 /* idle timeout of connections */,
|
0 /* idle timeout of connections */,
|
||||||
connectionString,
|
connectionString,
|
||||||
connectionProperties);
|
connectionProperties);
|
||||||
|
@ -122,6 +122,12 @@ MySQL:
|
|||||||
User_Password: UserPassword
|
User_Password: UserPassword
|
||||||
Name: DataBaseName
|
Name: DataBaseName
|
||||||
TablePrefix: mcmmo_
|
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:
|
Server:
|
||||||
Port: 3306
|
Port: 3306
|
||||||
Address: localhost
|
Address: localhost
|
||||||
|
Loading…
Reference in New Issue
Block a user