Archived
0

Bridge-protocol: изменен тип данных для TPS

This commit is contained in:
2017-05-01 12:26:12 +03:00
parent 476c59ca43
commit 835900260d
2 changed files with 6 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
group = 'asys' group = 'asys'
version = '0.1-SNAPSHOT' version = '0.2-SNAPSHOT'
task jar(type: Jar, overwrite: true) { task jar(type: Jar, overwrite: true) {
// не собирать jar // не собирать jar

View File

@@ -8,13 +8,13 @@ import io.netty.buffer.ByteBuf;
public class CS_Ping extends Packet { public class CS_Ping extends Packet {
private long time; private long time;
private int tps; private double tps;
private int countPlayers; private int countPlayers;
public CS_Ping() { public CS_Ping() {
} }
public CS_Ping(long time, int tps, int countPlayers) { public CS_Ping(long time, double tps, int countPlayers) {
this.time = time; this.time = time;
this.tps = tps; this.tps = tps;
this.countPlayers = countPlayers; this.countPlayers = countPlayers;
@@ -24,7 +24,7 @@ public class CS_Ping extends Packet {
return time; return time;
} }
public int getTps() { public double getTps() {
return tps; return tps;
} }
@@ -35,14 +35,14 @@ public class CS_Ping extends Packet {
@Override @Override
public void readSelfData(ByteBuf buffer) { public void readSelfData(ByteBuf buffer) {
this.time = buffer.readLong(); this.time = buffer.readLong();
this.tps = buffer.readUnsignedByte(); this.tps = buffer.readDouble();
this.countPlayers = buffer.readUnsignedShort(); this.countPlayers = buffer.readUnsignedShort();
} }
@Override @Override
public void writeSelfData(ByteBuf buffer) { public void writeSelfData(ByteBuf buffer) {
buffer.writeLong(time); buffer.writeLong(time);
buffer.writeByte(tps); buffer.writeDouble(tps);
buffer.writeShort(countPlayers); buffer.writeShort(countPlayers);
} }
} }