Fixed Server Copy failing

This commit is contained in:
Rsl1122 2017-09-03 18:42:32 +03:00
parent affef9f8ec
commit 163a694988
5 changed files with 15 additions and 4 deletions

View File

@ -185,7 +185,7 @@ public class CommandUseTable extends Table {
statement = prepareStatement("SELECT " +
columnCommand + ", " +
columnTimesUsed + ", " +
serverUUIDColumn + ", " +
serverUUIDColumn +
" FROM " + tableName +
" JOIN " + serverTable + " on " + serverIDColumn + "=" + columnServerID
);

View File

@ -284,7 +284,7 @@ public class ServerTable extends Table {
String name = info.getName();
String webAddress = info.getWebAddress();
if (Verify.notNull(uuid, name, webAddress)) {
if (uuid == null) {
continue;
}

View File

@ -194,7 +194,6 @@ public abstract class Table {
if (statement == null) {
return;
}
endTransaction(statement.getConnection());
}

View File

@ -72,7 +72,7 @@ public class BatchOperationTable extends Table {
toDB.removeAllData();
copyServers(toDB);
System.out.println(toDB.getDb().getServerTable().getServerNames().toString());
System.out.println(toDB.getDb().getServerTable().getBukkitServers().toString());
copyUsers(toDB);
System.out.println(toDB.getDb().getSavedUUIDs().toString());
copyWorlds(toDB);
@ -133,6 +133,7 @@ public class BatchOperationTable extends Table {
Log.debug("Batch Copy Servers");
ServerTable serverTable = db.getServerTable();
List<ServerInfo> servers = serverTable.getBukkitServers();
System.out.println(servers.toString());
serverTable.getBungeeInfo().ifPresent(servers::add);
toDB.getDb().getServerTable().insertAllServers(servers);
}

View File

@ -74,4 +74,15 @@ public class ServerInfo {
public int hashCode() {
return Objects.hash(uuid, id, name, webAddress);
}
@Override
public String toString() {
return "ServerInfo{" +
"uuid=" + uuid +
", id=" + id +
", name='" + name + '\'' +
", webAddress='" + webAddress + '\'' +
", maxPlayers=" + maxPlayers +
'}';
}
}