49ef21d650
First one: add missing exception handler in ProcessProtocolIn Second: remove faulty logic dealing with incomplete packets. `a_Data = a_Data.substr(m_Buffer.GetUsedSpace() - m_Buffer.GetReadableSpace());` was incorrect; it attempted to apply a length derived from m_Buffer to an unrelated a_Data. Its purpose was to give cProtocol the data the client sent, minus initial handshake bytes. However, we can use the knowledge that during initial handshake, there is no encryption and every byte can be written unchanged into m_Buffer, to just call cProtocol with a data length of zero. This will cause it to parse from m_Buffer - wherein we have already written everything the client sent - with no a_Data manipulation needed. Additionally, removed UnsupportedButPingableProtocolException (use of exception as control flow) and encode this state as m_Protocol == nullptr, id est "no protocol for this unsupported version", which is then handled by cMultiVersionProtocol itself. |
||
---|---|---|
.. | ||
AnvilWindow.cpp | ||
AnvilWindow.h | ||
BeaconWindow.cpp | ||
BeaconWindow.h | ||
BrewingstandWindow.cpp | ||
BrewingstandWindow.h | ||
ChestWindow.cpp | ||
ChestWindow.h | ||
CMakeLists.txt | ||
CraftingWindow.cpp | ||
CraftingWindow.h | ||
DropSpenserWindow.cpp | ||
DropSpenserWindow.h | ||
EnchantingWindow.cpp | ||
EnchantingWindow.h | ||
EnderChestWindow.cpp | ||
EnderChestWindow.h | ||
FurnaceWindow.cpp | ||
FurnaceWindow.h | ||
HopperWindow.cpp | ||
HopperWindow.h | ||
HorseWindow.cpp | ||
HorseWindow.h | ||
InventoryWindow.cpp | ||
InventoryWindow.h | ||
MinecartWithChestWindow.h | ||
SlotArea.cpp | ||
SlotArea.h | ||
Window.cpp | ||
Window.h | ||
WindowOwner.h |