Bridge-protocol: изменен тип данных для TPS
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user