mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-08 08:12:38 +00:00
Switch server to use new style ManaChange_Struct (#1843)
This will allow us to fix some bugs the current handling has. Note: the decoder isn't needed since the client always sends it up as a 0 length packet.
This commit is contained in:
parent
774e0c7faa
commit
4507b063f5
@ -448,6 +448,7 @@ struct ManaChange_Struct
|
|||||||
/*08*/ uint32 spell_id;
|
/*08*/ uint32 spell_id;
|
||||||
/*12*/ uint8 keepcasting; // won't stop the cast. Change mana while casting?
|
/*12*/ uint8 keepcasting; // won't stop the cast. Change mana while casting?
|
||||||
/*13*/ uint8 padding[3]; // client doesn't read it, garbage data seems like
|
/*13*/ uint8 padding[3]; // client doesn't read it, garbage data seems like
|
||||||
|
/*16*/ int32 slot; // -1 normal, otherwise clear ETA and GCD
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SwapSpell_Struct
|
struct SwapSpell_Struct
|
||||||
|
|||||||
@ -1634,20 +1634,6 @@ namespace RoF
|
|||||||
FINISH_ENCODE();
|
FINISH_ENCODE();
|
||||||
}
|
}
|
||||||
|
|
||||||
ENCODE(OP_ManaChange)
|
|
||||||
{
|
|
||||||
ENCODE_LENGTH_EXACT(ManaChange_Struct);
|
|
||||||
SETUP_DIRECT_ENCODE(ManaChange_Struct, structs::ManaChange_Struct);
|
|
||||||
|
|
||||||
OUT(new_mana);
|
|
||||||
OUT(stamina);
|
|
||||||
OUT(spell_id);
|
|
||||||
OUT(keepcasting);
|
|
||||||
eq->slot = -1; // this is spell gem slot. It's -1 in normal operation
|
|
||||||
|
|
||||||
FINISH_ENCODE();
|
|
||||||
}
|
|
||||||
|
|
||||||
ENCODE(OP_MercenaryDataResponse)
|
ENCODE(OP_MercenaryDataResponse)
|
||||||
{
|
{
|
||||||
//consume the packet
|
//consume the packet
|
||||||
|
|||||||
@ -1683,20 +1683,6 @@ namespace RoF2
|
|||||||
FINISH_ENCODE();
|
FINISH_ENCODE();
|
||||||
}
|
}
|
||||||
|
|
||||||
ENCODE(OP_ManaChange)
|
|
||||||
{
|
|
||||||
ENCODE_LENGTH_EXACT(ManaChange_Struct);
|
|
||||||
SETUP_DIRECT_ENCODE(ManaChange_Struct, structs::ManaChange_Struct);
|
|
||||||
|
|
||||||
OUT(new_mana);
|
|
||||||
OUT(stamina);
|
|
||||||
OUT(spell_id);
|
|
||||||
OUT(keepcasting);
|
|
||||||
eq->slot = -1; // this is spell gem slot. It's -1 in normal operation
|
|
||||||
|
|
||||||
FINISH_ENCODE();
|
|
||||||
}
|
|
||||||
|
|
||||||
ENCODE(OP_MercenaryDataResponse)
|
ENCODE(OP_MercenaryDataResponse)
|
||||||
{
|
{
|
||||||
//consume the packet
|
//consume the packet
|
||||||
|
|||||||
@ -93,7 +93,6 @@ E(OP_ItemVerifyReply)
|
|||||||
E(OP_LeadershipExpUpdate)
|
E(OP_LeadershipExpUpdate)
|
||||||
E(OP_LogServer)
|
E(OP_LogServer)
|
||||||
E(OP_LootItem)
|
E(OP_LootItem)
|
||||||
E(OP_ManaChange)
|
|
||||||
E(OP_MercenaryDataResponse)
|
E(OP_MercenaryDataResponse)
|
||||||
E(OP_MercenaryDataUpdate)
|
E(OP_MercenaryDataUpdate)
|
||||||
E(OP_MoveItem)
|
E(OP_MoveItem)
|
||||||
|
|||||||
@ -79,7 +79,6 @@ E(OP_ItemVerifyReply)
|
|||||||
E(OP_LeadershipExpUpdate)
|
E(OP_LeadershipExpUpdate)
|
||||||
E(OP_LogServer)
|
E(OP_LogServer)
|
||||||
E(OP_LootItem)
|
E(OP_LootItem)
|
||||||
E(OP_ManaChange)
|
|
||||||
E(OP_MercenaryDataResponse)
|
E(OP_MercenaryDataResponse)
|
||||||
E(OP_MercenaryDataUpdate)
|
E(OP_MercenaryDataUpdate)
|
||||||
E(OP_MoveItem)
|
E(OP_MoveItem)
|
||||||
|
|||||||
@ -1170,20 +1170,6 @@ namespace SoD
|
|||||||
FINISH_ENCODE();
|
FINISH_ENCODE();
|
||||||
}
|
}
|
||||||
|
|
||||||
ENCODE(OP_ManaChange)
|
|
||||||
{
|
|
||||||
ENCODE_LENGTH_EXACT(ManaChange_Struct);
|
|
||||||
SETUP_DIRECT_ENCODE(ManaChange_Struct, structs::ManaChange_Struct);
|
|
||||||
|
|
||||||
OUT(new_mana);
|
|
||||||
OUT(stamina);
|
|
||||||
OUT(spell_id);
|
|
||||||
OUT(keepcasting);
|
|
||||||
eq->slot = -1; // this is spell gem slot. It's -1 in normal operation
|
|
||||||
|
|
||||||
FINISH_ENCODE();
|
|
||||||
}
|
|
||||||
|
|
||||||
ENCODE(OP_MercenaryDataResponse)
|
ENCODE(OP_MercenaryDataResponse)
|
||||||
{
|
{
|
||||||
//consume the packet
|
//consume the packet
|
||||||
|
|||||||
@ -63,7 +63,6 @@ E(OP_ItemVerifyReply)
|
|||||||
E(OP_LeadershipExpUpdate)
|
E(OP_LeadershipExpUpdate)
|
||||||
E(OP_LogServer)
|
E(OP_LogServer)
|
||||||
E(OP_LootItem)
|
E(OP_LootItem)
|
||||||
E(OP_ManaChange)
|
|
||||||
E(OP_MercenaryDataResponse)
|
E(OP_MercenaryDataResponse)
|
||||||
E(OP_MercenaryDataUpdate)
|
E(OP_MercenaryDataUpdate)
|
||||||
E(OP_MoveItem)
|
E(OP_MoveItem)
|
||||||
|
|||||||
@ -966,20 +966,6 @@ namespace SoF
|
|||||||
FINISH_ENCODE();
|
FINISH_ENCODE();
|
||||||
}
|
}
|
||||||
|
|
||||||
ENCODE(OP_ManaChange)
|
|
||||||
{
|
|
||||||
ENCODE_LENGTH_EXACT(ManaChange_Struct);
|
|
||||||
SETUP_DIRECT_ENCODE(ManaChange_Struct, structs::ManaChange_Struct);
|
|
||||||
|
|
||||||
OUT(new_mana);
|
|
||||||
OUT(stamina);
|
|
||||||
OUT(spell_id);
|
|
||||||
OUT(keepcasting);
|
|
||||||
eq->slot = -1; // this is spell gem slot. It's -1 in normal operation
|
|
||||||
|
|
||||||
FINISH_ENCODE();
|
|
||||||
}
|
|
||||||
|
|
||||||
ENCODE(OP_MemorizeSpell)
|
ENCODE(OP_MemorizeSpell)
|
||||||
{
|
{
|
||||||
ENCODE_LENGTH_EXACT(MemorizeSpell_Struct);
|
ENCODE_LENGTH_EXACT(MemorizeSpell_Struct);
|
||||||
|
|||||||
@ -59,7 +59,6 @@ E(OP_ItemVerifyReply)
|
|||||||
E(OP_LeadershipExpUpdate)
|
E(OP_LeadershipExpUpdate)
|
||||||
E(OP_LogServer)
|
E(OP_LogServer)
|
||||||
E(OP_LootItem)
|
E(OP_LootItem)
|
||||||
E(OP_ManaChange)
|
|
||||||
E(OP_MemorizeSpell)
|
E(OP_MemorizeSpell)
|
||||||
E(OP_MoveItem)
|
E(OP_MoveItem)
|
||||||
E(OP_NewSpawn)
|
E(OP_NewSpawn)
|
||||||
|
|||||||
@ -932,6 +932,19 @@ namespace Titanium
|
|||||||
FINISH_ENCODE();
|
FINISH_ENCODE();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ENCODE(OP_ManaChange)
|
||||||
|
{
|
||||||
|
ENCODE_LENGTH_EXACT(ManaChange_Struct);
|
||||||
|
SETUP_DIRECT_ENCODE(ManaChange_Struct, structs::ManaChange_Struct);
|
||||||
|
|
||||||
|
OUT(new_mana);
|
||||||
|
OUT(stamina);
|
||||||
|
OUT(spell_id);
|
||||||
|
OUT(keepcasting);
|
||||||
|
|
||||||
|
FINISH_ENCODE();
|
||||||
|
}
|
||||||
|
|
||||||
ENCODE(OP_MemorizeSpell)
|
ENCODE(OP_MemorizeSpell)
|
||||||
{
|
{
|
||||||
ENCODE_LENGTH_EXACT(MemorizeSpell_Struct);
|
ENCODE_LENGTH_EXACT(MemorizeSpell_Struct);
|
||||||
|
|||||||
@ -55,6 +55,7 @@ E(OP_ItemPacket)
|
|||||||
E(OP_LeadershipExpUpdate)
|
E(OP_LeadershipExpUpdate)
|
||||||
E(OP_LFGuild)
|
E(OP_LFGuild)
|
||||||
E(OP_LootItem)
|
E(OP_LootItem)
|
||||||
|
E(OP_ManaChange)
|
||||||
E(OP_MemorizeSpell)
|
E(OP_MemorizeSpell)
|
||||||
E(OP_MoveItem)
|
E(OP_MoveItem)
|
||||||
E(OP_OnLevelMessage)
|
E(OP_OnLevelMessage)
|
||||||
|
|||||||
@ -1390,20 +1390,6 @@ namespace UF
|
|||||||
FINISH_ENCODE();
|
FINISH_ENCODE();
|
||||||
}
|
}
|
||||||
|
|
||||||
ENCODE(OP_ManaChange)
|
|
||||||
{
|
|
||||||
ENCODE_LENGTH_EXACT(ManaChange_Struct);
|
|
||||||
SETUP_DIRECT_ENCODE(ManaChange_Struct, structs::ManaChange_Struct);
|
|
||||||
|
|
||||||
OUT(new_mana);
|
|
||||||
OUT(stamina);
|
|
||||||
OUT(spell_id);
|
|
||||||
OUT(keepcasting);
|
|
||||||
eq->slot = -1; // this is spell gem slot. It's -1 in normal operation
|
|
||||||
|
|
||||||
FINISH_ENCODE();
|
|
||||||
}
|
|
||||||
|
|
||||||
ENCODE(OP_MercenaryDataResponse)
|
ENCODE(OP_MercenaryDataResponse)
|
||||||
{
|
{
|
||||||
//consume the packet
|
//consume the packet
|
||||||
|
|||||||
@ -68,7 +68,6 @@ E(OP_ItemVerifyReply)
|
|||||||
E(OP_LeadershipExpUpdate)
|
E(OP_LeadershipExpUpdate)
|
||||||
E(OP_LogServer)
|
E(OP_LogServer)
|
||||||
E(OP_LootItem)
|
E(OP_LootItem)
|
||||||
E(OP_ManaChange)
|
|
||||||
E(OP_MercenaryDataResponse)
|
E(OP_MercenaryDataResponse)
|
||||||
E(OP_MercenaryDataUpdate)
|
E(OP_MercenaryDataUpdate)
|
||||||
E(OP_MoveItem)
|
E(OP_MoveItem)
|
||||||
|
|||||||
@ -1869,9 +1869,7 @@ void Client::CheckManaEndUpdate() {
|
|||||||
mana_change->stamina = current_endurance;
|
mana_change->stamina = current_endurance;
|
||||||
mana_change->spell_id = casting_spell_id;
|
mana_change->spell_id = casting_spell_id;
|
||||||
mana_change->keepcasting = 1;
|
mana_change->keepcasting = 1;
|
||||||
mana_change->padding[0] = 0;
|
mana_change->slot = -1;
|
||||||
mana_change->padding[1] = 0;
|
|
||||||
mana_change->padding[2] = 0;
|
|
||||||
outapp->priority = 6;
|
outapp->priority = 6;
|
||||||
QueuePacket(outapp);
|
QueuePacket(outapp);
|
||||||
safe_delete(outapp);
|
safe_delete(outapp);
|
||||||
|
|||||||
@ -1001,6 +1001,7 @@ void Mob::StopCasting()
|
|||||||
mc->stamina = GetEndurance();
|
mc->stamina = GetEndurance();
|
||||||
mc->spell_id = casting_spell_id;
|
mc->spell_id = casting_spell_id;
|
||||||
mc->keepcasting = 0;
|
mc->keepcasting = 0;
|
||||||
|
mc->slot = -1;
|
||||||
c->FastQueuePacket(&outapp);
|
c->FastQueuePacket(&outapp);
|
||||||
}
|
}
|
||||||
ZeroCastingVars();
|
ZeroCastingVars();
|
||||||
@ -5218,6 +5219,7 @@ void Mob::SendSpellBarEnable(uint16 spell_id)
|
|||||||
manachange->spell_id = spell_id;
|
manachange->spell_id = spell_id;
|
||||||
manachange->stamina = CastToClient()->GetEndurance();
|
manachange->stamina = CastToClient()->GetEndurance();
|
||||||
manachange->keepcasting = 0;
|
manachange->keepcasting = 0;
|
||||||
|
manachange->slot = -1;
|
||||||
outapp->priority = 6;
|
outapp->priority = 6;
|
||||||
CastToClient()->QueuePacket(outapp);
|
CastToClient()->QueuePacket(outapp);
|
||||||
safe_delete(outapp);
|
safe_delete(outapp);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user