mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Network: Minor include cleanup in SocketConnectionInitializer related files
This commit is contained in:
@@ -17,6 +17,8 @@
|
||||
|
||||
#include "IpBanCheckConnectionInitializer.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "IpAddress.h"
|
||||
#include "Log.h"
|
||||
|
||||
QueryCallback Trinity::Net::IpBanCheckHelpers::AsyncQuery(boost::asio::ip::address const& ipAddress)
|
||||
{
|
||||
@@ -40,3 +42,8 @@ bool Trinity::Net::IpBanCheckHelpers::IsBanned(PreparedQueryResult const& result
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void Trinity::Net::IpBanCheckHelpers::LogFailure(boost::asio::ip::address const& ipAddress)
|
||||
{
|
||||
TC_LOG_ERROR("network", "IpBanCheckConnectionInitializer: IP {} is banned.", ipAddress);
|
||||
}
|
||||
|
||||
@@ -18,9 +18,8 @@
|
||||
#ifndef TRINITYCORE_IP_BAN_CHECK_CONNECTION_INITIALIZER_H
|
||||
#define TRINITYCORE_IP_BAN_CHECK_CONNECTION_INITIALIZER_H
|
||||
|
||||
#include "AsioHacksFwd.h"
|
||||
#include "DatabaseEnvFwd.h"
|
||||
#include "IpAddress.h"
|
||||
#include "Log.h"
|
||||
#include "QueryCallback.h"
|
||||
#include "SocketConnectionInitializer.h"
|
||||
|
||||
@@ -30,6 +29,7 @@ namespace IpBanCheckHelpers
|
||||
{
|
||||
TC_SHARED_API QueryCallback AsyncQuery(boost::asio::ip::address const& ipAddress);
|
||||
TC_SHARED_API bool IsBanned(PreparedQueryResult const& result);
|
||||
TC_SHARED_API void LogFailure(boost::asio::ip::address const& ipAddress);
|
||||
}
|
||||
|
||||
template <typename SocketImpl>
|
||||
@@ -47,13 +47,12 @@ struct IpBanCheckConnectionInitializer final : SocketConnectionInitializer
|
||||
|
||||
if (IpBanCheckHelpers::IsBanned(result))
|
||||
{
|
||||
TC_LOG_ERROR("network", "IpBanCheckConnectionInitializer: IP {} is banned.", socket->GetRemoteIpAddress());
|
||||
IpBanCheckHelpers::LogFailure(socket->GetRemoteIpAddress());
|
||||
socket->CloseSocket();
|
||||
return;
|
||||
}
|
||||
|
||||
if (self->next)
|
||||
self->next->Start();
|
||||
self->InvokeNext();
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user