Core/PacketIO: Convert all leftover packets to use packet classes
Port From (https://github.com/TrinityCore/TrinityCore/commit/661470c6587c11e3fa94d2e8b57c92d8be2e297b)
This commit is contained in:
@@ -1803,7 +1803,6 @@ namespace Framework.Constants
|
|||||||
|
|
||||||
// Opcodes that are not generated automatically
|
// Opcodes that are not generated automatically
|
||||||
AccountHeirloomUpdate = 0xBADD, // No Client Handler
|
AccountHeirloomUpdate = 0xBADD, // No Client Handler
|
||||||
ItemUpgradeResult = 0xBADD, // No Client Handler
|
|
||||||
CompressedPacket = 0x3052,
|
CompressedPacket = 0x3052,
|
||||||
MultiplePackets = 0x3051,
|
MultiplePackets = 0x3051,
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Framework.Constants
|
namespace Framework.Constants
|
||||||
{
|
{
|
||||||
@@ -63,12 +63,13 @@ namespace Framework.Constants
|
|||||||
Talent = 2
|
Talent = 2
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum ActionFeedback
|
public enum PetActionFeedback
|
||||||
{
|
{
|
||||||
None = 0,
|
None = 0,
|
||||||
PetDead = 1,
|
Dead = 1,
|
||||||
NothingToAtt = 2,
|
NoTarget = 2,
|
||||||
CantAttTarget = 3
|
InvalidTarget = 3,
|
||||||
|
NoPath = 4
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum PetTalk
|
public enum PetTalk
|
||||||
@@ -111,4 +112,15 @@ namespace Framework.Constants
|
|||||||
Active = 1,
|
Active = 1,
|
||||||
Inactive = 2
|
Inactive = 2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enum StableResult
|
||||||
|
{
|
||||||
|
NotEnoughMoney = 1, // "you don't have enough money"
|
||||||
|
InvalidSlot = 3, // "That slot is locked"
|
||||||
|
StableSuccess = 8, // stable success
|
||||||
|
UnstableSuccess = 9, // unstable/swap success
|
||||||
|
BuySlotSuccess = 10, // buy slot success
|
||||||
|
CantControlExotic = 11, // "you are unable to control exotic creatures"
|
||||||
|
InternalError = 12, // "Internal pet error"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ using Game.Networking.Packets;
|
|||||||
using Game.Spells;
|
using Game.Spells;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using Framework.Constants;
|
||||||
|
|
||||||
namespace Game.Entities
|
namespace Game.Entities
|
||||||
{
|
{
|
||||||
@@ -691,13 +692,13 @@ namespace Game.Entities
|
|||||||
Log.outFatal(LogFilter.Unit, "Unit {0} is not able to release its charm {1}", GetEntry(), GetCharmGUID());
|
Log.outFatal(LogFilter.Unit, "Unit {0} is not able to release its charm {1}", GetEntry(), GetCharmGUID());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SendPetActionFeedback(uint spellId, ActionFeedback msg)
|
public void SendPetActionFeedback(PetActionFeedback msg, uint spellId)
|
||||||
{
|
{
|
||||||
Unit owner = GetOwner();
|
Unit owner = GetOwner();
|
||||||
if (!owner || !owner.IsTypeId(TypeId.Player))
|
if (!owner || !owner.IsTypeId(TypeId.Player))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
PetActionFeedback petActionFeedback = new PetActionFeedback();
|
PetActionFeedbackPacket petActionFeedback = new PetActionFeedbackPacket();
|
||||||
petActionFeedback.SpellID = spellId;
|
petActionFeedback.SpellID = spellId;
|
||||||
petActionFeedback.Response = msg;
|
petActionFeedback.Response = msg;
|
||||||
owner.ToPlayer().SendPacket(petActionFeedback);
|
owner.ToPlayer().SendPacket(petActionFeedback);
|
||||||
|
|||||||
@@ -1050,8 +1050,8 @@ namespace Game.Groups
|
|||||||
|
|
||||||
public void MasterLoot(Loot loot, WorldObject pLootedObject)
|
public void MasterLoot(Loot loot, WorldObject pLootedObject)
|
||||||
{
|
{
|
||||||
MasterLootCandidateList data = new MasterLootCandidateList();
|
MasterLootCandidateList masterLootCandidateList = new MasterLootCandidateList();
|
||||||
data.LootObj = loot.GetGUID();
|
masterLootCandidateList.LootObj = loot.GetGUID();
|
||||||
|
|
||||||
for (GroupReference refe = GetFirstMember(); refe != null; refe = refe.Next())
|
for (GroupReference refe = GetFirstMember(); refe != null; refe = refe.Next())
|
||||||
{
|
{
|
||||||
@@ -1060,14 +1060,16 @@ namespace Game.Groups
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (looter.IsAtGroupRewardDistance(pLootedObject))
|
if (looter.IsAtGroupRewardDistance(pLootedObject))
|
||||||
data.Players.Add(looter.GetGUID());
|
masterLootCandidateList.Players.Add(looter.GetGUID());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
masterLootCandidateList.Write();
|
||||||
|
|
||||||
for (GroupReference refe = GetFirstMember(); refe != null; refe = refe.Next())
|
for (GroupReference refe = GetFirstMember(); refe != null; refe = refe.Next())
|
||||||
{
|
{
|
||||||
Player looter = refe.GetSource();
|
Player looter = refe.GetSource();
|
||||||
if (looter.IsAtGroupRewardDistance(pLootedObject))
|
if (looter.IsAtGroupRewardDistance(pLootedObject))
|
||||||
looter.SendPacket(data);
|
looter.SendPacket(masterLootCandidateList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -121,7 +121,10 @@ namespace Game
|
|||||||
void HandleBuyBankSlot(BuyBankSlot packet)
|
void HandleBuyBankSlot(BuyBankSlot packet)
|
||||||
{
|
{
|
||||||
if (!CanUseBank(packet.Guid))
|
if (!CanUseBank(packet.Guid))
|
||||||
|
{
|
||||||
Log.outDebug(LogFilter.Network, "WORLD: HandleBuyBankSlot - {0} not found or you can't interact with him.", packet.Guid.ToString());
|
Log.outDebug(LogFilter.Network, "WORLD: HandleBuyBankSlot - {0} not found or you can't interact with him.", packet.Guid.ToString());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
uint slot = GetPlayer().GetBankBagSlotCount();
|
uint slot = GetPlayer().GetBankBagSlotCount();
|
||||||
// next slot
|
// next slot
|
||||||
|
|||||||
@@ -580,29 +580,8 @@ namespace Game
|
|||||||
[WorldPacketHandler(ClientOpcodes.RequestRatedBattlefieldInfo)]
|
[WorldPacketHandler(ClientOpcodes.RequestRatedBattlefieldInfo)]
|
||||||
void HandleRequestRatedBattlefieldInfo(RequestRatedBattlefieldInfo packet)
|
void HandleRequestRatedBattlefieldInfo(RequestRatedBattlefieldInfo packet)
|
||||||
{
|
{
|
||||||
// @Todo: perfome research in this case
|
RatedBattlefieldInfo ratedBattlefieldInfo = new RatedBattlefieldInfo();
|
||||||
// The unk fields are related to arenas
|
SendPacket(ratedBattlefieldInfo);
|
||||||
WorldPacket data = new WorldPacket(ServerOpcodes.RatedBattlefieldInfo);
|
|
||||||
data.WriteInt32(0); // BgWeeklyWins20vs20
|
|
||||||
data.WriteInt32(0); // BgWeeklyPlayed20vs20
|
|
||||||
data.WriteInt32(0); // BgWeeklyPlayed15vs15
|
|
||||||
data.WriteInt32(0);
|
|
||||||
data.WriteInt32(0); // BgWeeklyWins10vs10
|
|
||||||
data.WriteInt32(0);
|
|
||||||
data.WriteInt32(0);
|
|
||||||
data.WriteInt32(0);
|
|
||||||
data.WriteInt32(0); // BgWeeklyWins15vs15
|
|
||||||
data.WriteInt32(0);
|
|
||||||
data.WriteInt32(0);
|
|
||||||
data.WriteInt32(0);
|
|
||||||
data.WriteInt32(0);
|
|
||||||
data.WriteInt32(0);
|
|
||||||
data.WriteInt32(0);
|
|
||||||
data.WriteInt32(0); // BgWeeklyPlayed10vs10
|
|
||||||
data.WriteInt32(0);
|
|
||||||
data.WriteInt32(0);
|
|
||||||
|
|
||||||
//SendPacket(data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[WorldPacketHandler(ClientOpcodes.GetPvpOptionsEnabled, Processing = PacketProcessing.Inplace)]
|
[WorldPacketHandler(ClientOpcodes.GetPvpOptionsEnabled, Processing = PacketProcessing.Inplace)]
|
||||||
|
|||||||
@@ -613,15 +613,15 @@ namespace Game
|
|||||||
GetPlayer().StoreItem(dest, item, true);
|
GetPlayer().StoreItem(dest, item, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SendEnchantmentLog(ObjectGuid owner, ObjectGuid caster, ObjectGuid itemGuid, uint itemId, uint enchantId, uint slot)
|
public void SendEnchantmentLog(ObjectGuid owner, ObjectGuid caster, ObjectGuid itemGuid, uint itemId, uint enchantId, uint enchantSlot)
|
||||||
{
|
{
|
||||||
EnchantmentLog packet = new EnchantmentLog();
|
EnchantmentLog packet = new EnchantmentLog();
|
||||||
packet.Caster = caster;
|
|
||||||
packet.Owner = owner;
|
packet.Owner = owner;
|
||||||
|
packet.Caster = caster;
|
||||||
packet.ItemGUID = itemGuid;
|
packet.ItemGUID = itemGuid;
|
||||||
packet.ItemID = itemId;
|
packet.ItemID = itemId;
|
||||||
packet.Enchantment = enchantId;
|
packet.Enchantment = enchantId;
|
||||||
packet.EnchantSlot = slot;
|
packet.EnchantSlot = enchantSlot;
|
||||||
|
|
||||||
GetPlayer().SendMessageToSet(packet, true);
|
GetPlayer().SendMessageToSet(packet, true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -456,103 +456,102 @@ namespace Game
|
|||||||
DoLootRelease(lootPair.Value);
|
DoLootRelease(lootPair.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
//[WorldPacketHandler(ClientOpcodes.MasterLootItem)]
|
[WorldPacketHandler(ClientOpcodes.MasterLootItem)]
|
||||||
void HandleLootMasterGive(WorldPacket packet)
|
void HandleLootMasterGive(MasterLootItem masterLootItem)
|
||||||
{
|
{
|
||||||
ObjectGuid lootguid = packet.ReadPackedGuid();
|
AELootResult aeResult = new AELootResult();
|
||||||
byte slotid = packet.ReadUInt8();
|
|
||||||
ObjectGuid target_playerguid = packet.ReadPackedGuid();
|
|
||||||
|
|
||||||
if (GetPlayer().GetGroup() == null || GetPlayer().GetGroup().GetLooterGuid() != GetPlayer().GetGUID() || GetPlayer().GetGroup().GetLootMethod() != LootMethod.MasterLoot)
|
if (GetPlayer().GetGroup() == null || GetPlayer().GetGroup().GetLooterGuid() != GetPlayer().GetGUID() || GetPlayer().GetGroup().GetLootMethod() != LootMethod.MasterLoot)
|
||||||
{
|
{
|
||||||
GetPlayer().SendLootError(lootguid, ObjectGuid.Empty, LootError.DidntKill);
|
GetPlayer().SendLootError(ObjectGuid.Empty, ObjectGuid.Empty, LootError.DidntKill);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// player on other map
|
// player on other map
|
||||||
Player target = Global.ObjAccessor.GetPlayer(_player, target_playerguid);
|
Player target = Global.ObjAccessor.GetPlayer(_player, masterLootItem.Target);
|
||||||
if (!target)
|
if (!target)
|
||||||
{
|
{
|
||||||
GetPlayer().SendLootError(lootguid, ObjectGuid.Empty, LootError.PlayerNotFound);
|
GetPlayer().SendLootError(ObjectGuid.Empty, ObjectGuid.Empty, LootError.PlayerNotFound);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.outDebug(LogFilter.Network, "HandleLootMasterGive (CMSG_LOOT_MASTER_GIVE, 0x02A3) Target = [{0}].", target.GetName());
|
foreach (LootRequest req in masterLootItem.Loot)
|
||||||
|
|
||||||
if (GetPlayer().GetLootGUID() != lootguid)
|
|
||||||
{
|
{
|
||||||
GetPlayer().SendLootError(lootguid, ObjectGuid.Empty, LootError.DidntKill);
|
Loot loot = null;
|
||||||
return;
|
ObjectGuid lootguid = _player.GetLootWorldObjectGUID(req.Object);
|
||||||
}
|
|
||||||
|
|
||||||
if (!GetPlayer().IsInRaidWith(target) || !GetPlayer().IsInMap(target))
|
if (!_player.IsInRaidWith(target) || !_player.IsInMap(target))
|
||||||
{
|
{
|
||||||
GetPlayer().SendLootError(lootguid, ObjectGuid.Empty, LootError.MasterOther);
|
_player.SendLootError(req.Object, ObjectGuid.Empty, LootError.MasterOther);
|
||||||
Log.outInfo(LogFilter.Loot, "MasterLootItem: Player {0} tried to give an item to ineligible player {1}!", GetPlayer().GetName(), target.GetName());
|
Log.outInfo(LogFilter.Cheat, $"MasterLootItem: Player {GetPlayer().GetName()} tried to give an item to ineligible player {target.GetName()} !");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Loot loot = null;
|
if (GetPlayer().GetLootGUID().IsCreatureOrVehicle())
|
||||||
|
{
|
||||||
|
Creature creature = GetPlayer().GetMap().GetCreature(lootguid);
|
||||||
|
if (!creature)
|
||||||
|
return;
|
||||||
|
|
||||||
if (GetPlayer().GetLootGUID().IsCreatureOrVehicle())
|
loot = creature.loot;
|
||||||
{
|
}
|
||||||
Creature creature = GetPlayer().GetMap().GetCreature(lootguid);
|
else if (GetPlayer().GetLootGUID().IsGameObject())
|
||||||
if (creature == null)
|
{
|
||||||
|
GameObject pGO = GetPlayer().GetMap().GetGameObject(lootguid);
|
||||||
|
if (!pGO)
|
||||||
|
return;
|
||||||
|
|
||||||
|
loot = pGO.loot;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (loot == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
loot = creature.loot;
|
byte slotid = (byte)(req.LootListID - 1);
|
||||||
}
|
if (slotid >= loot.items.Count + loot.quest_items.Count)
|
||||||
else if (GetPlayer().GetLootGUID().IsGameObject())
|
{
|
||||||
{
|
Log.outDebug(LogFilter.Loot, $"MasterLootItem: Player {GetPlayer().GetName()} might be using a hack! (slot {slotid}, size {loot.items.Count})");
|
||||||
GameObject pGO = GetPlayer().GetMap().GetGameObject(lootguid);
|
|
||||||
if (pGO == null)
|
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
loot = pGO.loot;
|
LootItem item = slotid >= loot.items.Count ? loot.quest_items[slotid - loot.items.Count] : loot.items[slotid];
|
||||||
|
|
||||||
|
List<ItemPosCount> dest = new List<ItemPosCount>();
|
||||||
|
InventoryResult msg = target.CanStoreNewItem(ItemConst.NullBag, ItemConst.NullSlot, dest, item.itemid, item.count);
|
||||||
|
if (item.follow_loot_rules && !item.AllowedForPlayer(target))
|
||||||
|
msg = InventoryResult.CantEquipEver;
|
||||||
|
if (msg != InventoryResult.Ok)
|
||||||
|
{
|
||||||
|
if (msg == InventoryResult.ItemMaxCount)
|
||||||
|
_player.SendLootError(req.Object, ObjectGuid.Empty, LootError.MasterUniqueItem);
|
||||||
|
else if (msg == InventoryResult.InvFull)
|
||||||
|
_player.SendLootError(req.Object, ObjectGuid.Empty, LootError.MasterInvFull);
|
||||||
|
else
|
||||||
|
_player.SendLootError(req.Object, ObjectGuid.Empty, LootError.MasterOther);
|
||||||
|
|
||||||
|
target.SendEquipError(msg, null, null, item.itemid);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// now move item from loot to target inventory
|
||||||
|
Item newitem = target.StoreNewItem(dest, item.itemid, true, item.randomBonusListId, item.GetAllowedLooters(), item.context, item.BonusListIDs);
|
||||||
|
aeResult.Add(newitem, item.count, loot.loot_type);
|
||||||
|
|
||||||
|
// mark as looted
|
||||||
|
item.count = 0;
|
||||||
|
item.is_looted = true;
|
||||||
|
|
||||||
|
loot.NotifyItemRemoved(slotid);
|
||||||
|
--loot.unlootedCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (loot == null)
|
foreach (var resultValue in aeResult.GetByOrder())
|
||||||
return;
|
|
||||||
|
|
||||||
if (slotid >= loot.items.Count + loot.quest_items.Count)
|
|
||||||
{
|
{
|
||||||
Log.outDebug(LogFilter.Loot, "MasterLootItem: Player {0} might be using a hack! (slot {1}, size {2})",
|
target.SendNewItem(resultValue.item, resultValue.count, false, false, true);
|
||||||
GetPlayer().GetName(), slotid, loot.items.Count);
|
target.UpdateCriteria(CriteriaTypes.LootItem, resultValue.item.GetEntry(), resultValue.count);
|
||||||
return;
|
target.UpdateCriteria(CriteriaTypes.LootType, resultValue.item.GetEntry(), resultValue.count, (ulong)resultValue.lootType);
|
||||||
|
target.UpdateCriteria(CriteriaTypes.LootEpicItem, resultValue.item.GetEntry(), resultValue.count);
|
||||||
}
|
}
|
||||||
|
|
||||||
LootItem item = slotid >= loot.items.Count ? loot.quest_items[slotid - loot.items.Count] : loot.items[slotid];
|
|
||||||
|
|
||||||
List<ItemPosCount> dest = new List<ItemPosCount>();
|
|
||||||
InventoryResult msg = target.CanStoreNewItem(ItemConst.NullBag, ItemConst.NullSlot, dest, item.itemid, item.count);
|
|
||||||
if (item.follow_loot_rules && !item.AllowedForPlayer(target))
|
|
||||||
msg = InventoryResult.CantEquipEver;
|
|
||||||
if (msg != InventoryResult.Ok)
|
|
||||||
{
|
|
||||||
if (msg == InventoryResult.ItemMaxCount)
|
|
||||||
GetPlayer().SendLootError(lootguid, ObjectGuid.Empty, LootError.MasterUniqueItem);
|
|
||||||
else if (msg == InventoryResult.InvFull)
|
|
||||||
GetPlayer().SendLootError(lootguid, ObjectGuid.Empty, LootError.MasterInvFull);
|
|
||||||
else
|
|
||||||
GetPlayer().SendLootError(lootguid, ObjectGuid.Empty, LootError.MasterOther);
|
|
||||||
|
|
||||||
target.SendEquipError(msg, null, null, item.itemid);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// not move item from loot to target inventory
|
|
||||||
Item newitem = target.StoreNewItem(dest, item.itemid, true, item.randomBonusListId, item.GetAllowedLooters(), item.context, item.BonusListIDs);
|
|
||||||
target.SendNewItem(newitem, item.count, false, false, true);
|
|
||||||
target.UpdateCriteria(CriteriaTypes.LootItem, item.itemid, item.count);
|
|
||||||
target.UpdateCriteria(CriteriaTypes.LootType, item.itemid, item.count, (ulong)loot.loot_type);
|
|
||||||
target.UpdateCriteria(CriteriaTypes.LootEpicItem, item.itemid, item.count);
|
|
||||||
|
|
||||||
// mark as looted
|
|
||||||
item.count = 0;
|
|
||||||
item.is_looted = true;
|
|
||||||
|
|
||||||
loot.NotifyItemRemoved(slotid);
|
|
||||||
--loot.unlootedCount;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[WorldPacketHandler(ClientOpcodes.SetLootSpecialization)]
|
[WorldPacketHandler(ClientOpcodes.SetLootSpecialization)]
|
||||||
|
|||||||
@@ -401,9 +401,11 @@ namespace Game
|
|||||||
SendPacket(packet);
|
SendPacket(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendPetStableResult(byte res)
|
void SendPetStableResult(StableResult result)
|
||||||
{
|
{
|
||||||
SendPacket(new PetStableResult(res));
|
PetStableResult petStableResult = new PetStableResult();
|
||||||
|
petStableResult.Result = result;
|
||||||
|
SendPacket(petStableResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
[WorldPacketHandler(ClientOpcodes.RepairItem)]
|
[WorldPacketHandler(ClientOpcodes.RepairItem)]
|
||||||
|
|||||||
@@ -422,7 +422,7 @@ namespace Game
|
|||||||
|
|
||||||
if (!pet.IsAlive())
|
if (!pet.IsAlive())
|
||||||
{
|
{
|
||||||
pet.SendPetActionFeedback(packet.SpellID, ActionFeedback.PetDead);
|
pet.SendPetActionFeedback(PetActionFeedback.Dead, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -442,6 +442,19 @@ namespace Game.Networking.Packets
|
|||||||
public override void Read() { }
|
public override void Read() { }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class RatedBattlefieldInfo : ServerPacket
|
||||||
|
{
|
||||||
|
public RatedBattlefieldInfo() : base(ServerOpcodes.RatedBattlefieldInfo) { }
|
||||||
|
|
||||||
|
public override void Write()
|
||||||
|
{
|
||||||
|
foreach (BracketInfo bracket in Bracket)
|
||||||
|
bracket.Write(_worldPacket);
|
||||||
|
}
|
||||||
|
|
||||||
|
BracketInfo[] Bracket = new BracketInfo[6];
|
||||||
|
}
|
||||||
|
|
||||||
class PVPMatchInit : ServerPacket
|
class PVPMatchInit : ServerPacket
|
||||||
{
|
{
|
||||||
public PVPMatchInit() : base(ServerOpcodes.PvpMatchInit, ConnectionType.Instance) { }
|
public PVPMatchInit() : base(ServerOpcodes.PvpMatchInit, ConnectionType.Instance) { }
|
||||||
@@ -497,6 +510,43 @@ namespace Game.Networking.Packets
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Structs
|
//Structs
|
||||||
|
class BracketInfo
|
||||||
|
{
|
||||||
|
public int PersonalRating;
|
||||||
|
public int Ranking;
|
||||||
|
public int SeasonPlayed;
|
||||||
|
public int SeasonWon;
|
||||||
|
public int Unused1;
|
||||||
|
public int Unused2;
|
||||||
|
public int WeeklyPlayed;
|
||||||
|
public int WeeklyWon;
|
||||||
|
public int BestWeeklyRating;
|
||||||
|
public int LastWeeksBestRating;
|
||||||
|
public int BestSeasonRating;
|
||||||
|
public int PvpTierID;
|
||||||
|
public int Unused3;
|
||||||
|
public bool Unused4;
|
||||||
|
|
||||||
|
public void Write(WorldPacket data)
|
||||||
|
{
|
||||||
|
data.WriteInt32(PersonalRating);
|
||||||
|
data.WriteInt32(Ranking);
|
||||||
|
data.WriteInt32(SeasonPlayed);
|
||||||
|
data.WriteInt32(SeasonWon);
|
||||||
|
data.WriteInt32(Unused1);
|
||||||
|
data.WriteInt32(Unused2);
|
||||||
|
data.WriteInt32(WeeklyPlayed);
|
||||||
|
data.WriteInt32(WeeklyWon);
|
||||||
|
data.WriteInt32(BestWeeklyRating);
|
||||||
|
data.WriteInt32(LastWeeksBestRating);
|
||||||
|
data.WriteInt32(BestSeasonRating);
|
||||||
|
data.WriteInt32(PvpTierID);
|
||||||
|
data.WriteInt32(Unused3);
|
||||||
|
data.WriteBit(Unused4);
|
||||||
|
data.FlushBits();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public class PVPLogData
|
public class PVPLogData
|
||||||
{
|
{
|
||||||
public List<PVPMatchPlayerStatistics> Statistics = new List<PVPMatchPlayerStatistics>();
|
public List<PVPMatchPlayerStatistics> Statistics = new List<PVPMatchPlayerStatistics>();
|
||||||
|
|||||||
@@ -525,24 +525,24 @@ namespace Game.Networking.Packets
|
|||||||
|
|
||||||
class EnchantmentLog : ServerPacket
|
class EnchantmentLog : ServerPacket
|
||||||
{
|
{
|
||||||
public EnchantmentLog() : base(ServerOpcodes.EnchantmentLog) { }
|
public EnchantmentLog() : base(ServerOpcodes.EnchantmentLog, ConnectionType.Instance) { }
|
||||||
|
|
||||||
public override void Write()
|
public override void Write()
|
||||||
{
|
{
|
||||||
_worldPacket.WritePackedGuid(Caster);
|
|
||||||
_worldPacket.WritePackedGuid(Owner);
|
_worldPacket.WritePackedGuid(Owner);
|
||||||
|
_worldPacket.WritePackedGuid(Caster);
|
||||||
_worldPacket.WritePackedGuid(ItemGUID);
|
_worldPacket.WritePackedGuid(ItemGUID);
|
||||||
_worldPacket.WriteUInt32(ItemID);
|
_worldPacket.WriteUInt32(ItemID);
|
||||||
_worldPacket.WriteUInt32(Enchantment);
|
_worldPacket.WriteUInt32(Enchantment);
|
||||||
_worldPacket.WriteUInt32(EnchantSlot);
|
_worldPacket.WriteUInt32(EnchantSlot);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ObjectGuid Caster;
|
|
||||||
public ObjectGuid Owner;
|
public ObjectGuid Owner;
|
||||||
|
public ObjectGuid Caster;
|
||||||
public ObjectGuid ItemGUID;
|
public ObjectGuid ItemGUID;
|
||||||
public uint ItemID;
|
public uint ItemID;
|
||||||
public uint EnchantSlot;
|
|
||||||
public uint Enchantment;
|
public uint Enchantment;
|
||||||
|
public uint EnchantSlot;
|
||||||
}
|
}
|
||||||
|
|
||||||
class CancelTempEnchantment : ClientPacket
|
class CancelTempEnchantment : ClientPacket
|
||||||
|
|||||||
@@ -102,6 +102,28 @@ namespace Game.Networking.Packets
|
|||||||
public List<LootRequest> Loot = new List<LootRequest>();
|
public List<LootRequest> Loot = new List<LootRequest>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class MasterLootItem : ClientPacket
|
||||||
|
{
|
||||||
|
public MasterLootItem(WorldPacket packet) : base(packet) { }
|
||||||
|
|
||||||
|
public override void Read()
|
||||||
|
{
|
||||||
|
uint Count = _worldPacket.ReadUInt32();
|
||||||
|
Target = _worldPacket.ReadPackedGuid();
|
||||||
|
|
||||||
|
for (uint i = 0; i < Count; ++i)
|
||||||
|
{
|
||||||
|
LootRequest lootRequest = new LootRequest();
|
||||||
|
lootRequest.Object = _worldPacket.ReadPackedGuid();
|
||||||
|
lootRequest.LootListID = _worldPacket.ReadUInt8();
|
||||||
|
Loot.Add(lootRequest);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Array<LootRequest> Loot = new Array<LootRequest>(1000);
|
||||||
|
public ObjectGuid Target;
|
||||||
|
}
|
||||||
|
|
||||||
class LootRemoved : ServerPacket
|
class LootRemoved : ServerPacket
|
||||||
{
|
{
|
||||||
public LootRemoved() : base(ServerOpcodes.LootRemoved, ConnectionType.Instance) { }
|
public LootRemoved() : base(ServerOpcodes.LootRemoved, ConnectionType.Instance) { }
|
||||||
@@ -337,6 +359,21 @@ namespace Game.Networking.Packets
|
|||||||
public byte LootListID;
|
public byte LootListID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class MasterLootCandidateList : ServerPacket
|
||||||
|
{
|
||||||
|
public MasterLootCandidateList() : base(ServerOpcodes.MasterLootCandidateList, ConnectionType.Instance) { }
|
||||||
|
|
||||||
|
public override void Write()
|
||||||
|
{
|
||||||
|
_worldPacket.WritePackedGuid(LootObj);
|
||||||
|
_worldPacket.WriteInt32(Players.Count);
|
||||||
|
Players.ForEach(guid => _worldPacket.WritePackedGuid(guid));
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ObjectGuid> Players = new List<ObjectGuid>();
|
||||||
|
public ObjectGuid LootObj;
|
||||||
|
}
|
||||||
|
|
||||||
class AELootTargets : ServerPacket
|
class AELootTargets : ServerPacket
|
||||||
{
|
{
|
||||||
public AELootTargets(uint count) : base(ServerOpcodes.AeLootTargets, ConnectionType.Instance)
|
public AELootTargets(uint count) : base(ServerOpcodes.AeLootTargets, ConnectionType.Instance)
|
||||||
@@ -359,21 +396,6 @@ namespace Game.Networking.Packets
|
|||||||
public override void Write() { }
|
public override void Write() { }
|
||||||
}
|
}
|
||||||
|
|
||||||
class MasterLootCandidateList : ServerPacket
|
|
||||||
{
|
|
||||||
public MasterLootCandidateList() : base(ServerOpcodes.MasterLootCandidateList) { }
|
|
||||||
|
|
||||||
public override void Write()
|
|
||||||
{
|
|
||||||
_worldPacket.WritePackedGuid(LootObj);
|
|
||||||
_worldPacket.WriteInt32(Players.Count);
|
|
||||||
Players.ForEach(guid => _worldPacket.WritePackedGuid(guid));
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<ObjectGuid> Players = new List<ObjectGuid>();
|
|
||||||
public ObjectGuid LootObj;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Structs
|
//Structs
|
||||||
public class LootItemData
|
public class LootItemData
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -105,6 +105,13 @@ namespace Game.Networking.Packets
|
|||||||
public int GameTimeHolidayOffset;
|
public int GameTimeHolidayOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class ResetWeeklyCurrency : ServerPacket
|
||||||
|
{
|
||||||
|
public ResetWeeklyCurrency() : base(ServerOpcodes.ResetWeeklyCurrency, ConnectionType.Instance) { }
|
||||||
|
|
||||||
|
public override void Write() { }
|
||||||
|
}
|
||||||
|
|
||||||
public class SetCurrency : ServerPacket
|
public class SetCurrency : ServerPacket
|
||||||
{
|
{
|
||||||
public SetCurrency() : base(ServerOpcodes.SetCurrency, ConnectionType.Instance) { }
|
public SetCurrency() : base(ServerOpcodes.SetCurrency, ConnectionType.Instance) { }
|
||||||
@@ -168,13 +175,6 @@ namespace Game.Networking.Packets
|
|||||||
public uint Type;
|
public uint Type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ResetWeeklyCurrency : ServerPacket
|
|
||||||
{
|
|
||||||
public ResetWeeklyCurrency() : base(ServerOpcodes.ResetWeeklyCurrency, ConnectionType.Instance) { }
|
|
||||||
|
|
||||||
public override void Write() { }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class SetSelection : ClientPacket
|
public class SetSelection : ClientPacket
|
||||||
{
|
{
|
||||||
public SetSelection(WorldPacket packet) : base(packet) { }
|
public SetSelection(WorldPacket packet) : base(packet) { }
|
||||||
|
|||||||
@@ -164,6 +164,18 @@ namespace Game.Networking.Packets
|
|||||||
public List<PetStableInfo> Pets = new List<PetStableInfo>();
|
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
|
class PetLearnedSpells : ServerPacket
|
||||||
{
|
{
|
||||||
public PetLearnedSpells() : base(ServerOpcodes.PetLearnedSpells, ConnectionType.Instance) { }
|
public PetLearnedSpells() : base(ServerOpcodes.PetLearnedSpells, ConnectionType.Instance) { }
|
||||||
@@ -288,34 +300,6 @@ namespace Game.Networking.Packets
|
|||||||
public uint Action;
|
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
|
class PetCancelAura : ClientPacket
|
||||||
{
|
{
|
||||||
public PetCancelAura(WorldPacket packet) : base(packet) { }
|
public PetCancelAura(WorldPacket packet) : base(packet) { }
|
||||||
@@ -330,22 +314,6 @@ namespace Game.Networking.Packets
|
|||||||
public uint SpellID;
|
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
|
class SetPetSpecialization : ServerPacket
|
||||||
{
|
{
|
||||||
public SetPetSpecialization() : base(ServerOpcodes.SetPetSpecialization) { }
|
public SetPetSpecialization() : base(ServerOpcodes.SetPetSpecialization) { }
|
||||||
@@ -358,6 +326,34 @@ namespace Game.Networking.Packets
|
|||||||
public ushort SpecID;
|
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
|
//Structs
|
||||||
public class PetSpellCooldown
|
public class PetSpellCooldown
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user