use of com.djrapitops.plan.identification.ServerUUID in project Plan by plan-player-analytics.
the class NetworkConfigStoreTask method updateDBConfigs.
private void updateDBConfigs() {
File[] configFiles = networkSettingManager.getConfigFiles();
for (File configFile : configFiles) {
ServerUUID serverUUID = NetworkSettingManager.getServerUUIDFromFilename(configFile);
networkSettingManager.updateConfigInDB(configFile, serverUUID);
}
}
use of com.djrapitops.plan.identification.ServerUUID in project Plan by plan-player-analytics.
the class NetworkSettingManager method updateConfigFromDBIfUpdated.
private void updateConfigFromDBIfUpdated() {
Database database = dbSystem.getDatabase();
Set<ServerUUID> serverUUIDs = database.query(ServerQueries.fetchPlanServerInformation()).keySet();
// Remove the proxy server from the list
serverUUIDs.remove(serverInfo.getServerUUID());
for (ServerUUID serverUUID : serverUUIDs) {
updateConfigFromDBIfUpdated(database, serverUUID);
}
}
use of com.djrapitops.plan.identification.ServerUUID in project Plan by plan-player-analytics.
the class NetworkSettingManager method addFileToWatchList.
private void addFileToWatchList(FileWatcher fileWatcher, File file) {
try {
ServerUUID serverUUID = getServerUUIDFromFilename(file);
fileWatcher.addToWatchlist(new WatchedFile(file, () -> updateConfigInDB(file, serverUUID)));
} catch (IndexOutOfBoundsException | IllegalArgumentException ignore) {
/* Invalid file-name, ignored */
}
}
use of com.djrapitops.plan.identification.ServerUUID in project Plan by plan-player-analytics.
the class WorldObj method applyPatch.
@Override
protected void applyPatch() {
Collection<ServerUUID> serverUUIDs = query(ServerQueries.fetchPlanServerInformation()).keySet();
Map<ServerUUID, Collection<String>> worldsPerServer = new HashMap<>();
for (ServerUUID serverUUID : serverUUIDs) {
worldsPerServer.put(serverUUID, getWorldNamesOld(serverUUID));
}
execute(LargeStoreQueries.storeAllWorldNames(worldsPerServer));
updateWorldTimesTableWorldIDs();
executeSwallowingExceptions(DELETE_FROM + WorldTable.TABLE_NAME + WHERE + "server_id=0");
}
use of com.djrapitops.plan.identification.ServerUUID in project Plan by plan-player-analytics.
the class KillsTable method addSessionKillsToBatch.
public static void addSessionKillsToBatch(PreparedStatement statement, FinishedSession session) throws SQLException {
UUID playerUUID = session.getPlayerUUID();
ServerUUID serverUUID = session.getServerUUID();
Optional<PlayerKills> playerKills = session.getExtraData().get(PlayerKills.class);
if (!playerKills.isPresent())
return;
for (PlayerKill kill : playerKills.get().asList()) {
// Session ID select statement parameters
statement.setString(1, playerUUID.toString());
statement.setString(2, serverUUID.toString());
statement.setLong(3, session.getStart());
statement.setLong(4, session.getEnd());
// Kill data
statement.setString(5, playerUUID.toString());
statement.setString(6, kill.getVictim().getUuid().toString());
statement.setString(7, serverUUID.toString());
statement.setLong(8, kill.getDate());
statement.setString(9, StringUtils.truncate(kill.getWeapon(), WEAPON_COLUMN_LENGTH));
statement.addBatch();
}
}
Aggregations