33 lines
767 B
C++
33 lines
767 B
C++
#pragma once
|
|
|
|
#include "MinecraftClient.h"
|
|
#include "ServerStatus.h"
|
|
#include "Protocol.h"
|
|
|
|
#include "network/IListenerInterface.h"
|
|
|
|
namespace Feather
|
|
{
|
|
class ServerProperties;
|
|
|
|
class DedicatedServer final : public Network::IListenerInterface
|
|
{
|
|
public:
|
|
DedicatedServer(ServerProperties* properties);
|
|
~DedicatedServer();
|
|
|
|
void OnClientConnect(Network::TCPClient&& client) override;
|
|
void OnClientDisconnect(const Network::TCPClient& client) override;
|
|
|
|
ServerStatus& GetStatus() { return m_status; }
|
|
|
|
private:
|
|
ServerProperties* m_properties;
|
|
Network::TCPListener m_listener;
|
|
ServerStatus m_status;
|
|
Protocol m_protocol;
|
|
|
|
LockableList<MinecraftClient> m_clients;
|
|
};
|
|
}
|