package common.packet;

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

public class LPacketChallenge implements Packet<ILoginHandler> {
	private byte[] token;

	public LPacketChallenge() {
	}

	public LPacketChallenge(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(ILoginHandler handler) {
		handler.processChallenge(this);
	}

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