Hondacrx
2024-08-24 00:13:35 -04:00
parent ce99a1f7f6
commit 1ca497b79f
27 changed files with 3020 additions and 2701 deletions
@@ -22,7 +22,10 @@ namespace Game.Networking.Packets
_worldPacket.WriteInt32(PreviousArenaSeason);
_worldPacket.WriteInt32(ConquestWeeklyProgressCurrencyID);
_worldPacket.WriteInt32(PvpSeasonID);
_worldPacket.WriteInt32(Unknown1027_1);
_worldPacket.WriteBit(WeeklyRewardChestsEnabled);
_worldPacket.WriteBit(Unknown1027_2);
_worldPacket.WriteBit(Unknown1027_3);
_worldPacket.FlushBits();
}
@@ -32,7 +35,10 @@ namespace Game.Networking.Packets
public int CurrentArenaSeason;
public int PvpSeasonID;
public int ConquestWeeklyProgressCurrencyID;
public int Unknown1027_1;
public bool WeeklyRewardChestsEnabled;
public bool Unknown1027_2;
public bool Unknown1027_3;
}
public class AreaSpiritHealerQuery : ClientPacket
@@ -202,6 +202,7 @@ namespace Game.Networking.Packets
data.WriteInt32(MailSenderTypes.Count);
data.WriteUInt32(OverrideSelectScreenFileDataID);
PersonalTabard.Write(data);
data.WriteInt32(TimerunningSeasonID);
foreach (ChrCustomizationChoice customization in Customizations)
{
@@ -255,6 +256,7 @@ namespace Game.Networking.Packets
public int Unknown703;
public int LastLoginVersion;
public uint OverrideSelectScreenFileDataID;
public int TimerunningSeasonID;
public uint PetCreatureDisplayId;
public uint PetExperienceLevel;
public uint PetCreatureFamilyId;
@@ -386,7 +388,7 @@ namespace Game.Networking.Packets
CreateInfo.ClassId = (Class)_worldPacket.ReadUInt8();
CreateInfo.Sex = (Gender)_worldPacket.ReadUInt8();
var customizationCount = _worldPacket.ReadUInt32();
CreateInfo.TimerunningSeasonID = _worldPacket.ReadInt32();
CreateInfo.Name = _worldPacket.ReadString(nameLength);
if (CreateInfo.TemplateSet.HasValue)
CreateInfo.TemplateSet = _worldPacket.ReadUInt32();
@@ -1137,6 +1139,7 @@ namespace Game.Networking.Packets
public Gender Sex = Gender.None;
public Array<ChrCustomizationChoice> Customizations = new(250);
public uint? TemplateSet;
public int TimerunningSeasonID;
public bool IsTrialBoost;
public bool UseNPE;
public bool Unused1026;
+42 -9
View File
@@ -45,15 +45,30 @@ namespace Game.Networking.Packets
public override void Read()
{
Language = (Language)_worldPacket.ReadInt32();
uint targetLen = _worldPacket.ReadBits<uint>(9);
TargetGUID = _worldPacket.ReadPackedGuid();
TargetVirtualRealmAddress = _worldPacket.ReadUInt32();
uint targetLen = _worldPacket.ReadBits<uint>(6);
uint textLen = _worldPacket.ReadBits<uint>(11);
Target = _worldPacket.ReadString(targetLen);
Text = _worldPacket.ReadString(textLen);
if (targetLen > 1)
{
Target = _worldPacket.ReadString(targetLen - 1);
_worldPacket.Skip(1); // null terminator
}
if (textLen > 1)
{
Text = _worldPacket.ReadString(textLen - 1);
_worldPacket.Skip(1); // null terminator
}
}
public Language Language = Language.Universal;
public string Text;
public ObjectGuid TargetGUID;
public uint TargetVirtualRealmAddress = 0;
public string Target;
public string Text;
}
public class ChatMessageChannel : ClientPacket
@@ -98,15 +113,33 @@ namespace Game.Networking.Packets
public override void Read()
{
uint targetLen = _worldPacket.ReadBits<uint>(9);
Params.Read(_worldPacket);
ChannelGUID = _worldPacket.ReadPackedGuid();
Target = _worldPacket.ReadString(targetLen);
PlayerGUID = _worldPacket.ReadPackedGuid();
PlayerVirtualRealmAddress = _worldPacket.ReadUInt32();
uint playerNameLength = _worldPacket.ReadBits<uint>(6);
uint channelNameLength = _worldPacket.ReadBits<uint>(6);
if (playerNameLength > 1)
{
PlayerName = _worldPacket.ReadString(playerNameLength - 1);
_worldPacket.Skip(1); // null terminator
}
if (channelNameLength > 1)
{
ChannelName = _worldPacket.ReadString(channelNameLength - 1);
_worldPacket.Skip(1); // null terminator
}
}
public string Target;
public ChatAddonMessageParams Params = new();
public ObjectGuid? ChannelGUID; // not optional in the packet. Optional for api reasons
public string PlayerName;
public ObjectGuid PlayerGUID;
public uint PlayerVirtualRealmAddress = 0;
public string ChannelName;
public ObjectGuid ChannelGUID;
}
public class ChatMessageDND : ClientPacket
@@ -220,6 +253,7 @@ namespace Game.Networking.Packets
_worldPacket.WriteUInt32(TargetVirtualAddress);
_worldPacket.WriteUInt32(SenderVirtualAddress);
_worldPacket.WriteUInt32(AchievementID);
_worldPacket.WriteUInt16((ushort)_ChatFlags);
_worldPacket.WriteFloat(DisplayTime);
_worldPacket.WriteUInt32(SpellID);
_worldPacket.WriteBits(SenderName.GetByteCount(), 11);
@@ -227,7 +261,6 @@ namespace Game.Networking.Packets
_worldPacket.WriteBits(Prefix.GetByteCount(), 5);
_worldPacket.WriteBits(Channel.GetByteCount(), 7);
_worldPacket.WriteBits(ChatText.GetByteCount(), 12);
_worldPacket.WriteBits((ushort)_ChatFlags, 15);
_worldPacket.WriteBit(HideChatLog);
_worldPacket.WriteBit(FakeSenderName);
_worldPacket.WriteBit(Unused_801.HasValue);
@@ -1286,13 +1286,19 @@ namespace Game.Networking.Packets
public override void Write()
{
_worldPacket.WriteInt64(TotalTime);
_worldPacket.WriteInt64(TimeLeft);
_worldPacket.WriteInt32((int)Type);
_worldPacket.WriteInt64(TimeLeft);
_worldPacket.WriteBit(PlayerGuid.HasValue);
_worldPacket.FlushBits();
if (PlayerGuid.HasValue)
_worldPacket.WritePackedGuid(PlayerGuid.Value);
}
public long TotalTime;
public long TimeLeft;
public CountdownTimerType Type;
public ObjectGuid? PlayerGuid;
}
class QueryCountdownTimer : ClientPacket
+14 -2
View File
@@ -40,6 +40,18 @@ namespace Game.Networking.Packets
public ObjectGuid Pet;
}
class PetAbandonByNumber : ClientPacket
{
public uint PetNumber;
public PetAbandonByNumber(WorldPacket packet) : base(packet) { }
public override void Read()
{
PetNumber = _worldPacket.ReadUInt32();
}
}
class PetStopAttack : ClientPacket
{
public PetStopAttack(WorldPacket packet) : base(packet) { }
@@ -271,7 +283,7 @@ namespace Game.Networking.Packets
TargetGUID = _worldPacket.ReadPackedGuid();
}
}
class PetCancelAura : ClientPacket
{
public PetCancelAura(WorldPacket packet) : base(packet) { }
@@ -354,7 +366,7 @@ namespace Game.Networking.Packets
_worldPacket.WriteUInt8((byte)ReactState);
}
}
//Structs
public class PetSpellCooldown
{
+3 -19
View File
@@ -565,25 +565,6 @@ namespace Game.Networking.Packets
}
//Structs
public class PlayerGuidLookupHint
{
public void Write(WorldPacket data)
{
data.WriteBit(VirtualRealmAddress.HasValue);
data.WriteBit(NativeRealmAddress.HasValue);
data.FlushBits();
if (VirtualRealmAddress.HasValue)
data.WriteUInt32(VirtualRealmAddress.Value);
if (NativeRealmAddress.HasValue)
data.WriteUInt32(NativeRealmAddress.Value);
}
public uint? VirtualRealmAddress = new(); // current realm (?) (identifier made from the Index, BattleGroup and Region)
public uint? NativeRealmAddress = new(); // original realm (?) (identifier made from the Index, BattleGroup and Region)
}
public class PlayerGuidLookupData
{
public bool Initialize(ObjectGuid guid, Player player = null)
@@ -603,6 +584,7 @@ namespace Game.Networking.Packets
Sex = player.GetNativeGender();
ClassID = player.GetClass();
Level = (byte)player.GetLevel();
TimerunningSeasonID = player.m_activePlayerData.TimerunningSeasonID;
DeclinedNames names = player.GetDeclinedNames();
if (names != null)
@@ -651,6 +633,7 @@ namespace Game.Networking.Packets
data.WriteUInt8((byte)ClassID);
data.WriteUInt8(Level);
data.WriteUInt8(Unused915);
data.WriteInt32(TimerunningSeasonID);
data.WriteString(Name);
}
@@ -666,6 +649,7 @@ namespace Game.Networking.Packets
public Class ClassID = Class.None;
public byte Level;
public byte Unused915;
public int TimerunningSeasonID;
public DeclinedName DeclinedNames = new();
}
@@ -492,6 +492,7 @@ namespace Game.Networking.Packets
_worldPacket.WriteBits(PortraitTurnInText.GetByteCount(), 10);
_worldPacket.WriteBits(PortraitTurnInName.GetByteCount(), 8);
_worldPacket.WriteBit(AutoLaunched);
_worldPacket.WriteBit(FromContentPush);
_worldPacket.WriteBit(false); // unused in client
_worldPacket.WriteBit(StartCheat);
_worldPacket.WriteBit(DisplayPopup);
@@ -539,6 +540,7 @@ namespace Game.Networking.Packets
public bool DisplayPopup;
public bool StartCheat;
public bool AutoLaunched;
public bool FromContentPush;
}
public class QuestGiverRequestItems : ServerPacket
+13 -4
View File
@@ -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 Game.DataStorage;
using Game.Entities;
using Game.Spells;
using System;
@@ -1378,11 +1379,15 @@ namespace Game.Networking.Packets
TuningType = ContentTuningType.CreatureToPlayerDamage;
PlayerLevelDelta = (short)target.m_activePlayerData.ScalingPlayerLevelDelta;
PlayerItemLevel = (ushort)target.GetAverageItemLevel();
ScalingHealthItemLevelCurveID = (ushort)target.m_unitData.ScalingHealthItemLevelCurveID;
var contentTuning = CliDB.ContentTuningStorage.LookupByKey(creatureDifficulty.ContentTuningID);
if (contentTuning != null)
{
ScalingHealthItemLevelCurveID = (uint)contentTuning.HealthItemLevelCurveID;
TargetContentTuningID = contentTuning.Id;
}
TargetLevel = (byte)target.GetLevel();
Expansion = (byte)creatureDifficulty.HealthScalingExpansion;
TargetScalingLevelDelta = (sbyte)attacker.m_unitData.ScalingLevelDelta;
TargetContentTuningID = creatureDifficulty.ContentTuningID;
return true;
}
@@ -1394,11 +1399,15 @@ namespace Game.Networking.Packets
TuningType = ContentTuningType.PlayerToCreatureDamage;
PlayerLevelDelta = (short)attacker.m_activePlayerData.ScalingPlayerLevelDelta;
PlayerItemLevel = (ushort)attacker.GetAverageItemLevel();
ScalingHealthItemLevelCurveID = (ushort)target.m_unitData.ScalingHealthItemLevelCurveID;
var contentTuning = CliDB.ContentTuningStorage.LookupByKey(creatureDifficulty.ContentTuningID);
if (contentTuning != null)
{
ScalingHealthItemLevelCurveID = (uint)contentTuning.HealthItemLevelCurveID;
TargetContentTuningID = contentTuning.Id;
}
TargetLevel = (byte)target.GetLevel();
Expansion = (byte)creatureDifficulty.HealthScalingExpansion;
TargetScalingLevelDelta = (sbyte)target.m_unitData.ScalingLevelDelta;
TargetContentTuningID = creatureDifficulty.ContentTuningID;
return true;
}
@@ -2,10 +2,9 @@
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
using Framework.Constants;
using Framework.Dynamic;
using Game.Entities;
using System;
using System.Collections.Generic;
using Game.Entities;
namespace Game.Networking.Packets
{
@@ -41,6 +40,10 @@ namespace Game.Networking.Packets
_worldPacket.WriteInt16(PlayerNameQueryTelemetryInterval);
_worldPacket.WriteUInt32((uint)PlayerNameQueryInterval.TotalSeconds);
_worldPacket.WriteInt32(AddonChatThrottle.MaxTries);
_worldPacket.WriteInt32(AddonChatThrottle.TriesRestoredPerSecond);
_worldPacket.WriteInt32(AddonChatThrottle.UsedTriesPerMessage);
foreach (GameRuleValuePair gameRuleValue in GameRuleValues)
gameRuleValue.Write(_worldPacket);
@@ -76,9 +79,10 @@ namespace Game.Networking.Packets
_worldPacket.WriteBit(QuestSessionEnabled);
_worldPacket.WriteBit(IsMuted);
_worldPacket.WriteBit(ClubFinderEnabled);
_worldPacket.WriteBit(CommunityFinderEnabled);
_worldPacket.WriteBit(Unknown901CheckoutRelated);
_worldPacket.WriteBit(TextToSpeechFeatureEnabled);
_worldPacket.WriteBit(ChatDisabledByDefault);
_worldPacket.WriteBit(ChatDisabledByPlayer);
_worldPacket.WriteBit(LFGListCustomRequiresAuthenticator);
@@ -87,9 +91,15 @@ namespace Game.Networking.Packets
_worldPacket.WriteBit(ContentTrackingEnabled);
_worldPacket.WriteBit(IsSellAllJunkEnabled);
_worldPacket.WriteBit(IsGroupFinderEnabled);
_worldPacket.WriteBit(IsLFDEnabled);
_worldPacket.WriteBit(IsLFREnabled);
_worldPacket.WriteBit(IsPremadeGroupEnabled);
_worldPacket.WriteBit(CanShowSetRoleButton);
_worldPacket.WriteBit(false); // unused 10.2.7
_worldPacket.WriteBit(false); // unused 10.2.7
_worldPacket.WriteBits(Unknown1027.GetByteCount(), 7);
_worldPacket.FlushBits();
@@ -126,6 +136,8 @@ namespace Game.Networking.Packets
_worldPacket.WriteInt32(SessionAlert.Value.DisplayTime);
}
_worldPacket.WriteString(Unknown1027);
_worldPacket.WriteBit(Squelch.IsSquelched);
_worldPacket.WritePackedGuid(Squelch.BnetAccountGuid);
_worldPacket.WritePackedGuid(Squelch.GuildGuid);
@@ -175,6 +187,7 @@ namespace Game.Networking.Packets
public bool QuestSessionEnabled;
public bool IsMuted;
public bool ClubFinderEnabled;
public bool CommunityFinderEnabled;
public bool Unknown901CheckoutRelated;
public bool TextToSpeechFeatureEnabled;
public bool ChatDisabledByDefault;
@@ -188,11 +201,14 @@ namespace Game.Networking.Packets
public bool IsLFDEnabled = true; // classic only
public bool IsLFREnabled = true; // classic only
public bool IsPremadeGroupEnabled = true; // classic only
public bool CanShowSetRoleButton = true;
public SocialQueueConfig QuickJoinConfig;
public SquelchInfo Squelch;
public RafSystemFeatureInfo RAFSystem;
public List<GameRuleValuePair> GameRuleValues = new();
public string Unknown1027; // related to movement lua functions used by keybinds
public AddonChatThrottleParams AddonChatThrottle;
public struct SessionAlertConfig
{
@@ -245,6 +261,13 @@ namespace Game.Networking.Packets
public uint DaysInCycle;
public uint Unknown1007;
}
public struct AddonChatThrottleParams
{
public int MaxTries;
public int TriesRestoredPerSecond;
public int UsedTriesPerMessage;
}
}
public class FeatureSystemStatusGlueScreen : ServerPacket
@@ -277,9 +300,10 @@ namespace Game.Networking.Packets
_worldPacket.WriteBit(EuropaTicketSystemStatus.HasValue);
_worldPacket.WriteBit(IsNameReservationEnabled);
_worldPacket.WriteBit(LaunchETA.HasValue);
_worldPacket.WriteBit(TimerunningEnabled);
_worldPacket.WriteBit(AddonsDisabled);
_worldPacket.WriteBit(Unused1000);
_worldPacket.WriteBit(Unused1000);
_worldPacket.WriteBit(AccountSaveDataExportEnabled);
_worldPacket.WriteBit(AccountLockedByExport);
_worldPacket.WriteBit(!RealmHiddenAlert.IsEmpty());
@@ -304,6 +328,8 @@ namespace Game.Networking.Packets
_worldPacket.WriteInt32(MaximumExpansionLevel);
_worldPacket.WriteInt32(ActiveSeason);
_worldPacket.WriteInt32(GameRuleValues.Count);
_worldPacket.WriteInt32(ActiveTimerunningSeasonID);
_worldPacket.WriteInt32(RemainingTimerunningSeasonSeconds);
_worldPacket.WriteInt16(MaxPlayerNameQueriesPerPacket);
_worldPacket.WriteInt16(PlayerNameQueryTelemetryInterval);
_worldPacket.WriteUInt32((uint)PlayerNameQueryInterval.TotalSeconds);
@@ -346,6 +372,7 @@ namespace Game.Networking.Packets
public bool LiveRegionKeyBindingsCopyEnabled;
public bool Unknown901CheckoutRelated; // NYI
public bool IsNameReservationEnabled; // classic only
public bool TimerunningEnabled; // NYI
public bool AddonsDisabled;
public bool Unused1000;
public bool AccountSaveDataExportEnabled;
@@ -363,6 +390,8 @@ namespace Game.Networking.Packets
public uint KioskSessionMinutes;
public int ActiveSeason; // Currently active Classic season
public List<GameRuleValuePair> GameRuleValues = new();
public int ActiveTimerunningSeasonID;
public int RemainingTimerunningSeasonSeconds;
public short MaxPlayerNameQueriesPerPacket = 50;
public short PlayerNameQueryTelemetryInterval = 600;
public TimeSpan PlayerNameQueryInterval = TimeSpan.FromSeconds(10);