#pragma once

#include "blitz/protocol/Protocol.h"

namespace blitz {
namespace protocol {

class DisconnectPacket : public Packet {
  private:
	std::string m_Reason;  // only when sent from server
  public:
	DisconnectPacket() {}
	DisconnectPacket(std::string reason) : m_Reason(reason) {}
	virtual ~DisconnectPacket() {}

	virtual DataBuffer Serialize(bool packetID = true) const;
	virtual void Deserialize(DataBuffer& data);
	virtual void Dispatch(PacketHandler* handler) const;

	const std::string& GetReason() const {
		return m_Reason;
	}

	virtual PacketType GetType() const {
		return PacketType::Disconnect;
	}
};

}  // namespace protocol
}  // namespace blitz
