mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-25 06:36:24 +00:00
refactor(Core/Network): Port TrinityCore socket optimizations (#24384)
Co-authored-by: blinkysc <blinkysc@users.noreply.github.com> Co-authored-by: Shauren <shauren@users.noreply.github.com>
This commit is contained in:
@@ -162,7 +162,7 @@ void AccountInfo::LoadResult(Field* fields)
|
||||
Utf8ToUpperOnlyLatin(Login);
|
||||
}
|
||||
|
||||
AuthSession::AuthSession(tcp::socket&& socket) :
|
||||
AuthSession::AuthSession(IoContextTcpSocket&& socket) :
|
||||
Socket(std::move(socket)), _status(STATUS_CHALLENGE), _build(0), _expversion(0) { }
|
||||
|
||||
void AuthSession::Start()
|
||||
@@ -216,7 +216,7 @@ void AuthSession::CheckIpCallback(PreparedQueryResult result)
|
||||
AsyncRead();
|
||||
}
|
||||
|
||||
void AuthSession::ReadHandler()
|
||||
SocketReadCallbackResult AuthSession::ReadHandler()
|
||||
{
|
||||
MessageBuffer& packet = GetReadBuffer();
|
||||
|
||||
@@ -234,7 +234,7 @@ void AuthSession::ReadHandler()
|
||||
if (_status != itr->second.status)
|
||||
{
|
||||
CloseSocket();
|
||||
return;
|
||||
return SocketReadCallbackResult::Stop;
|
||||
}
|
||||
|
||||
uint16 size = uint16(itr->second.packetSize);
|
||||
@@ -248,7 +248,7 @@ void AuthSession::ReadHandler()
|
||||
if (size > MAX_ACCEPTED_CHALLENGE_SIZE)
|
||||
{
|
||||
CloseSocket();
|
||||
return;
|
||||
return SocketReadCallbackResult::Stop;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -258,13 +258,13 @@ void AuthSession::ReadHandler()
|
||||
if (!(*this.*itr->second.handler)())
|
||||
{
|
||||
CloseSocket();
|
||||
return;
|
||||
return SocketReadCallbackResult::Stop;
|
||||
}
|
||||
|
||||
packet.ReadCompleted(size);
|
||||
}
|
||||
|
||||
AsyncRead();
|
||||
return SocketReadCallbackResult::KeepReading;
|
||||
}
|
||||
|
||||
void AuthSession::SendPacket(ByteBuffer& packet)
|
||||
|
||||
Reference in New Issue
Block a user