Fixed server connect crash

This commit is contained in:
Anuken 2018-09-02 11:22:05 -04:00
parent 56ae47cd8d
commit 99e54cc214
4 changed files with 4 additions and 6 deletions

View File

@ -482,7 +482,7 @@ public class NetServer extends Module{
//check for syncable groups
for(EntityGroup<?> group : Entities.getAllGroups()){
//TODO range-check sync positions to optimize?
//TODO screen-check sync positions to optimize?
if(group.isEmpty() || !(group.all().get(0) instanceof SyncTrait)) continue;
//make sure mapping is enabled for this group

View File

@ -121,7 +121,7 @@ public class NetworkIO{
//write team data
for(Team team : Team.all){
TeamData data = state.teams.get(team);
stream.writeByte(data.team.ordinal());
stream.writeByte(team.ordinal());
stream.writeByte(data.enemies.size());
for(Team enemy : data.enemies){
@ -173,8 +173,6 @@ public class NetworkIO{
int wave = stream.readInt();
float wavetime = stream.readFloat();
boolean friendlyfire = stream.readBoolean();
state.wave = wave;
state.wavetime = wavetime;
state.mode = GameMode.values()[mode];

View File

@ -232,7 +232,7 @@ public class JoinDialog extends FloatingDialog{
button.update(() -> button.getStyle().imageUpColor = player.color);
}).width(w).height(70f).pad(4);
content().row();
content().add(pane).width(w + 38).pad(0).padRight(22);
content().add(pane).width(w + 38).pad(0);
content().row();
content().addCenteredImageTextButton("$text.server.add", "icon-add", "clear", 14 * 3, () -> {
renaming = null;

View File

@ -123,7 +123,7 @@ public class ServerControl extends Module{
play(true, () -> world.loadMap(fmap));
}
}else{
Call.onInfoMessage("Sector has been lost.\nRe-deploying in " + roundExtraTime + " seconds.");
Call.onInfoMessage("[SCARLET]Sector has been lost.[]\nRe-deploying in " + roundExtraTime + " seconds.");
if(gameOvers >= 2){
Settings.putInt("sector_y", Settings.getInt("sector_y") < 0 ? Settings.getInt("sector_y") + 1 : Settings.getInt("sector_y") - 1);
Settings.save();