FeatherMC/src/Protocol.h

41 lines
840 B
C
Raw Normal View History

#pragma once
2020-08-01 02:36:29 +01:00
#include "Common.h"
#include "NetworkMessage.h"
2020-08-02 02:44:35 +01:00
#include "protocol/ProtocolDefinitions.h"
2020-08-01 00:55:47 +01:00
#include <cstdio>
2020-08-01 22:53:02 +01:00
#include <cstdint>
namespace Feather
{
2020-08-01 02:36:29 +01:00
class DedicatedServer;
class PacketReader;
class MinecraftClient;
class ProtocolContext
{
public:
inline ProtocolState GetState() const
{
return m_state;
}
inline void SetState(ProtocolState state)
{
2020-08-01 02:36:29 +01:00
Log_Info("Setting state: %d", (int)state);
m_state = state;
}
private:
ProtocolState m_state = ProtocolState::Handholding;
};
class Protocol
{
2020-08-01 02:36:29 +01:00
DedicatedServer& m_server;
public:
2020-08-01 02:36:29 +01:00
Protocol(DedicatedServer& server) : m_server(server) {}
void HandlePacket(MinecraftClient& client, PacketReader& packet);
};
2020-08-01 00:55:47 +01:00
}