FeatherMC/src/DedicatedServer.cpp

36 lines
865 B
C++

#include "DedicatedServer.h"
#include "config/ServerProperties.h"
namespace Feather
{
DedicatedServer::DedicatedServer(ServerProperties* properties) :
m_properties(properties),
m_listener(properties->serverPort.GetValue(), this),
m_status()
{
m_status.descriptionText = properties->motd.GetValue();
m_status.maxPlayers = properties->maxPlayers.GetValue();
while (1)
{
}
}
DedicatedServer::~DedicatedServer()
{
}
void DedicatedServer::OnClientConnect(Network::TCPClient&& client)
{
auto [clients, lock] = m_clients.borrow();
clients.emplace_back(std::move(client));
}
void DedicatedServer::OnClientDisconnect(const Network::TCPClient& client)
{
auto [clients, lock] = m_clients.borrow();
clients.remove(client);
}
}