feat: reduce lobby time when debug is active
This commit is contained in:
@@ -5,6 +5,12 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
#ifdef NDEBUG
|
||||||
|
#define MIN_PLAYER_WAITING 2
|
||||||
|
#else
|
||||||
|
#define MIN_PLAYER_WAITING 1
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace td {
|
namespace td {
|
||||||
namespace server {
|
namespace server {
|
||||||
|
|
||||||
@@ -51,7 +57,7 @@ void Lobby::OnPlayerJoin(std::uint8_t playerID) {
|
|||||||
return;
|
return;
|
||||||
std::cout << "(Server) Player Joined Lobby !\n";
|
std::cout << "(Server) Player Joined Lobby !\n";
|
||||||
m_Players.push_back(playerID);
|
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_StartTimerTime = utils::getTime();
|
||||||
m_Timer.reset();
|
m_Timer.reset();
|
||||||
sendTimeRemaining();
|
sendTimeRemaining();
|
||||||
|
|||||||
Reference in New Issue
Block a user