Core: Updated to 11.0.7

Port From (https://github.com/TrinityCore/TrinityCore/commit/4f7079f471401d5cf7885351baabc027813f60f5)
This commit is contained in:
Hondacrx
2025-05-18 19:05:48 -04:00
parent 2448c07600
commit 5b992859d0
32 changed files with 1669 additions and 1429 deletions
@@ -53,7 +53,7 @@ namespace Game.Networking.Packets
_worldPacket.WriteUInt8(DosZeroBits);
}
public byte[] Challenge = new byte[16];
public byte[] Challenge = new byte[32];
public byte[] DosChallenge = new byte[32]; // Encryption seeds
public byte DosZeroBits;
}
@@ -83,7 +83,7 @@ namespace Game.Networking.Packets
public uint RegionID;
public uint BattlegroupID;
public uint RealmID;
public Array<byte> LocalChallenge = new(16);
public Array<byte> LocalChallenge = new(32);
public byte[] Digest = new byte[24];
public ulong DosResponse;
public string RealmJoinTicket;
@@ -288,7 +288,9 @@ namespace Game.Networking.Packets
hash.Process((uint)Payload.Where.Type);
hash.Finish(BitConverter.GetBytes(Payload.Port));
Payload.Signature = RsaCrypt.RSA.SignHash(hash.Digest, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1).Reverse().ToArray();
var signHash = RsaCrypt.RSA.SignHash(hash.Digest, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
signHash.Reverse();
Payload.Signature = signHash;
_worldPacket.WriteBytes(Payload.Signature, (uint)Payload.Signature.Length);
_worldPacket.WriteBytes(whereBuffer);
@@ -341,7 +343,7 @@ namespace Game.Networking.Packets
public ulong DosResponse;
public ulong Key;
public byte[] LocalChallenge = new byte[16];
public byte[] LocalChallenge = new byte[32];
public byte[] Digest = new byte[24];
}
@@ -372,7 +374,8 @@ namespace Game.Networking.Packets
bool Enabled;
static byte[] expandedPrivateKey;
static byte[] EnableEncryptionSeed = { 0x90, 0x9C, 0xD0, 0x50, 0x5A, 0x2C, 0x14, 0xDD, 0x5C, 0x2C, 0xC0, 0x64, 0x14, 0xF3, 0xFE, 0xC9 };
static byte[] EnableEncryptionSeed = { 0x66, 0xBE, 0x29, 0x79, 0xEF, 0xF2, 0xD5, 0xB5, 0x61, 0x53, 0xF6, 0x5F, 0x45, 0xAE, 0x81, 0xCB,
0x32, 0xEC, 0x94, 0xEC, 0x75, 0xB3, 0x5F, 0x44, 0x6A, 0x63, 0x43, 0x67, 0x17, 0x20, 0x44, 0x34 };
static byte[] EnableEncryptionContext = { 0xA7, 0x1F, 0xB6, 0x9B, 0xC9, 0x7C, 0xDD, 0x96, 0xE9, 0xBB, 0xB8, 0x21, 0x39, 0x8D, 0x5A, 0xD4 };
static byte[] EnterEncryptedModePrivateKey =
@@ -396,7 +399,7 @@ namespace Game.Networking.Packets
public override void Write()
{
HmacSha256 toSign = new(EncryptionKey);
HmacSha512 toSign = new(EncryptionKey);
toSign.Process(BitConverter.GetBytes(Enabled), 1);
toSign.Finish(EnableEncryptionSeed, 16);
@@ -100,6 +100,7 @@ namespace Game.Networking.Packets
_worldPacket.WriteBits(Channel.GetByteCount(), 7);
_worldPacket.WriteBits(ChannelWelcomeMsg.GetByteCount(), 11);
_worldPacket.WriteUInt32((uint)ChannelFlags);
_worldPacket.WriteUInt8(Unknown1107);
_worldPacket.WriteInt32(ChatChannelID);
_worldPacket.WriteUInt64(InstanceID);
_worldPacket.WritePackedGuid(ChannelGUID);
@@ -113,6 +114,7 @@ namespace Game.Networking.Packets
public ChannelFlags ChannelFlags;
public string Channel = "";
public ObjectGuid ChannelGUID;
public byte Unknown1107;
}
public class ChannelNotifyLeft : ServerPacket
@@ -849,9 +849,18 @@ namespace Game.Networking.Packets
public class LogoutComplete : ServerPacket
{
SwitchGameModeData SwitchGameMode;
public LogoutComplete() : base(ServerOpcodes.LogoutComplete) { }
public override void Write() { }
public override void Write()
{
_worldPacket.WriteBit(SwitchGameMode != null);
_worldPacket.FlushBits();
if (SwitchGameMode != null)
SwitchGameMode.Write(_worldPacket);
}
}
public class LogoutCancel : ClientPacket
@@ -1323,4 +1332,56 @@ namespace Game.Networking.Packets
member.Write(data);
}
}
class GameModeData
{
public int Unknown_1107_0;
public ObjectGuid Guid;
public byte GameMode;
public int MapID = 0;
public byte Unknown_1107_1;
public byte Unknown_1107_2;
public byte Unknown_1107_3;
public Array<ChrCustomizationChoice> Customizations = new(250);
public Array<ChrCustomizationChoice> Unknown_1107_4 = new(250);
public void Write(WorldPacket data)
{
data.WriteInt32(Unknown_1107_0);
data.WritePackedGuid(Guid);
data.WriteUInt8(GameMode);
data.WriteInt32(MapID);
data.WriteUInt8(Unknown_1107_1);
data.WriteUInt8(Unknown_1107_2);
data.WriteUInt8(Unknown_1107_3);
data.WriteInt32(Customizations.Count);
data.WriteInt32(Unknown_1107_4.Count);
foreach (ChrCustomizationChoice customization in Customizations)
{
data.WriteUInt32(customization.ChrCustomizationOptionID);
data.WriteUInt32(customization.ChrCustomizationChoiceID);
}
foreach (ChrCustomizationChoice customization in Unknown_1107_4)
{
data.WriteUInt32(customization.ChrCustomizationOptionID);
data.WriteUInt32(customization.ChrCustomizationChoiceID);
}
}
}
class SwitchGameModeData
{
public bool IsFastLogin;
public GameModeData Current;
public GameModeData New;
public void Write(WorldPacket data)
{
data.WriteBits(IsFastLogin, 1);
Current.Write(data);
New.Write(data);
}
}
}
+1 -1
View File
@@ -704,7 +704,7 @@ namespace Game.Networking.Packets
data.WriteBit(VotePassed);
data.WriteBit(MyVoteCompleted);
data.WriteBit(MyVote);
data.WriteBits(Reason.GetByteCount(), 8);
data.WriteBits(Reason.GetByteCount(), 9);
data.WritePackedGuid(Target);
data.WriteUInt32(TotalVotes);
data.WriteUInt32(BootVotes);
+22 -22
View File
@@ -585,18 +585,21 @@ namespace Game.Networking.Packets
public class StandStateChange : ClientPacket
{
public UnitStandStateType StandState;
public StandStateChange(WorldPacket packet) : base(packet) { }
public override void Read()
{
StandState = (UnitStandStateType)_worldPacket.ReadUInt32();
StandState = (UnitStandStateType)_worldPacket.ReadUInt8();
}
public UnitStandStateType StandState;
}
public class StandStateUpdate : ServerPacket
{
uint AnimKitID;
UnitStandStateType State;
public StandStateUpdate(UnitStandStateType state, uint animKitId) : base(ServerOpcodes.StandStateUpdate)
{
State = state;
@@ -605,12 +608,9 @@ namespace Game.Networking.Packets
public override void Write()
{
_worldPacket.WriteUInt32(AnimKitID);
_worldPacket.WriteUInt8((byte)State);
_worldPacket.WriteUInt32(AnimKitID);
}
uint AnimKitID;
UnitStandStateType State;
}
public class SetAnimTier : ServerPacket
@@ -630,6 +630,13 @@ namespace Game.Networking.Packets
public class StartMirrorTimer : ServerPacket
{
public MirrorTimerType Timer;
public int Scale;
public int MaxValue;
public int SpellID;
public int Value;
public bool Paused;
public StartMirrorTimer(MirrorTimerType timer, int value, int maxValue, int scale, int spellID, bool paused) : base(ServerOpcodes.StartMirrorTimer)
{
Timer = timer;
@@ -642,7 +649,7 @@ namespace Game.Networking.Packets
public override void Write()
{
_worldPacket.WriteInt32((int)Timer);
_worldPacket.WriteUInt8((byte)Timer);
_worldPacket.WriteInt32(Value);
_worldPacket.WriteInt32(MaxValue);
_worldPacket.WriteInt32(Scale);
@@ -650,17 +657,13 @@ namespace Game.Networking.Packets
_worldPacket.WriteBit(Paused);
_worldPacket.FlushBits();
}
public int Scale;
public int MaxValue;
public MirrorTimerType Timer;
public int SpellID;
public int Value;
public bool Paused;
}
public class PauseMirrorTimer : ServerPacket
{
public MirrorTimerType Timer;
public bool Paused = true;
public PauseMirrorTimer(MirrorTimerType timer, bool paused) : base(ServerOpcodes.PauseMirrorTimer)
{
Timer = timer;
@@ -669,17 +672,16 @@ namespace Game.Networking.Packets
public override void Write()
{
_worldPacket.WriteInt32((int)Timer);
_worldPacket.WriteUInt8((byte)Timer);
_worldPacket.WriteBit(Paused);
_worldPacket.FlushBits();
}
public bool Paused = true;
public MirrorTimerType Timer;
}
public class StopMirrorTimer : ServerPacket
{
public MirrorTimerType Timer;
public StopMirrorTimer(MirrorTimerType timer) : base(ServerOpcodes.StopMirrorTimer)
{
Timer = timer;
@@ -687,10 +689,8 @@ namespace Game.Networking.Packets
public override void Write()
{
_worldPacket.WriteInt32((int)Timer);
_worldPacket.WriteUInt8((byte)Timer);
}
public MirrorTimerType Timer;
}
public class ExplorationExperience : ServerPacket
@@ -10,12 +10,13 @@ namespace Game.Networking.Packets
public int BattlePetSpeciesID;
public int TransmogSetID;
public int ItemModifiedAppearanceID;
public int Field_14;
public int Field_18;
public int TransmogIllusionID;
public int ToyID;
public int Price;
public int OriginalPrice;
public long AvailableUntil;
public bool Disabled;
public bool Field_41;
public bool DoesNotExpire;
public void Write(WorldPacket data)
{
@@ -24,12 +25,13 @@ namespace Game.Networking.Packets
data.WriteInt32(BattlePetSpeciesID);
data.WriteInt32(TransmogSetID);
data.WriteInt32(ItemModifiedAppearanceID);
data.WriteInt32(Field_14);
data.WriteInt32(Field_18);
data.WriteInt32(TransmogIllusionID);
data.WriteInt32(ToyID);
data.WriteInt32(Price);
data.WriteInt32(OriginalPrice);
data.WriteInt64(AvailableUntil);
data.WriteBit(Disabled);
data.WriteBit(Field_41);
data.WriteBit(DoesNotExpire);
data.FlushBits();
}
}
+4 -2
View File
@@ -90,7 +90,8 @@ namespace Game.Networking.Packets
_worldPacket.WriteUInt16(CreatureFamily);
_worldPacket.WriteUInt16(Specialization);
_worldPacket.WriteUInt32(TimeLimit);
_worldPacket.WriteUInt16((ushort)((byte)CommandState | (Flag << 16)));
_worldPacket.WriteUInt8((byte)CommandState);
_worldPacket.WriteUInt8(Flag);
_worldPacket.WriteUInt8((byte)ReactState);
foreach (uint actionButton in ActionButtons)
@@ -362,7 +363,8 @@ namespace Game.Networking.Packets
public override void Write()
{
_worldPacket.WritePackedGuid(PetGUID);
_worldPacket.WriteUInt16((ushort)((int)CommandState | Flag << 8));
_worldPacket.WriteUInt8((byte)CommandState);
_worldPacket.WriteUInt8(Flag);
_worldPacket.WriteUInt8((byte)ReactState);
}
}
@@ -297,11 +297,11 @@ namespace Game.Networking.Packets
data.WriteInt32(StaticType);
data.WriteUInt32(Muid);
data.WriteBits(Title.GetByteCount(), 7);
data.WriteBits(Title.GetByteCount(), 8);
data.WriteBits(BodyText.GetByteCount(), 12);
for (byte i = 0; i < Choicetext.Length; i++)
data.WriteBits(Choicetext[i].GetByteCount(), 6);
data.WriteBits(Choicetext[i].GetByteCount(), 7);
data.FlushBits();
@@ -95,20 +95,20 @@ namespace Game.Networking.Packets
_worldPacket.WriteBit(SellAllJunkEnabled);
_worldPacket.WriteBit(GroupFinderEnabled);
_worldPacket.WriteBit(LfdEnabled);
_worldPacket.WriteBit(LfrEnabled);
_worldPacket.WriteBit(IsPremadeGroupEnabled);
_worldPacket.WriteBit(PremadeGroupsEnabled);
_worldPacket.WriteBit(UseActivePlayerDataQuestCompleted);
_worldPacket.WriteBit(false); // unused 10.2.7
_worldPacket.WriteBit(GuildEventsEditsEnabled);
_worldPacket.WriteBit(GuildTradeSkillsEnabled);
_worldPacket.WriteBits(Unknown1027.GetByteCount(), 7);
_worldPacket.WriteBit(BNSendWhisperUseV2Services);
_worldPacket.WriteBit(BNSendGameDataUseV2Services);
_worldPacket.WriteBit(IsAccountCurrencyTransferEnabled);
_worldPacket.WriteBit(false); // unused 11.0.7
_worldPacket.WriteBit(LobbyMatchmakerQueueFromMainlineEnabled);
_worldPacket.WriteBit(CanSendLobbyMatchmakerPartyCustomizations);
_worldPacket.FlushBits();
{
@@ -207,15 +207,15 @@ namespace Game.Networking.Packets
public bool IsPlayerContentTrackingEnabled;
public bool SellAllJunkEnabled;
public bool GroupFinderEnabled = true; // classic only
public bool LfdEnabled = true; // classic only
public bool LfrEnabled = true; // classic only
public bool IsPremadeGroupEnabled = true; // classic only
public bool PremadeGroupsEnabled = true;
public bool UseActivePlayerDataQuestCompleted = false; ///< Uses ActivePlayerData::QuestCompleted (legacy) to store completed quest bits instead of ActivePlayerData::BitVectors[9]
public bool GuildEventsEditsEnabled = true;
public bool GuildTradeSkillsEnabled = true;
public bool BNSendWhisperUseV2Services = true; ///< BNSendWhisper will send to v2.WhisperService instead of v1.NotificationService
public bool BNSendGameDataUseV2Services = true; ///< BNSendGameData will send to v2.NotificationService instead of v1.NotificationService
public bool IsAccountCurrencyTransferEnabled;
public bool LobbyMatchmakerQueueFromMainlineEnabled;
public bool CanSendLobbyMatchmakerPartyCustomizations;
public SocialQueueConfig QuickJoinConfig;
public SquelchInfo Squelch;
@@ -487,11 +487,13 @@ namespace Game.Networking.Packets
{
public int Rule;
public int Value;
public float ValueF;
public void Write(WorldPacket data)
{
data.WriteInt32(Rule);
data.WriteInt32(Value);
data.WriteFloat(ValueF);
}
}
@@ -54,9 +54,13 @@ namespace Game.Networking.Packets
_worldPacket.WriteBits(c.Url.GetByteCount(), 11);
_worldPacket.WriteBits(c.WaitTimeOverrideMessage.GetByteCount(), 10);
_worldPacket.WriteBits(c.Title, 24);
_worldPacket.WriteBits(c.Description, 24);
_worldPacket.WriteString(c.Url);
_worldPacket.WriteString(c.WaitTimeOverrideMessage);
_worldPacket.WriteString(c.Title);
_worldPacket.WriteString(c.Description);
}
}
@@ -72,6 +76,8 @@ namespace Game.Networking.Packets
public int WaitTimeOverrideMinutes;
public string Url;
public string WaitTimeOverrideMessage;
public string Title;
public string Description;
}
}
@@ -16,6 +16,9 @@ namespace Game.Networking.Packets
public uint ZoneID;
public uint WMOGroupID;
public uint WMODoodadPlacementID;
public float HealthPercent = 1.0f;
public ushort RecommendedGroupSizeMin;
public ushort RecommendedGroupSizeMax;
public void Write(WorldPacket data)
{
@@ -25,6 +28,9 @@ namespace Game.Networking.Packets
data.WriteUInt32(ZoneID);
data.WriteUInt32(WMOGroupID);
data.WriteUInt32(WMODoodadPlacementID);
data.WriteFloat(HealthPercent);
data.WriteUInt16(RecommendedGroupSizeMin);
data.WriteUInt16(RecommendedGroupSizeMax);
}
}