package org.kne.cloud.network.minecraft;

import java.io.IOException;

import org.kne.io.VarDataInputStream;
import org.kne.io.VarDataOutputStream;

public class MinecraftPingPacket extends MinecraftPacket{
	private long time;
	public long getTime() {
		return time;
	}
	public MinecraftPingPacket() {
		super(PING_PONG);
	}
	public MinecraftPingPacket( long time) {
		super(PING_PONG);
		this.time = time;
	}
	@Override
	public String toString() {
		return "MinecraftPingPacket [time=" + time + "]";
	}
	@Override
	protected void writeToStream(VarDataOutputStream dto) throws IOException {
		super.writeToStream(dto);
		dto.writeLong(time);
	}
	@Override
	protected void readFromStream(VarDataInputStream din) throws IOException {
		super.readFromStream(din);
		time=din.readLong();
	}
	
}
