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
This commit is contained in:
committed by
peterbell10
parent
7b431bed51
commit
3e802932a6
@@ -417,6 +417,9 @@ void cClientHandle::FinishAuthenticate(const AString & a_Name, const cUUID & a_U
|
||||
// Send experience
|
||||
m_Player->SendExperience();
|
||||
|
||||
// Send hotbar active slot
|
||||
m_Player->SendHotbarActiveSlot();
|
||||
|
||||
// Send player list items
|
||||
SendPlayerListAddPlayer(*m_Player);
|
||||
cRoot::Get()->BroadcastPlayerListsAddPlayer(*m_Player);
|
||||
@@ -2635,6 +2638,15 @@ void cClientHandle::SendHealth(void)
|
||||
|
||||
|
||||
|
||||
void cClientHandle::SendHeldItemChange(int a_ItemIndex)
|
||||
{
|
||||
m_Protocol->SendHeldItemChange(a_ItemIndex);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void cClientHandle::SendHideTitle(void)
|
||||
{
|
||||
m_Protocol->SendHideTitle();
|
||||
|
||||
Reference in New Issue
Block a user