Fixed build errors

This commit is contained in:
Risto Lahtela 2021-01-20 17:59:45 +02:00
parent edddccf329
commit 6758a56167
2 changed files with 25 additions and 21 deletions

View File

@ -136,6 +136,30 @@ public class PlayerPlaceHolders implements Placeholders {
.orElse((long) 0))
);
registerPlaytimePlaceholders(placeholders, time);
placeholders.register("player_favorite_server",
player -> PerServerMutator.forContainer(player).favoriteServer()
.flatMap(serverUUID -> dbSystem.getDatabase().query(ServerQueries.fetchServerMatchingIdentifier(serverUUID)))
.map(Server::getName)
.orElse("-")
);
placeholders.register("player_activity_index",
player -> player.getActivityIndex(
now(),
config.get(TimeSettings.ACTIVE_PLAY_THRESHOLD)
).getValue()
);
placeholders.register("player_activity_group",
player -> player.getActivityIndex(
now(),
config.get(TimeSettings.ACTIVE_PLAY_THRESHOLD)
).getGroup()
);
}
private void registerPlaytimePlaceholders(PlanPlaceholders placeholders, Formatter<Long> time) {
placeholders.register("player_time_active",
player -> time.apply(SessionsMutator.forContainer(player)
.toActivePlaytime())
@ -207,25 +231,5 @@ public class PlayerPlaceHolders implements Placeholders {
.filterPlayedOnServer(serverInfo.getServerUUID())
.toPlaytime())
);
placeholders.register("player_favorite_server",
player -> PerServerMutator.forContainer(player).favoriteServer()
.flatMap(serverUUID -> dbSystem.getDatabase().query(ServerQueries.fetchServerMatchingIdentifier(serverUUID)))
.map(Server::getName)
.orElse("-")
);
placeholders.register("player_activity_index",
player -> player.getActivityIndex(
now(),
config.get(TimeSettings.ACTIVE_PLAY_THRESHOLD)
).getValue()
);
placeholders.register("player_activity_group",
player -> player.getActivityIndex(
now(),
config.get(TimeSettings.ACTIVE_PLAY_THRESHOLD)
).getGroup()
);
}
}

View File

@ -134,7 +134,7 @@ public interface DatabaseTest extends DatabaseTestPreparer {
config(),
new Locale(),
dbSystem(),
new QuerySvc(dbSystem(), serverInfo(), null),
new QuerySvc(config(), dbSystem(), serverInfo(), null),
serverInfo(),
logger,
null