Core/PacketIO: Use original names in SMSG_INSPECT_RESULT structure
Port From (https://github.com/TrinityCore/TrinityCore/commit/ebd4559ebc216fa5982b2e3033602f298ecef688)
This commit is contained in:
@@ -43,11 +43,11 @@ namespace Game
|
|||||||
for (int i = 0; i < pvpTalents.Length; ++i)
|
for (int i = 0; i < pvpTalents.Length; ++i)
|
||||||
inspectResult.PvpTalents[i] = (ushort)pvpTalents[i];
|
inspectResult.PvpTalents[i] = (ushort)pvpTalents[i];
|
||||||
|
|
||||||
inspectResult.TalentTraits.Level = (int)player.GetLevel();
|
inspectResult.TraitsInfo.PlayerLevel = (int)player.GetLevel();
|
||||||
inspectResult.TalentTraits.ChrSpecializationID = (int)player.GetPrimarySpecialization();
|
inspectResult.TraitsInfo.SpecID = (int)player.GetPrimarySpecialization();
|
||||||
TraitConfig traitConfig = player.GetTraitConfig((int)(uint)player.m_activePlayerData.ActiveCombatTraitConfigID);
|
TraitConfig traitConfig = player.GetTraitConfig((int)(uint)player.m_activePlayerData.ActiveCombatTraitConfigID);
|
||||||
if (traitConfig != null)
|
if (traitConfig != null)
|
||||||
inspectResult.TalentTraits.Config = new TraitConfigPacket(traitConfig);
|
inspectResult.TraitsInfo.ActiveCombatTraits = new TraitConfigPacket(traitConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
Guild guild = Global.GuildMgr.GetGuildById(player.GetGuildId());
|
Guild guild = Global.GuildMgr.GetGuildById(player.GetGuildId());
|
||||||
|
|||||||
@@ -847,73 +847,24 @@ namespace Game.Maps
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class WorldObjectChangeAccumulator : Notifier
|
public class WorldObjectChangeAccumulator : IDoWork<Player>
|
||||||
{
|
{
|
||||||
|
Dictionary<Player, UpdateData> updateData;
|
||||||
|
WorldObject worldObject;
|
||||||
|
HashSet<ObjectGuid> plr_list = new();
|
||||||
|
|
||||||
public WorldObjectChangeAccumulator(WorldObject obj, Dictionary<Player, UpdateData> d)
|
public WorldObjectChangeAccumulator(WorldObject obj, Dictionary<Player, UpdateData> d)
|
||||||
{
|
{
|
||||||
updateData = d;
|
updateData = d;
|
||||||
worldObject = obj;
|
worldObject = obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Visit(IList<Player> objs)
|
public void Invoke(Player player)
|
||||||
{
|
|
||||||
for (var i = 0; i < objs.Count; ++i)
|
|
||||||
{
|
|
||||||
Player player = objs[i];
|
|
||||||
BuildPacket(player);
|
|
||||||
|
|
||||||
if (!player.GetSharedVisionList().Empty())
|
|
||||||
{
|
|
||||||
foreach (var visionPlayer in player.GetSharedVisionList())
|
|
||||||
BuildPacket(visionPlayer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Visit(IList<Creature> objs)
|
|
||||||
{
|
|
||||||
for (var i = 0; i < objs.Count; ++i)
|
|
||||||
{
|
|
||||||
Creature creature = objs[i];
|
|
||||||
if (!creature.GetSharedVisionList().Empty())
|
|
||||||
{
|
|
||||||
foreach (var visionPlayer in creature.GetSharedVisionList())
|
|
||||||
BuildPacket(visionPlayer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Visit(IList<DynamicObject> objs)
|
|
||||||
{
|
|
||||||
for (var i = 0; i < objs.Count; ++i)
|
|
||||||
{
|
|
||||||
DynamicObject dynamicObject = objs[i];
|
|
||||||
|
|
||||||
ObjectGuid guid = dynamicObject.GetCasterGUID();
|
|
||||||
if (guid.IsPlayer())
|
|
||||||
{
|
|
||||||
//Caster may be NULL if DynObj is in removelist
|
|
||||||
Player caster = Global.ObjAccessor.FindPlayer(guid);
|
|
||||||
if (caster != null)
|
|
||||||
if (caster.m_activePlayerData.FarsightObject == dynamicObject.GetGUID())
|
|
||||||
BuildPacket(caster);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void BuildPacket(Player player)
|
|
||||||
{
|
{
|
||||||
// Only send update once to a player
|
// Only send update once to a player
|
||||||
if (!plr_list.Contains(player.GetGUID()) && player.HaveAtClient(worldObject))
|
if (player.HaveAtClient(worldObject) && plr_list.Add(player.GetGUID()))
|
||||||
{
|
|
||||||
worldObject.BuildFieldsUpdate(player, updateData);
|
worldObject.BuildFieldsUpdate(player, updateData);
|
||||||
plr_list.Add(player.GetGUID());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Dictionary<Player, UpdateData> updateData;
|
|
||||||
WorldObject worldObject;
|
|
||||||
List<ObjectGuid> plr_list = new();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class PlayerDistWorker : Notifier
|
public class PlayerDistWorker : Notifier
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ namespace Game.Networking.Packets
|
|||||||
if (AzeriteLevel.HasValue)
|
if (AzeriteLevel.HasValue)
|
||||||
_worldPacket.WriteUInt32(AzeriteLevel.Value);
|
_worldPacket.WriteUInt32(AzeriteLevel.Value);
|
||||||
|
|
||||||
TalentTraits.Write(_worldPacket);
|
TraitsInfo.Write(_worldPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PlayerModelDisplayInfo DisplayInfo;
|
public PlayerModelDisplayInfo DisplayInfo;
|
||||||
@@ -79,7 +79,7 @@ namespace Game.Networking.Packets
|
|||||||
public ushort TodayHK;
|
public ushort TodayHK;
|
||||||
public ushort YesterdayHK;
|
public ushort YesterdayHK;
|
||||||
public byte LifetimeMaxRank;
|
public byte LifetimeMaxRank;
|
||||||
public TraitInspectInfo TalentTraits = new();
|
public TraitInspectInfo TraitsInfo = new();
|
||||||
}
|
}
|
||||||
|
|
||||||
public class QueryInspectAchievements : ClientPacket
|
public class QueryInspectAchievements : ClientPacket
|
||||||
@@ -323,15 +323,15 @@ namespace Game.Networking.Packets
|
|||||||
|
|
||||||
public class TraitInspectInfo
|
public class TraitInspectInfo
|
||||||
{
|
{
|
||||||
public int Level;
|
public int PlayerLevel;
|
||||||
public int ChrSpecializationID;
|
public int SpecID;
|
||||||
public TraitConfigPacket Config = new();
|
public TraitConfigPacket ActiveCombatTraits = new();
|
||||||
|
|
||||||
public void Write(WorldPacket data)
|
public void Write(WorldPacket data)
|
||||||
{
|
{
|
||||||
data.WriteInt32(Level);
|
data.WriteInt32(PlayerLevel);
|
||||||
data.WriteInt32(ChrSpecializationID);
|
data.WriteInt32(SpecID);
|
||||||
Config.Write(data);
|
ActiveCombatTraits.Write(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user