Quickslot Bindings

Added quickslot bindings, courtesy of @shavitush.
This commit is contained in:
ronancpl
2019-11-19 01:15:52 -03:00
parent 6d57eb1033
commit 661dcf0a96
12 changed files with 213 additions and 5 deletions
@@ -0,0 +1,34 @@
package net.server.channel.handlers;
import client.MapleClient;
import client.keybind.MapleQuickslotBinding;
import net.AbstractMaplePacketHandler;
import tools.data.input.SeekableLittleEndianAccessor;
/**
*
* @author Shavit
*/
public class QuickslotKeyMappedModifiedHandler extends AbstractMaplePacketHandler
{
@Override
public void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c)
{
// Invalid size for the packet.
if(slea.available() != MapleQuickslotBinding.QUICKSLOT_SIZE * Integer.BYTES ||
// not logged in-game
c.getPlayer() == null)
{
return;
}
byte[] aQuickslotKeyMapped = new byte[MapleQuickslotBinding.QUICKSLOT_SIZE];
for(int i = 0; i < MapleQuickslotBinding.QUICKSLOT_SIZE; i++)
{
aQuickslotKeyMapped[i] = (byte) slea.readInt();
}
c.getPlayer().m_pQuickslotKeyMapped = new MapleQuickslotBinding(aQuickslotKeyMapped);
}
}