mirror of
https://github.com/exituser/Brewery.git
synced 2026-09-17 08:59:01 +00:00
Implemented Playerdata DB Syncing
This commit is contained in:
@@ -80,7 +80,6 @@ public class BConfig {
|
||||
|
||||
//MySQL
|
||||
public static String sqlHost, sqlPort, sqlDB;
|
||||
private static String sqlUser, sqlPW;
|
||||
public static SQLSync sqlSync;
|
||||
public static boolean sqlDrunkSync;
|
||||
|
||||
@@ -345,9 +344,9 @@ public class BConfig {
|
||||
sqlDrunkSync = sqlCfg.getBoolean("syncDrunkeness");
|
||||
sqlHost = sqlCfg.getString("host", null);
|
||||
sqlPort = sqlCfg.getString("port", null);
|
||||
sqlUser = sqlCfg.getString("user", null);
|
||||
sqlDB = sqlCfg.getString("database", null);
|
||||
sqlPW = sqlCfg.getString("password", null);
|
||||
String sqlUser = sqlCfg.getString("user", null);
|
||||
String sqlPW = sqlCfg.getString("password", null);
|
||||
|
||||
sqlSync = new SQLSync();
|
||||
if (!sqlSync.init(sqlUser, sqlPW)) {
|
||||
|
||||
@@ -164,11 +164,11 @@ public class BData {
|
||||
// loading BPlayer
|
||||
section = data.getConfigurationSection("Player");
|
||||
if (section != null) {
|
||||
// keys have players name
|
||||
for (String name : section.getKeys(false)) {
|
||||
// keys have players uuid
|
||||
for (String uuid : section.getKeys(false)) {
|
||||
try {
|
||||
//noinspection ResultOfMethodCallIgnored
|
||||
UUID.fromString(name);
|
||||
UUID.fromString(uuid);
|
||||
if (!P.useUUID) {
|
||||
continue;
|
||||
}
|
||||
@@ -178,11 +178,11 @@ public class BData {
|
||||
}
|
||||
}
|
||||
|
||||
int quality = section.getInt(name + ".quality");
|
||||
int drunk = section.getInt(name + ".drunk");
|
||||
int offDrunk = section.getInt(name + ".offDrunk", 0);
|
||||
int quality = section.getInt(uuid + ".quality");
|
||||
int drunk = section.getInt(uuid + ".drunk");
|
||||
int offDrunk = section.getInt(uuid + ".offDrunk", 0);
|
||||
|
||||
new BPlayer(name, quality, drunk, offDrunk);
|
||||
new BPlayer(uuid, quality, drunk, offDrunk);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user