Core/PacketIO: Convert all leftover packets to use packet classes

Port From (https://github.com/TrinityCore/TrinityCore/commit/661470c6587c11e3fa94d2e8b57c92d8be2e297b)
This commit is contained in:
hondacrx
2020-07-14 23:00:31 -04:00
parent 4bb9823456
commit baa9ab6558
15 changed files with 251 additions and 186 deletions
+40 -44
View File
@@ -164,6 +164,18 @@ namespace Game.Networking.Packets
public List<PetStableInfo> Pets = new List<PetStableInfo>();
}
class PetStableResult : ServerPacket
{
public PetStableResult() : base(ServerOpcodes.PetStableResult, ConnectionType.Instance) { }
public override void Write()
{
_worldPacket.WriteUInt8((byte)Result);
}
public StableResult Result;
}
class PetLearnedSpells : ServerPacket
{
public PetLearnedSpells() : base(ServerOpcodes.PetLearnedSpells, ConnectionType.Instance) { }
@@ -288,34 +300,6 @@ namespace Game.Networking.Packets
public uint Action;
}
class PetActionSound : ServerPacket
{
public PetActionSound() : base(ServerOpcodes.PetStableResult) { }
public override void Write()
{
_worldPacket.WritePackedGuid(UnitGUID);
_worldPacket.WriteUInt32((uint)Action);
}
public ObjectGuid UnitGUID;
public PetTalk Action;
}
class PetActionFeedback : ServerPacket
{
public PetActionFeedback() : base(ServerOpcodes.PetStableResult) { }
public override void Write()
{
_worldPacket.WriteUInt32(SpellID);
_worldPacket.WriteUInt8((byte)Response);
}
public uint SpellID;
public ActionFeedback Response;
}
class PetCancelAura : ClientPacket
{
public PetCancelAura(WorldPacket packet) : base(packet) { }
@@ -330,22 +314,6 @@ namespace Game.Networking.Packets
public uint SpellID;
}
class PetStableResult : ServerPacket
{
public PetStableResult(byte result) : base(ServerOpcodes.PetStableResult)
{
Result = result;
}
public override void Write()
{
_worldPacket.WriteUInt8(Result);
}
public byte Result;
}
class SetPetSpecialization : ServerPacket
{
public SetPetSpecialization() : base(ServerOpcodes.SetPetSpecialization) { }
@@ -358,6 +326,34 @@ namespace Game.Networking.Packets
public ushort SpecID;
}
class PetActionFeedbackPacket : ServerPacket
{
public PetActionFeedbackPacket() : base(ServerOpcodes.PetStableResult) { }
public override void Write()
{
_worldPacket.WriteUInt32(SpellID);
_worldPacket.WriteUInt8((byte)Response);
}
public uint SpellID;
public PetActionFeedback Response;
}
class PetActionSound : ServerPacket
{
public PetActionSound() : base(ServerOpcodes.PetStableResult) { }
public override void Write()
{
_worldPacket.WritePackedGuid(UnitGUID);
_worldPacket.WriteUInt32((uint)Action);
}
public ObjectGuid UnitGUID;
public PetTalk Action;
}
//Structs
public class PetSpellCooldown
{