36 lines
920 B
C++
36 lines
920 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(Network::TCPClient& client)
|
|
{
|
|
auto [clients, lock] = m_clients.borrow();
|
|
//clients.erase(std::remove(clients.begin(), clients.end(), client), clients.end());
|
|
}
|
|
}
|