Added version type

This commit is contained in:
Anuken
2018-09-04 12:10:48 -04:00
parent 063893adee
commit 26ae4edd63
8 changed files with 30 additions and 20 deletions

View File

@@ -7,13 +7,15 @@ public class Host{
public final int wave;
public final int players;
public final int version;
public final String versionType;
public Host(String name, String address, String mapname, int wave, int players, int version){
public Host(String name, String address, String mapname, int wave, int players, int version, String versionType){
this.name = name;
this.address = address;
this.players = players;
this.mapname = mapname;
this.wave = wave;
this.version = version;
this.versionType = versionType;
}
}

View File

@@ -310,6 +310,8 @@ public class NetworkIO{
buffer.putInt(playerGroup.size());
buffer.putInt(state.wave);
buffer.putInt(Version.build);
buffer.put((byte)Version.type.getBytes().length);
buffer.put(Version.type.getBytes());
return buffer;
}
@@ -328,7 +330,11 @@ public class NetworkIO{
int players = buffer.getInt();
int wave = buffer.getInt();
int version = buffer.getInt();
byte tlength = buffer.get();
byte[] tb = new byte[tlength];
buffer.get(tb);
String vertype = new String(tb);
return new Host(host, hostAddress, map, wave, players, version);
return new Host(host, hostAddress, map, wave, players, version, vertype);
}
}