#pragma once
#ifndef __PACKETBUF_H__
#define __PACKETBUF_H__
#pragma pack(push, 0x01)

class PacketBuf
{
public:
	unsigned char UnknownData_0000[0x20000];

public:
	PacketBuf()
	{
		memset(UnknownData_0000, 0, sizeof(UnknownData_0000));
		CallT<PacketBuf *>(base::PacketBuf::PacketBuf_make, this);
	}

	~PacketBuf()
	{
		CallT<int>(base::PacketBuf::PacketBuf_destroy, this);
	}

	static PacketBuf *NewPacketBuf()
	{
		void *v62 = malloc(0x20000);
		if (!v62)
			return NULL;
		return CallT<PacketBuf *>(base::PacketBuf::PacketBuf_make, v62);
	}

	static void DelPacketBuf(PacketBuf *a1)
	{
		CallT<int>(base::PacketBuf::PacketBuf_destroy, a1);
		free(a1);
	}

	int at(int a2)
	{
		return CallT<int>(base::PacketBuf::at, this, a2);
	}

	int bind_packet(char *a2, int a3)
	{
		return CallT<int>(base::PacketBuf::bind_packet, this, a2, a3);
	}

	int clear()
	{
		return CallT<int>(base::PacketBuf::clear, this);
	}

	int clear_ptr()
	{
		return CallT<int>(base::PacketBuf::clear_ptr, this);
	}

	int compress_packet()
	{
		return CallT<int>(base::PacketBuf::compress_packet, this);
	}

	int copy(PacketBuf const &a2)
	{
		return CallT<int>(base::PacketBuf::copy, this, a2);
	}

	int encFinalize()
	{
		return CallT<int>(base::PacketBuf::encFinalize, this);
	}

	int encrypt_packet()
	{
		return CallT<int>(base::PacketBuf::encrypt_packet, this);
	}

	int finalize(bool a2)
	{
		return CallT<int>(base::PacketBuf::finalize, this, a2);
	}

	int getLastError()
	{
		return CallT<int>(base::PacketBuf::getLastError, this);
	}

	int get_binary(char *a2, int a3)
	{
		return CallT<int>(base::PacketBuf::get_binary, this, a2, a3);
	}

	int get_buf_ptr(int a2)
	{
		return CallT<int>(base::PacketBuf::get_buf_ptr, this, a2);
	}

	int get_byte(char *a2)
	{
		return CallT<int>(base::PacketBuf::get_byte, this, a2);
	}

	int get_byte_u(uchar *a2)
	{
		return CallT<int>(base::PacketBuf::get_byte_u, this, a2);
	}

	int get_index()
	{
		return CallT<int>(base::PacketBuf::get_index, this);
	}

	int get_int(int *a2)
	{
		return CallT<int>(base::PacketBuf::get_int, this, a2);
	}

	int get_int_u(uint *a2)
	{
		return CallT<int>(base::PacketBuf::get_int_u, this, a2);
	}

	int get_int_ul(ulong *a2)
	{
		return CallT<int>(base::PacketBuf::get_int_ul, this, a2);
	}

	int get_item_idx(ulong *a2)
	{
		return CallT<int>(base::PacketBuf::get_item_idx, this, a2);
	}

	int get_len()
	{
		return CallT<int>(base::PacketBuf::get_len, this);
	}

	int get_packet(int a2)
	{
		return CallT<int>(base::PacketBuf::get_packet, this, a2);
	}

	int get_short(short *a2)
	{
		return CallT<int>(base::PacketBuf::get_short, this, a2);
	}

	int get_short_u(ushort *a2)
	{
		return CallT<int>(base::PacketBuf::get_short_u, this, a2);
	}

	int get_str(char *a2, int a3, int a4)
	{
		return CallT<int>(base::PacketBuf::get_str, this, a2, a3, a4);
	}

	int isCompressRequired(char *a2)
	{
		return CallT<int>(base::PacketBuf::isCompressRequired, this, a2);
	}

	int isEncryptRequired()
	{
		return CallT<int>(base::PacketBuf::isEncryptRequired, this);
	}

	int is_finallized()
	{
		return CallT<int>(base::PacketBuf::is_finallized, this);
	}

	int is_len_end(int a2)
	{
		return CallT<int>(base::PacketBuf::is_len_end, this, a2);
	}

	int is_ptr_end(int a2, int a3)
	{
		return CallT<int>(base::PacketBuf::is_ptr_end, this, a2, a3);
	}

	int put_binary(char *a2, int a3)
	{
		return CallT<int>(base::PacketBuf::put_binary, this, a2, a3);
	}

	int put_binary_c(char const *a2, int a3)
	{
		return CallT<int>(base::PacketBuf::put_binary_c, this, a2, a3);
	}

	int put_byte(int a2)
	{
		return CallT<int>(base::PacketBuf::put_byte, this, a2);
	}

	int put_header(char a2, short a3)
	{
		return CallT<int>(base::PacketBuf::put_header, this, a2, a3);
	}

	int put_int(int a2)
	{
		return CallT<int>(base::PacketBuf::put_int, this, a2);
	}

	int put_item_idx(ulong a2)
	{
		return CallT<int>(base::PacketBuf::put_item_idx, this, a2);
	}

	int put_packet(Inven_Item const &a2)
	{
		return CallT<int>(base::PacketBuf::put_packet, this, a2);
	}

	int put_short(int a2)
	{
		return CallT<int>(base::PacketBuf::put_short, this, a2);
	}

	int put_str(char *a2, int a3)
	{
		return CallT<int>(base::PacketBuf::put_str, this, a2, a3);
	}

	int put_str_c(char const *a2, int a3)
	{
		return CallT<int>(base::PacketBuf::put_str_c, this, a2, a3);
	}

	int setLastError(int a2)
	{
		return CallT<int>(base::PacketBuf::setLastError, this, a2);
	}

	int set_index(int a2)
	{
		return CallT<int>(base::PacketBuf::set_index, this, a2);
	}

	int set_packet(char const *a2, int a3)
	{
		return CallT<int>(base::PacketBuf::set_packet, this, a2, a3);
	}
};

class InterfacePacketBuf : public PacketBuf
{
public:
	InterfacePacketBuf()
	{
		CallT<int>(base::InterfacePacketBuf::InterfacePacketBuf_make, this);
	}

	~InterfacePacketBuf()
	{
		CallT<int>(base::InterfacePacketBuf::InterfacePacketBuf_destroy, this);
	}

	int AcquirePacketBuf(PacketBuf *a2)
	{
		return CallT<int>(base::InterfacePacketBuf::AcquirePacketBuf, this, a2);
	}

	int bind_packet(char *a2, int a3)
	{
		return CallT<int>(base::InterfacePacketBuf::bind_packet, this, a2, a3);
	}

	int clear()
	{
		return CallT<int>(base::InterfacePacketBuf::clear, this);
	}

	int finalize(bool a2)
	{
		return CallT<int>(base::InterfacePacketBuf::finalize, this, a2);
	}

	int get()
	{
		return CallT<int>(base::InterfacePacketBuf::get, this);
	}

	int getLastError()
	{
		return CallT<int>(base::InterfacePacketBuf::getLastError, this);
	}

	int get_binary(char *a2, int a3)
	{
		return CallT<int>(base::InterfacePacketBuf::get_binary, this, a2, a3);
	}

	int get_index()
	{
		return CallT<int>(base::InterfacePacketBuf::get_index, this);
	}

	int get_int(int *a2)
	{
		return CallT<int>(base::InterfacePacketBuf::get_int, this, a2);
	}

	int get_len()
	{
		return CallT<int>(base::InterfacePacketBuf::get_len, this);
	}

	int get_packet(int a2)
	{
		return CallT<int>(base::InterfacePacketBuf::get_packet, this, a2);
	}

	int get_short(short *a2)
	{
		return CallT<int>(base::InterfacePacketBuf::get_short, this, a2);
	}

	int is_finallized()
	{
		return CallT<int>(base::InterfacePacketBuf::is_finallized, this);
	}

	int put_binary(char *a2, int a3)
	{
		return CallT<int>(base::InterfacePacketBuf::put_binary, this, a2, a3);
	}

	int put_binary_c(char const *a2, int a3)
	{
		return CallT<int>(base::InterfacePacketBuf::put_binary_c, this, a2, a3);
	}

	int put_byte(int a2)
	{
		return CallT<int>(base::InterfacePacketBuf::put_byte, this, a2);
	}

	int put_header(int a2, int a3)
	{
		return CallT<int>(base::InterfacePacketBuf::put_header, this, a2, a3);
	}

	int put_int(int a2)
	{
		return CallT<int>(base::InterfacePacketBuf::put_int, this, a2);
	}

	int put_item_idx(ulong a2)
	{
		return CallT<int>(base::InterfacePacketBuf::put_item_idx, this, a2);
	}

	int put_packet(Inven_Item const &a2)
	{
		return CallT<int>(base::InterfacePacketBuf::put_packet, this, a2);
	}

	int put_short(int a2)
	{
		return CallT<int>(base::InterfacePacketBuf::put_short, this, a2);
	}

	int put_str(char *a2, int a3)
	{
		return CallT<int>(base::InterfacePacketBuf::put_str, this, a2, a3);
	}

	int put_str_c(char const *a2, int a3)
	{
		return CallT<int>(base::InterfacePacketBuf::put_str_c, this, a2, a3);
	}

	int set_index(int a2)
	{
		return CallT<int>(base::InterfacePacketBuf::set_index, this, a2);
	}
};

class PacketGuard
{
public:
	static PacketGuard *NewPacketGuard()
	{
		void *v62 = malloc(0x20000);
		typedef int (*__func)(void *a1);
		if (!v62)
			return NULL;
		((__func)base::PacketGuard::PacketGuard_make)(v62);
		return (PacketGuard *)v62;
	}
	static void DelPacketGuard(PacketGuard *a1)
	{
		typedef int (*__func)(void *a1);
		((__func)base::PacketGuard::PacketGuard_destroy)(a1);
		free(a1);
	}
};

class PacketDispatcher
{
public:
	int getDispatcher(int a2)
	{
		typedef int (*__func)(PacketDispatcher *a1, int a2);
		return ((__func)base::PacketDispatcher::getDispatcher)(this, a2);
	}

	void **get_dispatcher(int a2)
	{
		typedef void **(*__func)(PacketDispatcher *a1, int a2);
		return ((__func)base::PacketDispatcher::get_dispatcher)(this, a2);
	}
};

#pragma pack(pop)

#endif // __PACKETBUF_H__
