Skip to content

Commit

Permalink
Update NationUpdateProcessor.java
Browse files Browse the repository at this point in the history
  • Loading branch information
xdnw committed Aug 19, 2024
1 parent 011cd26 commit 66add90
Showing 1 changed file with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,7 @@

import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.AbstractMap;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
import java.util.function.BiConsumer;
Expand Down Expand Up @@ -749,7 +741,10 @@ private static void checkExodus(DBNation previous, DBNation current) {
long now = System.currentTimeMillis();
long cutoff = now - TimeUnit.DAYS.toMillis(1);
List<AllianceChange> removes = new ArrayList<>(alliance.getRankChanges(cutoff));
Map<Integer, AllianceChange> changesByNation = removes.stream().collect(Collectors.toMap(AllianceChange::getNationId, f -> f));
Map<Integer, AllianceChange> changesByNation = new LinkedHashMap<>();
for (AllianceChange change : removes) {
changesByNation.put(change.getNationId(), change);
}
changesByNation.put(current.getNation_id(), new AllianceChange(previous, current, now));

for (Map.Entry<Integer, AllianceChange> entry : changesByNation.entrySet()) {
Expand Down

0 comments on commit 66add90

Please sign in to comment.