package common.packet;

import java.io.IOException;
import common.network.IClientLoginHandler;
import common.network.Packet;
import common.network.PacketBuffer;

public class RPacketChallenge implements Packet<IClientLoginHandler> {
	private byte[] token;

	public RPacketChallenge() {
	}

	public RPacketChallenge(byte[] token) {
		this.token = token;
	}

	public final void readPacketData(PacketBuffer buf) throws IOException {
		this.token = buf.readByteArray();
	}

	public final void writePacketData(PacketBuffer buf) throws IOException {
		buf.writeByteArray(this.token);
	}

	public void processPacket(IClientLoginHandler handler) {
		handler.handleChallenge(this);
	}

	public byte[] getToken() {
		return this.token;
	}
}
