feat: reduce lobby time when debug is active

This commit is contained in:
2021-09-19 18:27:56 +02:00
parent 13c8303c90
commit 37f76a3e78

View File

@@ -5,6 +5,12 @@
#include <iostream>
#ifdef NDEBUG
#define MIN_PLAYER_WAITING 2
#else
#define MIN_PLAYER_WAITING 1
#endif
namespace td {
namespace server {
@@ -51,7 +57,7 @@ void Lobby::OnPlayerJoin(std::uint8_t playerID) {
return;
std::cout << "(Server) Player Joined Lobby !\n";
m_Players.push_back(playerID);
if (m_Players.size() == 2) { // start timer if a second player join the match
if (m_Players.size() == MIN_PLAYER_WAITING) { // start timer if a second player join the match
m_StartTimerTime = utils::getTime();
m_Timer.reset();
sendTimeRemaining();