Core/Players: Implement warband scene collection
Port From (https://github.com/TrinityCore/TrinityCore/commit/29e032707686b18bbcce7029e8dd2eaa6606f6d4)
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
||||
|
||||
using Framework.Constants;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Game.Networking.Packets
|
||||
{
|
||||
@@ -20,4 +21,43 @@ namespace Game.Networking.Packets
|
||||
public uint Id;
|
||||
public bool IsFavorite;
|
||||
}
|
||||
|
||||
class AccountItemCollectionData : ServerPacket
|
||||
{
|
||||
public AccountItemCollectionData() : base(ServerOpcodes.AccountItemCollectionData) { }
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WriteUInt32(Unknown1110_1);
|
||||
_worldPacket.WriteUInt8((byte)Type);
|
||||
_worldPacket.WriteInt32(Items.Count);
|
||||
|
||||
foreach (ItemCollectionItemData item in Items)
|
||||
item.Write(_worldPacket);
|
||||
|
||||
_worldPacket.WriteBit(Unknown1110_2);
|
||||
_worldPacket.FlushBits();
|
||||
}
|
||||
|
||||
public uint Unknown1110_1;
|
||||
public ItemCollectionType Type;
|
||||
public bool Unknown1110_2;
|
||||
public List<ItemCollectionItemData> Items = new();
|
||||
}
|
||||
|
||||
struct ItemCollectionItemData
|
||||
{
|
||||
public int Id;
|
||||
public ItemCollectionType Type;
|
||||
public long Unknown1110;
|
||||
public int Flags;
|
||||
|
||||
public void Write(WorldPacket packet)
|
||||
{
|
||||
packet.WriteInt32(Id);
|
||||
packet.WriteUInt8((byte)Type);
|
||||
packet.WriteInt64(Unknown1110);
|
||||
packet.WriteInt32(Flags);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1484,6 +1484,33 @@ namespace Game.Networking.Packets
|
||||
public ObjectGuid SourceGuid;
|
||||
}
|
||||
|
||||
class AccountWarbandSceneUpdate : ServerPacket
|
||||
{
|
||||
public bool IsFullUpdate;
|
||||
public Dictionary<uint, WarbandSceneCollectionItem> WarbandScenes;
|
||||
|
||||
public AccountWarbandSceneUpdate() : base(ServerOpcodes.AccountWarbandSceneUpdate) { }
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WriteBit(IsFullUpdate);
|
||||
_worldPacket.WriteInt32(WarbandScenes.Count);
|
||||
_worldPacket.WriteInt32(WarbandScenes.Count);
|
||||
_worldPacket.WriteInt32(WarbandScenes.Count);
|
||||
|
||||
foreach (var (warbandSceneId, _) in WarbandScenes)
|
||||
_worldPacket.WriteUInt32(warbandSceneId);
|
||||
|
||||
foreach (var (_, data) in WarbandScenes)
|
||||
_worldPacket.WriteBit(data.Flags.HasFlag(WarbandSceneCollectionFlags.Favorite));
|
||||
|
||||
foreach (var (_, data) in WarbandScenes)
|
||||
_worldPacket.WriteBit(data.Flags.HasFlag(WarbandSceneCollectionFlags.HasFanfare));
|
||||
|
||||
_worldPacket.FlushBits();
|
||||
}
|
||||
}
|
||||
|
||||
//Structs
|
||||
struct PhaseShiftDataPhase
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user