Skip to content

Commit

Permalink
fix: some changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dudantas committed Dec 2, 2024
1 parent 0879a56 commit 0a38ac3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/server/network/connection/connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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);
}
Expand Down
1 change: 0 additions & 1 deletion src/server/network/connection/connection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0a38ac3

Please sign in to comment.