1
0

Added temporary block type mapping for 1.13+ protocols.

This commit is contained in:
Mattes D
2020-01-03 17:31:13 +01:00
parent e234fbdafe
commit 4aef80b47e
16 changed files with 375 additions and 76 deletions

View File

@@ -1038,7 +1038,24 @@ bool cProtocolRecognizer::TryRecognizeProtocol(void)
// Not enough bytes for the packet, keep waiting
return false;
}
return TryRecognizeLengthedProtocol(PacketLen - ReadSoFar);
if (!TryRecognizeLengthedProtocol(PacketLen - ReadSoFar))
{
return false;
}
// The protocol has been recognized, initialize it:
ASSERT(m_Protocol != nullptr);
try
{
m_Protocol->Initialize(*m_Client);
}
catch (const std::exception & exc)
{
m_Client->Kick(exc.what());
m_Protocol.reset();
return false;
}
return true;
}