Added version type
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user