Core: Updated to 10.0.2

Port From (https://github.com/TrinityCore/TrinityCore/commit/e98e1283ea0034baf6be9aa2ffb386eb5582801b)
This commit is contained in:
hondacrx
2022-12-28 15:25:15 -05:00
parent 2dc12dbb69
commit 989b80b056
100 changed files with 6591 additions and 4112 deletions
@@ -44,12 +44,14 @@ namespace Game.Networking.Packets
_worldPacket.WriteBit(IsNewPlayerRestrictionSkipped);
_worldPacket.WriteBit(IsNewPlayerRestricted);
_worldPacket.WriteBit(IsNewPlayer);
_worldPacket.WriteBit(IsTrialAccountRestricted);
_worldPacket.WriteBit(DisabledClassesMask.HasValue);
_worldPacket.WriteBit(IsAlliedRacesCreationAllowed);
_worldPacket.WriteInt32(Characters.Count);
_worldPacket.WriteInt32(MaxCharacterLevel);
_worldPacket.WriteInt32(RaceUnlockData.Count);
_worldPacket.WriteInt32(UnlockedConditionalAppearances.Count);
_worldPacket.WriteInt32(RaceLimitDisables.Count);
if (DisabledClassesMask.HasValue)
_worldPacket.WriteUInt32(DisabledClassesMask.Value);
@@ -57,6 +59,9 @@ namespace Game.Networking.Packets
foreach (UnlockedConditionalAppearance unlockedConditionalAppearance in UnlockedConditionalAppearances)
unlockedConditionalAppearance.Write(_worldPacket);
foreach (RaceLimitDisableInfo raceLimitDisableInfo in RaceLimitDisables)
raceLimitDisableInfo.Write(_worldPacket);
foreach (CharacterInfo charInfo in Characters)
charInfo.Write(_worldPacket);
@@ -69,6 +74,7 @@ namespace Game.Networking.Packets
public bool IsNewPlayerRestrictionSkipped; // allows client to skip new player restrictions
public bool IsNewPlayerRestricted; // forbids using level boost and class trials
public bool IsNewPlayer; // forbids hero classes and allied races
public bool IsTrialAccountRestricted;
public bool IsAlliedRacesCreationAllowed;
public int MaxCharacterLevel = 1;
@@ -77,6 +83,7 @@ namespace Game.Networking.Packets
public List<CharacterInfo> Characters = new(); // all characters on the list
public List<RaceUnlock> RaceUnlockData = new(); //
public List<UnlockedConditionalAppearance> UnlockedConditionalAppearances = new();
public List<RaceLimitDisableInfo> RaceLimitDisables = new();
public class CharacterInfo
{
@@ -147,11 +154,11 @@ namespace Game.Networking.Packets
var spec = Global.DB2Mgr.GetChrSpecializationByIndex(ClassId, fields.Read<byte>(21));
if (spec != null)
SpecID = (ushort)spec.Id;
SpecID = (short)spec.Id;
LastLoginVersion = fields.Read<uint>(22);
LastLoginVersion = fields.Read<int>(22);
for (byte slot = 0; slot < InventorySlots.BagEnd; ++slot)
for (byte slot = 0; slot < InventorySlots.ReagentBagEnd; ++slot)
{
VisualItems[slot].InvType = (byte)equipment.NextUInt32();
VisualItems[slot].DisplayId = equipment.NextUInt32();
@@ -190,9 +197,9 @@ namespace Game.Networking.Packets
visualItem.Write(data);
data.WriteInt64(LastPlayedTime);
data.WriteUInt16(SpecID);
data.WriteUInt32(Unknown703);
data.WriteUInt32(LastLoginVersion);
data.WriteInt16(SpecID);
data.WriteInt32(Unknown703);
data.WriteInt32(LastLoginVersion);
data.WriteUInt32(Flags4);
data.WriteInt32(MailSenders.Count);
data.WriteInt32(MailSenderTypes.Count);
@@ -244,16 +251,16 @@ namespace Game.Networking.Packets
public bool FirstLogin;
public byte unkWod61x;
public long LastPlayedTime;
public ushort SpecID;
public uint Unknown703;
public uint LastLoginVersion;
public short SpecID;
public int Unknown703;
public int LastLoginVersion;
public uint OverrideSelectScreenFileDataID;
public uint PetCreatureDisplayId;
public uint PetExperienceLevel;
public uint PetCreatureFamilyId;
public bool BoostInProgress; // @todo
public uint[] ProfessionIds = new uint[2]; // @todo
public VisualItemInfo[] VisualItems = new VisualItemInfo[InventorySlots.BagEnd];
public VisualItemInfo[] VisualItems = new VisualItemInfo[InventorySlots.ReagentBagEnd];
public List<string> MailSenders = new();
public List<uint> MailSenderTypes = new();
@@ -311,6 +318,24 @@ namespace Game.Networking.Packets
public int AchievementID;
public int Unused;
}
public struct RaceLimitDisableInfo
{
enum blah
{
Server,
Level
}
public int RaceID;
public int BlockReason;
public void Write(WorldPacket data)
{
data.WriteInt32(RaceID);
data.WriteInt32(BlockReason);
}
}
}
class CheckCharacterNameAvailability : ClientPacket
@@ -500,6 +525,7 @@ namespace Game.Networking.Packets
RaceOrFactionChangeInfo.Guid = _worldPacket.ReadPackedGuid();
RaceOrFactionChangeInfo.SexID = (Gender)_worldPacket.ReadUInt8();
RaceOrFactionChangeInfo.RaceID = (Race)_worldPacket.ReadUInt8();
RaceOrFactionChangeInfo.InitialRaceID = (Race)_worldPacket.ReadUInt8();
var customizationCount = _worldPacket.ReadUInt32();
RaceOrFactionChangeInfo.Name = _worldPacket.ReadString(nameLength);
@@ -851,6 +877,7 @@ namespace Game.Networking.Packets
{
var customizationCount = _worldPacket.ReadUInt32();
NewSex = _worldPacket.ReadUInt8();
CustomizedRace = _worldPacket.ReadInt32();
for (var i = 0; i < customizationCount; ++i)
{
@@ -866,6 +893,7 @@ namespace Game.Networking.Packets
public byte NewSex;
public Array<ChrCustomizationChoice> Customizations = new(50);
public int CustomizedRace;
}
public class BarberShopResult : ServerPacket
@@ -902,7 +930,6 @@ namespace Game.Networking.Packets
_worldPacket.WriteUInt8((byte)Reason);
_worldPacket.WriteInt32(Amount);
_worldPacket.WriteFloat(GroupBonus);
_worldPacket.WriteUInt8(ReferAFriendBonusType);
}
public ObjectGuid Victim;
@@ -910,7 +937,6 @@ namespace Game.Networking.Packets
public PlayerLogXPReason Reason;
public int Amount;
public float GroupBonus;
public byte ReferAFriendBonusType; // 1 - 300% of normal XP; 2 - 150% of normal XP
}
class TitleEarned : ServerPacket
@@ -1105,6 +1131,7 @@ namespace Game.Networking.Packets
public class CharRaceOrFactionChangeInfo
{
public Race RaceID = Race.None;
public Race InitialRaceID = Race.None;
public Gender SexID = Gender.None;
public ObjectGuid Guid;
public bool FactionChange;