Saving/Loading Client Hotbar
Posted: Thu Aug 28, 2014 2:35 pm
I was able to decode hotbar operations that might be useful for this project.
Client's hotbar changes are sent to server with F_CLIENT_DATA. Server will receive hotbar command, hotbar's slot index, and abilityID. Two commands that we are interested are add ability to hotbar and remove ability from hotbar.
(I'll post sending user's hotbar layout to user later today)
(Also, ignore client_data untill client tells server S_WORLD_SENT, which happens after UI has finished loading)
static public void F_CLIENT_DATA(BaseClient client, PacketIn packet)
{
ushort slotIndex = packet.GetUint16(); //60 possible slots
ushort unk1 = packet.GetUint16R();
ushort abilityEntry = packet.GetUint16R(); //abilityID, ex: Flee is 245)
ushort cmd = packet.GetUint16R(); //00 clear ability, 01 set ability
ushort unk2 = packet.GetUint16R(); //some sort of seq, maybe mouseXY?
if(cmd == 0) //remove ability from hotbar
{
//for current user update database, set hotbar's slot index to 0 indicating no ability slotted for this slot
}
else if(cmd == 1 && slotIndex <=260) //slotIndex above 260 might be morales/tactics/gear show/hide, haven't
//checked them yet
{
//update database, set slotindex to abilityID
}
}
Client's hotbar changes are sent to server with F_CLIENT_DATA. Server will receive hotbar command, hotbar's slot index, and abilityID. Two commands that we are interested are add ability to hotbar and remove ability from hotbar.
(I'll post sending user's hotbar layout to user later today)
(Also, ignore client_data untill client tells server S_WORLD_SENT, which happens after UI has finished loading)
static public void F_CLIENT_DATA(BaseClient client, PacketIn packet)
{
ushort slotIndex = packet.GetUint16(); //60 possible slots
ushort unk1 = packet.GetUint16R();
ushort abilityEntry = packet.GetUint16R(); //abilityID, ex: Flee is 245)
ushort cmd = packet.GetUint16R(); //00 clear ability, 01 set ability
ushort unk2 = packet.GetUint16R(); //some sort of seq, maybe mouseXY?
if(cmd == 0) //remove ability from hotbar
{
//for current user update database, set hotbar's slot index to 0 indicating no ability slotted for this slot
}
else if(cmd == 1 && slotIndex <=260) //slotIndex above 260 might be morales/tactics/gear show/hide, haven't
//checked them yet
{
//update database, set slotindex to abilityID
}
}