add server
This commit is contained in:
parent
d5269922b9
commit
76ecfb39ab
25 changed files with 603 additions and 520 deletions
34
java/src/game/packet/SPacketServerTick.java
Normal file
34
java/src/game/packet/SPacketServerTick.java
Normal file
|
@ -0,0 +1,34 @@
|
|||
package game.packet;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
|
||||
public class SPacketServerTick implements Packet<ClientPlayer> {
|
||||
private int time;
|
||||
|
||||
public SPacketServerTick() {
|
||||
}
|
||||
|
||||
public SPacketServerTick(int time) {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
public void readPacketData(PacketBuffer buf) throws IOException {
|
||||
this.time = buf.readInt();
|
||||
}
|
||||
|
||||
public void writePacketData(PacketBuffer buf) throws IOException {
|
||||
buf.writeInt(this.time);
|
||||
}
|
||||
|
||||
public void processPacket(ClientPlayer handler) {
|
||||
handler.handleServerTick(this);
|
||||
}
|
||||
|
||||
public int getTime() {
|
||||
return this.time;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue