31 lines
835 B
C++
31 lines
835 B
C++
#pragma once
|
|
|
|
#include "network/TCPListener.h"
|
|
#include "network/TCPClient.h"
|
|
#include "protocol/Protocol.h"
|
|
#include "NetworkMessage.h"
|
|
|
|
namespace Feather
|
|
{
|
|
class MinecraftClient
|
|
{
|
|
public:
|
|
MinecraftClient(Network::TCPClientHandle&& client);
|
|
~MinecraftClient();
|
|
|
|
inline Network::TCPClientHandle& GetTCPClient() { return m_client; }
|
|
inline Protocol::ProtocolContext& GetContext() { return m_context; }
|
|
|
|
inline const std::string& GetUsername() const { return m_username; }
|
|
inline void SetUsername(const std::string& username) { m_username = username; }
|
|
|
|
void SendMessage(const NetworkMessage& message);
|
|
|
|
private:
|
|
std::string m_username;
|
|
|
|
Network::TCPClientHandle m_client;
|
|
Protocol::ProtocolContext m_context;
|
|
};
|
|
}
|