using log calls

This commit is contained in:
2022-07-14 18:32:32 +02:00
parent 66376eaeda
commit d6fbb58da8
8 changed files with 39 additions and 38 deletions

View File

@@ -3,8 +3,6 @@
#include "misc/Time.h"
#include <iostream>
#ifdef NDEBUG
#define MIN_PLAYER_WAITING 2
#else
@@ -53,7 +51,7 @@ void Lobby::SendTimeRemaining() {
void Lobby::OnPlayerJoin(std::uint8_t playerID) {
if (m_GameStarted)
return;
std::cout << "(Server) Player Joined Lobby !\n";
utils::LOG("(Server) Player Joined Lobby !");
m_Players.push_back(playerID);
if (m_Players.size() == MIN_PLAYER_WAITING) { // start timer if a second player join the match
m_StartTimerTime = utils::GetTime();
@@ -65,7 +63,7 @@ void Lobby::OnPlayerJoin(std::uint8_t playerID) {
void Lobby::OnPlayerLeave(std::uint8_t playerID) {
if (m_GameStarted)
return;
std::cout << "(Server) Player Leaved Lobby !\n";
utils::LOG("(Server) Player Leaved Lobby !");
auto it = std::find(m_Players.begin(), m_Players.end(), playerID);
if (it == m_Players.end())