2020-07-31 02:53:40 +01:00
|
|
|
#pragma once
|
|
|
|
|
2020-08-01 02:36:29 +01:00
|
|
|
#include "Common.h"
|
2020-07-31 02:53:40 +01:00
|
|
|
#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>
|
2020-07-31 02:53:40 +01:00
|
|
|
|
|
|
|
namespace Feather
|
|
|
|
{
|
|
|
|
class PacketReader;
|
|
|
|
class MinecraftClient;
|
2020-08-03 06:07:32 +01:00
|
|
|
class DedicatedServer;
|
|
|
|
}
|
2020-07-31 02:53:40 +01:00
|
|
|
|
2020-08-03 06:07:32 +01:00
|
|
|
namespace Feather::Protocol
|
|
|
|
{
|
2020-07-31 02:53:40 +01:00
|
|
|
class ProtocolContext
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
inline ProtocolState GetState() const
|
|
|
|
{
|
|
|
|
return m_state;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void SetState(ProtocolState state)
|
|
|
|
{
|
2020-08-07 06:23:12 +01:00
|
|
|
Log::Info("Setting state: {}", (int)state);
|
2020-07-31 02:53:40 +01:00
|
|
|
m_state = state;
|
|
|
|
}
|
|
|
|
private:
|
|
|
|
ProtocolState m_state = ProtocolState::Handholding;
|
|
|
|
};
|
2020-08-01 00:55:47 +01:00
|
|
|
}
|