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
}
}
Saving/Loading Client Hotbar
Forum rules
Before posting on this forum, be sure to read the Terms of Use
Before posting on this forum, be sure to read the Terms of Use
Saving/Loading Client Hotbar
Last edited by Londo on Thu Aug 28, 2014 5:15 pm, edited 5 times in total.
Ads
- respect1994
- Posts: 158
Re: Saving/Loading Client Hotbar
Good work Londo you're awesome
SkullCrasher - choppa
Varus - magus
Ragarock - bright wizard
Varus - magus
Ragarock - bright wizard
Re: Saving/Loading Client Hotbar
Here is operation to set clients Hotbar. Server needs to send setting for every slot on hotbar regardless if its empty. Settings include other information that I havent looked at yet, but here is how 60 slots of hotbar are populated.
//Add this operation to Player class. Also create table "ClientData" in the database to hold PlayerID, SlotIndex, and
//AbilityID.
//Call this operation on player Init.
public void SendHotbar()
{
PacketOut Out = new PacketOut((byte)Opcodes.F_CLIENT_DATA);
Out.WriteUInt16(0); //unknown
Out.WriteUInt16(1024); //size of data to come
Out.WriteByte(0);//unknown
//skip to hotbar porition, first 24 bytes control something else (maybe morales, or gear show/hide)
Out.Fill(0, 24);
//Hotbar slot information starts offset 32
int pos = (int)Out.Position;
Out.Fill(0,1024); //finished packet needs to be 1032 bytes
Out.Position = pos;
for (int slotIndex = 24; slotIndex < 264; slotIndex += 4) //from slot 1 to slot 60, write out either 0 for empty or abilityID
{
//Check database/cache for what ability is in current slotIndex
Out.WriteUInt16R(Hotbar[slotIndex].AbilityEntry); //write 0 if slot is empty, otherwise abilityID
Out.WriteUInt16R(Hotbar[slotIndex].AbilityEntry > 0 ? 1 : 0); //write 1 to show ability, 0 to show nothing
}
cclient.SendPacket(Out);
}
//Add this operation to Player class. Also create table "ClientData" in the database to hold PlayerID, SlotIndex, and
//AbilityID.
//Call this operation on player Init.
public void SendHotbar()
{
PacketOut Out = new PacketOut((byte)Opcodes.F_CLIENT_DATA);
Out.WriteUInt16(0); //unknown
Out.WriteUInt16(1024); //size of data to come
Out.WriteByte(0);//unknown
//skip to hotbar porition, first 24 bytes control something else (maybe morales, or gear show/hide)
Out.Fill(0, 24);
//Hotbar slot information starts offset 32
int pos = (int)Out.Position;
Out.Fill(0,1024); //finished packet needs to be 1032 bytes
Out.Position = pos;
for (int slotIndex = 24; slotIndex < 264; slotIndex += 4) //from slot 1 to slot 60, write out either 0 for empty or abilityID
{
//Check database/cache for what ability is in current slotIndex
Out.WriteUInt16R(Hotbar[slotIndex].AbilityEntry); //write 0 if slot is empty, otherwise abilityID
Out.WriteUInt16R(Hotbar[slotIndex].AbilityEntry > 0 ? 1 : 0); //write 1 to show ability, 0 to show nothing
}
cclient.SendPacket(Out);
}
Last edited by Londo on Thu Aug 28, 2014 5:16 pm, edited 5 times in total.
Re: Saving/Loading Client Hotbar
Good work Londo. That will make life much easier for everyone playing. thank you.
THUMP - "MEDIOCRE!!" ...Who's laughing now?
Re: Saving/Loading Client Hotbar
Good work! Much appriciated!
Sergeant-Major Drengk Burloksson, RR 85 Sniper
Hulfdan Irongrip, RR 81 Ironbreaker
Rordin Brightrune, RR 70 Runepriest
Proud Founder of the 3rd Bitterstone Thunderers
- Hammertime
- Posts: 42
Re: Saving/Loading Client Hotbar
For us non coding, code-less, and clueless players...what does this mean? Is it part of our end to repair a file or something?
Ads
Re: Saving/Loading Client Hotbar
I'm a non coder, but I guess this means, that you won't have to slot every single time all the skills into hotbars, like it was up to now (the server will remember, where on your hotbar each skill is). Right now each time you log in, you only have the basic 2 skills + run.
Good work BTW
Good work BTW
-
- Posts: 12
Re: Saving/Loading Client Hotbar
same question here does it mean that we have to edit file and past the code, or it will be implemented in some other patch??Hammertime wrote:For us non coding, code-less, and clueless players...what does this mean? Is it part of our end to repair a file or something?
Order
WH - Andrevv
WL - Ajantis
KoBS - Edwemar
WH - Andrevv
WL - Ajantis
KoBS - Edwemar
Who is online
Users browsing this forum: No registered users and 2 guests