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