using log calls
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
#include "game/server/Server.h"
|
||||
#include <iostream>
|
||||
#include "protocol/PacketFactory.h"
|
||||
|
||||
#include "misc/Format.h"
|
||||
|
||||
namespace td {
|
||||
namespace server {
|
||||
|
||||
@@ -44,14 +45,14 @@ void Server::StopThread() {
|
||||
|
||||
bool Server::Start(std::uint16_t port) {
|
||||
if (!m_Listener.Listen(port, 10)) {
|
||||
std::cout << "Failed to bind port " << port << " !\n";
|
||||
utils::LOG(utils::format("Failed to bind port %u !", port));
|
||||
return false;
|
||||
}
|
||||
if (!m_Listener.SetBlocking(false)) {
|
||||
std::cout << "Failed to block server socket !\n";
|
||||
utils::LOG("Failed to block server socket !");
|
||||
return false;
|
||||
}
|
||||
std::cout << "Server started at port " << port << " !\n";
|
||||
utils::LOG(utils::format("Server started at port %u !", port));
|
||||
m_TickCounter.Reset();
|
||||
m_ServerRunning = true;
|
||||
StartThread();
|
||||
@@ -65,7 +66,7 @@ void Server::Clean() {
|
||||
m_Connections.clear();
|
||||
GetPlayers().clear();
|
||||
|
||||
std::cout << "Server successfully stopped !\n";
|
||||
utils::LOG("Server successfully stopped !");
|
||||
}
|
||||
|
||||
void Server::Stop() {
|
||||
|
||||
Reference in New Issue
Block a user