From 0cb7276943208dc86c2a0e06dc2e3d94ffc4375c Mon Sep 17 00:00:00 2001 From: Vectozavr <60608292+vectozavr@users.noreply.github.com> Date: Mon, 25 Oct 2021 18:51:34 +0700 Subject: [PATCH] small refactor --- engine/Consts.h | 2 +- engine/network/ClientUDP.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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)); }