You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

43 lines
1.1 KiB

#pragma once
#include "MinecraftClient.h"
#include "ServerStatus.h"
#include "config/ServerProperties.h"
#include "protocol/Protocol.h"
#include "PacketReader.h"
//#include "JobManager.h"
#include "world/WorldManager.h"
#include "network/IListenerInterface.h"
namespace Feather
{
class DedicatedServer final : public Network::IListenerInterface
{
public:
DedicatedServer(Config::ServerProperties* properties);
~DedicatedServer();
void OnClientConnect(Network::TCPClientHandle&& client) override;
void OnClientDisconnect(const Network::TCPClient* client) override;
void HandleLegacyPing(MinecraftClient& client);
template <typename T>
void HandlePacket(MinecraftClient& client, const T& message);
void HandleUnknownPacket(MinecraftClient& client, int32_t id, const PacketReader& packet);
private:
Config::ServerProperties* m_properties;
Network::TCPListener m_listener;
ServerStatus m_status;
LockableList<MinecraftClient> m_clients;
WorldManager m_worldManager;
//JobRunner m_jobRunner;
};
}