From 0a38ac3043a19dd55fe4fee03adc3eca8b176aed Mon Sep 17 00:00:00 2001 From: Eduardo Dantas Date: Mon, 2 Dec 2024 00:39:28 -0300 Subject: [PATCH] fix: some changes --- src/server/network/connection/connection.cpp | 4 ++-- src/server/network/connection/connection.hpp | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/server/network/connection/connection.cpp b/src/server/network/connection/connection.cpp index 94535f588b0..96af21885cc 100644 --- a/src/server/network/connection/connection.cpp +++ b/src/server/network/connection/connection.cpp @@ -15,6 +15,7 @@ #include "server/network/protocol/protocol.hpp" #include "game/scheduling/dispatcher.hpp" #include "server/network/message/networkmessage.hpp" +#include "server/network/protocol/protocolgame.hpp" #include "server/server.hpp" #include "utils/tools.hpp" @@ -104,8 +105,7 @@ void Connection::closeSocket() { void Connection::accept(Protocol_ptr protocolPtr) { connectionState = CONNECTION_STATE_IDENTIFYING; - protocol = std::move(protocolPtr); - g_dispatcher().addEvent([protocol = protocol] { protocol->sendLoginChallenge(); }, __FUNCTION__, std::chrono::milliseconds(CONNECTION_WRITE_TIMEOUT * 1000).count()); + g_dispatcher().addEvent([protocol = std::move(protocolPtr)] { protocol->sendLoginChallenge(); }, __FUNCTION__, std::chrono::milliseconds(CONNECTION_WRITE_TIMEOUT * 1000).count()); acceptInternal(false); } diff --git a/src/server/network/connection/connection.hpp b/src/server/network/connection/connection.hpp index a40b6e0c018..5a1b94544d1 100644 --- a/src/server/network/connection/connection.hpp +++ b/src/server/network/connection/connection.hpp @@ -12,7 +12,6 @@ #include "declarations.hpp" // TODO: Remove circular includes (maybe shared_ptr?) #include "server/network/message/networkmessage.hpp" -#include "server/network/protocol/protocolgame.hpp" static constexpr int32_t CONNECTION_WRITE_TIMEOUT = 30; static constexpr int32_t CONNECTION_READ_TIMEOUT = 30;