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 " + statement = prepareStatement("SELECT " +
columnCommand + ", " + columnCommand + ", " +
columnTimesUsed + ", " + columnTimesUsed + ", " +
serverUUIDColumn + ", " + serverUUIDColumn +
" FROM " + tableName + " FROM " + tableName +
" JOIN " + serverTable + " on " + serverIDColumn + "=" + columnServerID " JOIN " + serverTable + " on " + serverIDColumn + "=" + columnServerID
); );

View File

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

View File

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

View File

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

View File

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