Added missing PING to PlayerContainer when a single player was fetched.

This commit is contained in:
Rsl1122 2018-07-16 18:42:36 +03:00
parent 60592c62e9
commit 62221b1582
2 changed files with 11 additions and 1 deletions

View File

@ -278,6 +278,7 @@ public class SQLFetchOps extends SQLOps implements FetchOperations {
container.putAll(usersTable.getUserInformation(uuid));
container.putSupplier(PlayerKeys.GEO_INFO, () -> geoInfoTable.getGeoInfo(uuid));
container.putSupplier(PlayerKeys.PING, () -> pingTable.getPing(uuid));
container.putSupplier(PlayerKeys.NICKNAMES, () -> nicknamesTable.getNicknameInformation(uuid));
container.putSupplier(PlayerKeys.PER_SERVER, () -> getPerServerData(uuid));

View File

@ -589,6 +589,7 @@ public class SQLiteTest {
assertTrue(db.getWorldTable().getAllWorlds().isEmpty());
assertTrue(tpsTable.getTPSData().isEmpty());
assertTrue(db.getServerTable().getBukkitServers().isEmpty());
assertTrue(db.getPingTable().getAllPings().isEmpty());
assertTrue(securityTable.getUsers().isEmpty());
}
@ -601,6 +602,7 @@ public class SQLiteTest {
GeoInfoTable geoInfoTable = database.getGeoInfoTable();
TPSTable tpsTable = database.getTpsTable();
SecurityTable securityTable = database.getSecurityTable();
PingTable pingTable = database.getPingTable();
saveUserOne(database);
saveUserTwo(database);
@ -644,6 +646,11 @@ public class SQLiteTest {
tpsTable.insertTPS(tps);
}
pingTable.insertPing(playerUUID, new Ping(
System.currentTimeMillis(), TestConstants.SERVER_UUID,
r.nextInt(), r.nextInt(), r.nextDouble()
));
securityTable.addNewUser(new WebUser("Test", "RandomGarbageBlah", 0));
System.out.println("Done!\n");
}
@ -747,8 +754,10 @@ public class SQLiteTest {
saveAllData(db);
System.out.println("Running backup..");
db.backup().backup(backup);
System.out.println("Backup Complete!");
UserInfoTable userInfoTable = backup.getUserInfoTable();
UsersTable usersTable = backup.getUsersTable();
SessionsTable sessionsTable = backup.getSessionsTable();