diff --git a/engine/Consts.h b/engine/Consts.h index 116b6a4..81be907 100644 --- a/engine/Consts.h +++ b/engine/Consts.h @@ -30,7 +30,7 @@ namespace Consts { const double TAP_DELAY = 0.2; const unsigned NETWORK_VERSION = 1U; - const int NETWORK_TIMEOUT = 1U; + const int NETWORK_TIMEOUT = 5U; const int NETWORK_WORLD_UPDATE_RATE = 30; const double NETWORK_RELIABLE_RETRY_TIME = 1.0/20; const uint16_t NETWORK_MAX_CLIENTS = 64; diff --git a/engine/network/ClientUDP.cpp b/engine/network/ClientUDP.cpp index 46a22a7..05ec623 100644 --- a/engine/network/ClientUDP.cpp +++ b/engine/network/ClientUDP.cpp @@ -12,6 +12,7 @@ ClientUDP::ClientUDP() : _lastBroadcast(-std::numeric_limits::max()), _working(false) { + // TODO: replace this with lambda _socket.setTimeoutCallback(std::bind(&ClientUDP::timeout, this, std::placeholders::_1)); }