|
|
|
@ -8,14 +8,14 @@ import org.springframework.context.annotation.Scope; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
import java.time.Instant; |
|
|
|
import java.time.LocalDate; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.*; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
@Data |
|
|
|
@Component |
|
|
|
@Scope(value = "singleton") |
|
|
|
public class Stats { |
|
|
|
private static final List<String> WHITELIST = List.of("United States", "Israel", "Ukraine", "Belarus", "Russia", "Kazakhstan"); |
|
|
|
long ban_count = 0; |
|
|
|
int discord_users = 0; |
|
|
|
long freevip_players = 0; |
|
|
|
@ -96,9 +96,17 @@ public class Stats { |
|
|
|
return new HashMap<>() {{ |
|
|
|
countries.forEach((name, count) -> { |
|
|
|
if (name != null && count != null && count > 0) { |
|
|
|
put(name, count); |
|
|
|
if (WHITELIST.contains(name)) |
|
|
|
put(name, count); |
|
|
|
else |
|
|
|
merge("Other world", count, Integer::sum); |
|
|
|
} |
|
|
|
}); |
|
|
|
}}; |
|
|
|
} |
|
|
|
|
|
|
|
@JsonIgnore |
|
|
|
public HashMap<String, Integer> getCountriesWriter() { |
|
|
|
return countries; |
|
|
|
} |
|
|
|
} |
|
|
|
|