From 3e802932a6797fc0f4768ebc61cf9ac4f498c7fb Mon Sep 17 00:00:00 2001 From: changyong guo Date: Mon, 23 Jul 2018 06:23:33 +0800 Subject: recover hotbar selected slot after reconnect (#4249) 1. implement protocol message SendHeldItemChange 2. add save / load inventory equipped item slot in JSON 3. send held item slot message after player connect to server Fixes #4189 --- src/Protocol/ProtocolRecognizer.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/Protocol/ProtocolRecognizer.cpp') diff --git a/src/Protocol/ProtocolRecognizer.cpp b/src/Protocol/ProtocolRecognizer.cpp index 912091acc..27ed2e6ad 100644 --- a/src/Protocol/ProtocolRecognizer.cpp +++ b/src/Protocol/ProtocolRecognizer.cpp @@ -428,6 +428,17 @@ void cProtocolRecognizer::SendHealth(void) +void cProtocolRecognizer::SendHeldItemChange(int a_ItemIndex) +{ + ASSERT(m_Protocol != nullptr); + m_Protocol->SendHeldItemChange(a_ItemIndex); +} + + + + + + void cProtocolRecognizer::SendHideTitle(void) { ASSERT(m_Protocol != nullptr); -- cgit v1.2.3