Fixed #4616
This commit is contained in:
@@ -396,7 +396,6 @@ public class NetClient implements ApplicationListener{
|
||||
netClient.byteStream.setBytes(net.decompressSnapshot(data, dataLen));
|
||||
DataInputStream input = netClient.dataStream;
|
||||
|
||||
//go through each entity
|
||||
for(int j = 0; j < amount; j++){
|
||||
int id = input.readInt();
|
||||
byte typeID = input.readByte();
|
||||
|
||||
@@ -845,13 +845,15 @@ public class NetServer implements ApplicationListener{
|
||||
|
||||
public void writeEntitySnapshot(Player player) throws IOException{
|
||||
syncStream.reset();
|
||||
Seq<CoreBuild> cores = state.teams.cores(player.team());
|
||||
int sum = state.teams.present.sum(t -> t.cores.size);
|
||||
|
||||
dataStream.writeByte(cores.size);
|
||||
dataStream.writeByte(sum);
|
||||
|
||||
for(CoreBuild entity : cores){
|
||||
dataStream.writeInt(entity.tile.pos());
|
||||
entity.items.write(Writes.get(dataStream));
|
||||
for(TeamData data : state.teams.present){
|
||||
for(CoreBuild entity : data.cores){
|
||||
dataStream.writeInt(entity.tile.pos());
|
||||
entity.items.write(Writes.get(dataStream));
|
||||
}
|
||||
}
|
||||
|
||||
dataStream.close();
|
||||
|
||||
Reference in New Issue
Block a user