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)) .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", placeholders.register("player_time_active",
player -> time.apply(SessionsMutator.forContainer(player) player -> time.apply(SessionsMutator.forContainer(player)
.toActivePlaytime()) .toActivePlaytime())
@ -207,25 +231,5 @@ public class PlayerPlaceHolders implements Placeholders {
.filterPlayedOnServer(serverInfo.getServerUUID()) .filterPlayedOnServer(serverInfo.getServerUUID())
.toPlaytime()) .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(), config(),
new Locale(), new Locale(),
dbSystem(), dbSystem(),
new QuerySvc(dbSystem(), serverInfo(), null), new QuerySvc(config(), dbSystem(), serverInfo(), null),
serverInfo(), serverInfo(),
logger, logger,
null null