Skip to content

Commit

Permalink
sending ZoneMessages in order, for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
Zomis committed Aug 23, 2015
1 parent 91f74ab commit e91fdfd
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.time.Instant;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
Expand Down Expand Up @@ -355,7 +356,10 @@ private void startECSGame() {
plData.setName(pl.getName());
this.send(new PlayerMessage(playerEntity.getId(), plData.getIndex(), plData.getName(), Resources.map(playerEntity)));
});
this.game.findEntities(e -> true).stream().flatMap(e -> e.getSuperComponents(ZoneComponent.class).stream()).forEach(this::sendZone);
this.game.findEntities(e -> true).stream()
.flatMap(e -> e.getSuperComponents(ZoneComponent.class).stream())
.sorted(Comparator.comparingInt(ZoneComponent::getZoneId))
.forEach(this::sendZone);
this.sendAvailableActions();
}

Expand Down

0 comments on commit e91fdfd

Please sign in to comment.