Fixed world login

This commit is contained in:
Hondacrx
2025-08-26 22:37:42 -04:00
parent 7bb4769eee
commit ec4f2a49d4
20 changed files with 80 additions and 74 deletions
@@ -23,7 +23,7 @@ namespace BNetServer
public void Initialize() public void Initialize()
{ {
certificate = new X509Certificate2(ConfigMgr.GetDefaultValue("CertificatesFile", "./BNetServer.pfx")); certificate = X509CertificateLoader.LoadPkcs12FromFile(ConfigMgr.GetDefaultValue("CertificatesFile", "./BNetServer.pfx"), null);
Assembly currentAsm = Assembly.GetExecutingAssembly(); Assembly currentAsm = Assembly.GetExecutingAssembly();
foreach (var type in currentAsm.GetTypes()) foreach (var type in currentAsm.GetTypes())
@@ -2137,8 +2137,8 @@ namespace Framework.Constants
// Opcodes That Are Not Generated Automatically // Opcodes That Are Not Generated Automatically
AccountHeirloomUpdate = AccountToyUpdate + 1, // No Client Handler AccountHeirloomUpdate = AccountToyUpdate + 1, // No Client Handler
CompressedPacket = 0x3E000A, CompressedPacket = AuthChallenge + 0xA,
MultiplePackets = 0x3E0009, MultiplePackets = AuthChallenge + 0x9,
Unknown = 0xbadd, Unknown = 0xbadd,
None = 0 None = 0
@@ -29,7 +29,7 @@ namespace Framework.Cryptography
{ {
for (uint i = 0; i < sz; ++i) for (uint i = 0; i < sz; ++i)
{ {
if (taken == 32) if (taken == 64)
FillUp(); FillUp();
buf[i] = o0[taken]; buf[i] = o0[taken];
@@ -40,9 +40,9 @@ namespace Framework.Cryptography
void FillUp() void FillUp()
{ {
sh.Initialize(); sh.Initialize();
sh.TransformBlock(o1, 0, 32, o1, 0); sh.TransformBlock(o1, 0, 64, o1, 0);
sh.TransformBlock(o0, 0, 32, o0, 0); sh.TransformBlock(o0, 0, 64, o0, 0);
sh.TransformFinalBlock(o2, 0, 32); sh.TransformFinalBlock(o2, 0, 64);
o0 = sh.Hash; o0 = sh.Hash;
taken = 0; taken = 0;
@@ -50,9 +50,9 @@ namespace Framework.Cryptography
SHA512 sh; SHA512 sh;
uint taken; uint taken;
byte[] o0 = new byte[32]; byte[] o0 = new byte[64];
byte[] o1 = new byte[32]; byte[] o1 = new byte[64];
byte[] o2 = new byte[32]; byte[] o2 = new byte[64];
} }
public class SessionKeyGenerator public class SessionKeyGenerator
+3 -3
View File
@@ -27,9 +27,9 @@ namespace Game.DataStorage
public uint OverridesSpellID; public uint OverridesSpellID;
public uint RequiredSpellID; public uint RequiredSpellID;
public int[] CategoryMask = new int[2]; public int[] CategoryMask = new int[2];
public uint[] SpellRank = new uint[2]; public uint[] SpellRank = new uint[9];
public uint[] PrereqTalent = new uint[2]; public uint[] PrereqTalent = new uint[3];
public byte[] PrereqRank = new byte[2]; public byte[] PrereqRank = new byte[3];
} }
public sealed class TaxiNodesRecord public sealed class TaxiNodesRecord
@@ -384,7 +384,7 @@ namespace Game.Entities
public abstract class HasChangesMask : IHasChangesMask public abstract class HasChangesMask : IHasChangesMask
{ {
public static int ChangeMaskLength; public int ChangeMaskLength;
public UpdateMask _changesMask; public UpdateMask _changesMask;
public int _blockBit; public int _blockBit;
@@ -164,7 +164,7 @@ namespace Game.Entities
dynFlags |= (uint)GameObjectDynamicLowFlags.NoInterract; dynFlags |= (uint)GameObjectDynamicLowFlags.NoInterract;
var data = Global.ObjectMgr.GetSpawnMetadata(SpawnObjectType.GameObject, gameObject.GetSpawnId()); var data = Global.ObjectMgr.GetSpawnMetadata(SpawnObjectType.GameObject, gameObject.GetSpawnId());
if (data.spawnTrackingData != null && !data.spawnTrackingQuestObjectives.Empty()) if (data != null && data.spawnTrackingData != null && !data.spawnTrackingQuestObjectives.Empty())
if (receiver.GetSpawnTrackingStateByObjectives(data.spawnTrackingData.SpawnTrackingId, data.spawnTrackingQuestObjectives) != SpawnTrackingState.Active) if (receiver.GetSpawnTrackingStateByObjectives(data.spawnTrackingData.SpawnTrackingId, data.spawnTrackingQuestObjectives) != SpawnTrackingState.Active)
dynFlags &= ~(uint)GameObjectDynamicLowFlags.Activate; dynFlags &= ~(uint)GameObjectDynamicLowFlags.Activate;
} }
@@ -3352,14 +3352,14 @@ namespace Game.Entities
public void FilterDisallowedFieldsMaskForFlag(UpdateMask changesMask, UpdateFieldFlag fieldVisibilityFlags) public void FilterDisallowedFieldsMaskForFlag(UpdateMask changesMask, UpdateFieldFlag fieldVisibilityFlags)
{ {
UpdateMask allowedMaskForTarget = new(324, [0xFFFFFFDDu, 0x0007FFFFu, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0xFFFFFFF8u, 0xFFFFFFFFu, 0xFFFFFFFFu, 0x0000000Fu]); UpdateMask allowedMaskForTarget = new(ChangeMaskLength, [0xFFFFFFDDu, 0x0007FFFFu, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0xFFFFFFF8u, 0xFFFFFFFFu, 0xFFFFFFFFu, 0x0000000Fu]);
PlayerDataAppendAllowedFieldsMaskForFlag(allowedMaskForTarget, fieldVisibilityFlags); PlayerDataAppendAllowedFieldsMaskForFlag(allowedMaskForTarget, fieldVisibilityFlags);
changesMask.AND(allowedMaskForTarget); changesMask.AND(allowedMaskForTarget);
} }
public void WriteUpdate(WorldPacket data, UpdateFieldFlag fieldVisibilityFlags, Player owner, Player receiver) public void WriteUpdate(WorldPacket data, UpdateFieldFlag fieldVisibilityFlags, Player owner, Player receiver)
{ {
UpdateMask allowedMaskForTarget = new(324, [0xFFFFFFDDu, 0x0007FFFFu, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0xFFFFFFF8u, 0xFFFFFFFFu, 0xFFFFFFFFu, 0x0000000Fu]); UpdateMask allowedMaskForTarget = new(ChangeMaskLength, [0xFFFFFFDDu, 0x0007FFFFu, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0xFFFFFFF8u, 0xFFFFFFFFu, 0xFFFFFFFFu, 0x0000000Fu]);
PlayerDataAppendAllowedFieldsMaskForFlag(allowedMaskForTarget, fieldVisibilityFlags); PlayerDataAppendAllowedFieldsMaskForFlag(allowedMaskForTarget, fieldVisibilityFlags);
WriteUpdate(data, _changesMask & allowedMaskForTarget, false, owner, receiver); WriteUpdate(data, _changesMask & allowedMaskForTarget, false, owner, receiver);
} }
@@ -24,12 +24,11 @@ namespace Game.Entities
if (input != null) if (input != null)
{ {
int block = 0; int block = 0;
for (; block < input.Length; ++block) for (; block < _blockCount; ++block)
if ((_blocks[block] = input[block]) != 0) if ((_blocks[block] = input[block]) != 0)
_blocksMask[GetBlockIndex(block)] |= (uint)GetBlockFlag(block); _blocksMask[GetBlockIndex(block)] |= (uint)GetBlockFlag(block);
else
for (; block < _blockCount; ++block) _blocksMask[GetBlockIndex(block)] &= ~(uint)GetBlockFlag(block);
_blocks[block] = 0;
} }
} }
@@ -100,7 +99,7 @@ namespace Game.Entities
for (int i = 0; i < _blockCount; ++i) for (int i = 0; i < _blockCount; ++i)
{ {
if (!Convert.ToBoolean(_blocks[i] &= right._blocks[i])) if ((_blocks[i] &= right._blocks[i]) == 0)
_blocksMask[GetBlockIndex(i)] &= ~(uint)GetBlockFlag(i); _blocksMask[GetBlockIndex(i)] &= ~(uint)GetBlockFlag(i);
} }
} }
@@ -4153,6 +4153,9 @@ namespace Game.Entities
public void ClearChangesMask(HasChangesMask updateData) public void ClearChangesMask(HasChangesMask updateData)
{ {
if (updateData == null)
return;
_owner.m_entityFragments.ContentsChangedMask &= (byte)~_owner.m_entityFragments.GetUpdateMaskFor((EntityFragment)updateData._blockBit); _owner.m_entityFragments.ContentsChangedMask &= (byte)~_owner.m_entityFragments.GetUpdateMaskFor((EntityFragment)updateData._blockBit);
if ((EntityFragment)updateData._blockBit == EntityFragment.CGObject) if ((EntityFragment)updateData._blockBit == EntityFragment.CGObject)
{ {
+1 -1
View File
@@ -1645,7 +1645,7 @@ namespace Game.Entities
if (aura.GetCasterGUID() == GetGUID() && aura.GetSpellInfo().HasAttribute(SpellAttr8.MasteryAffectsPoints)) if (aura.GetCasterGUID() == GetGUID() && aura.GetSpellInfo().HasAttribute(SpellAttr8.MasteryAffectsPoints))
{ {
foreach (var auraEff in aura.GetAuraEffects()) foreach (var auraEff in aura.GetAuraEffects())
if (MathFunctions.fuzzyEq(auraEff.GetSpellEffectInfo().BonusCoefficient, 0.0f)) if (auraEff != null && MathFunctions.fuzzyEq(auraEff.GetSpellEffectInfo().BonusCoefficient, 0.0f))
auraEff.RecalculateAmount(this); auraEff.RecalculateAmount(this);
} }
} }
+6 -3
View File
@@ -3204,6 +3204,9 @@ namespace Game.Entities
Unit caster = aura.GetCaster(); Unit caster = aura.GetCaster();
foreach (AuraEffect aurEff in aura.GetAuraEffects()) foreach (AuraEffect aurEff in aura.GetAuraEffects())
{ {
if (aurEff == null)
continue;
int i = (int)aurEff.GetEffIndex(); int i = (int)aurEff.GetEffIndex();
baseDamage[i] = aurEff.GetBaseAmount(); baseDamage[i] = aurEff.GetBaseAmount();
damage[i] = aurEff.GetAmount(); damage[i] = aurEff.GetAmount();
@@ -3475,7 +3478,7 @@ namespace Game.Entities
// remove remaining effects of an aura // remove remaining effects of an aura
foreach (AuraEffect aurEff in aurApp.GetBase().GetAuraEffects()) foreach (AuraEffect aurEff in aurApp.GetBase().GetAuraEffects())
{ {
if (aurApp.HasEffect(aurEff.GetEffIndex())) if (aurEff != null && aurApp.HasEffect(aurEff.GetEffIndex()))
aurApp._HandleEffect(aurEff.GetEffIndex(), false); aurApp._HandleEffect(aurEff.GetEffIndex(), false);
} }
return; return;
@@ -3899,7 +3902,7 @@ namespace Game.Entities
// remove effects of the spell - needs to be done after removing aura from lists // remove effects of the spell - needs to be done after removing aura from lists
foreach (AuraEffect aurEff in aura.GetAuraEffects()) foreach (AuraEffect aurEff in aura.GetAuraEffects())
if (aurApp.HasEffect(aurEff.GetEffIndex())) if (aurEff != null && aurApp.HasEffect(aurEff.GetEffIndex()))
aurApp._HandleEffect(aurEff.GetEffIndex(), false); aurApp._HandleEffect(aurEff.GetEffIndex(), false);
// all effect mustn't be applied // all effect mustn't be applied
@@ -4147,7 +4150,7 @@ namespace Game.Entities
// apply effects of the aura // apply effects of the aura
foreach (AuraEffect aurEff in aura.GetAuraEffects()) foreach (AuraEffect aurEff in aura.GetAuraEffects())
{ {
if ((effMask & 1 << (int)aurEff.GetEffIndex()) != 0) if (aurEff != null && (effMask & 1 << (int)aurEff.GetEffIndex()) != 0)
{ {
aurApp._HandleEffect(aurEff.GetEffIndex(), true); aurApp._HandleEffect(aurEff.GetEffIndex(), true);
if (aurApp.GetRemoveMode() != 0) if (aurApp.GetRemoveMode() != 0)
+1 -1
View File
@@ -1747,7 +1747,7 @@ namespace Game
} }
public uint GetScriptId(string name, bool isDatabaseBound = true) public uint GetScriptId(string name, bool isDatabaseBound = true)
{ {
return _scriptNamesStorage.Insert(name, isDatabaseBound); return _scriptNamesStorage.Insert(name ?? "", isDatabaseBound);
} }
public uint GetAreaTriggerScriptId(uint triggerid) public uint GetAreaTriggerScriptId(uint triggerid)
{ {
+28 -28
View File
@@ -222,7 +222,7 @@ namespace Game.Networking
public bool IsValidOpcode() public bool IsValidOpcode()
{ {
int opcodeArrayIndex = GetOpcodeArrayIndex(opcode); int opcodeArrayIndex = GetOpcodeArrayIndex(opcode);
return opcodeArrayIndex >= 0 && opcodeArrayIndex < 1699; return opcodeArrayIndex >= 0 && opcodeArrayIndex < 1735;
} }
int GetOpcodeArrayIndex(uint opcode) int GetOpcodeArrayIndex(uint opcode)
@@ -230,33 +230,33 @@ namespace Game.Networking
int idInGroup = (int)(opcode & 0xFFFF); int idInGroup = (int)(opcode & 0xFFFF);
switch (opcode >> 16) switch (opcode >> 16)
{ {
case 0x2A: return idInGroup < 26 ? idInGroup + 0 : -1; case 0x29: return idInGroup < 31 ? idInGroup + 0 : -1;
case 0x2C: return idInGroup < 47 ? idInGroup + 26 : -1; case 0x2B: return idInGroup < 51 ? idInGroup + 31 : -1;
case 0x2D: return idInGroup < 3 ? idInGroup + 73 : -1; case 0x2C: return idInGroup < 3 ? idInGroup + 82 : -1;
case 0x2E: return idInGroup < 33 ? idInGroup + 76 : -1; case 0x2D: return idInGroup < 37 ? idInGroup + 85 : -1;
case 0x30: return idInGroup < 739 ? idInGroup + 109 : -1; case 0x2F: return idInGroup < 751 ? idInGroup + 122 : -1;
case 0x31: return idInGroup < 298 ? idInGroup + 848 : -1; case 0x30: return idInGroup < 301 ? idInGroup + 873 : -1;
case 0x32: return idInGroup < 12 ? idInGroup + 1146 : -1; case 0x31: return idInGroup < 10 ? idInGroup + 1174 : -1;
case 0x33: return idInGroup < 130 ? idInGroup + 1158 : -1; case 0x32: return idInGroup < 132 ? idInGroup + 1184 : -1;
case 0x35: return idInGroup < 396 ? idInGroup + 1288 : -1; case 0x34: return idInGroup < 404 ? idInGroup + 1316 : -1;
case 0x36: return idInGroup < 15 ? idInGroup + 1684 : -1; case 0x35: return idInGroup < 15 ? idInGroup + 1720 : -1;
case 0x37: return idInGroup < 831 ? idInGroup + 0 : -1; case 0x36: return idInGroup < 857 ? idInGroup + 0 : -1;
case 0x38: return idInGroup < 10 ? idInGroup + 831 : -1; case 0x37: return idInGroup < 5 ? idInGroup + 857 : -1;
case 0x3B: return idInGroup < 18 ? idInGroup + 841 : -1; case 0x3A: return idInGroup < 18 ? idInGroup + 862 : -1;
case 0x3C: return idInGroup < 33 ? idInGroup + 859 : -1; case 0x3B: return idInGroup < 36 ? idInGroup + 880 : -1;
case 0x3D: return idInGroup < 49 ? idInGroup + 892 : -1; case 0x3C: return idInGroup < 49 ? idInGroup + 916 : -1;
case 0x3E: return idInGroup < 11 ? idInGroup + 941 : -1; case 0x3D: return idInGroup < 11 ? idInGroup + 965 : -1;
case 0x3F: return idInGroup < 12 ? idInGroup + 952 : -1; case 0x3E: return idInGroup < 12 ? idInGroup + 976 : -1;
case 0x41: return idInGroup < 82 ? idInGroup + 964 : -1; case 0x40: return idInGroup < 82 ? idInGroup + 988 : -1;
case 0x43: return idInGroup < 67 ? idInGroup + 1046 : -1; case 0x42: return idInGroup < 71 ? idInGroup + 1070 : -1;
case 0x45: return idInGroup < 32 ? idInGroup + 1113 : -1; case 0x44: return idInGroup < 33 ? idInGroup + 1141 : -1;
case 0x47: return idInGroup < 1 ? idInGroup + 1145 : -1; case 0x46: return idInGroup < 1 ? idInGroup + 1174 : -1;
case 0x48: return idInGroup < 118 ? idInGroup + 1146 : -1; case 0x48: return idInGroup < 120 ? idInGroup + 1175 : -1;
case 0x4A: return idInGroup < 46 ? idInGroup + 1264 : -1; case 0x4A: return idInGroup < 49 ? idInGroup + 1295 : -1;
case 0x4B: return idInGroup < 41 ? idInGroup + 1310 : -1; case 0x4B: return idInGroup < 41 ? idInGroup + 1344 : -1;
case 0x4D: return idInGroup < 85 ? idInGroup + 1351 : -1; case 0x4D: return idInGroup < 85 ? idInGroup + 1385 : -1;
case 0x4E: return idInGroup < 8 ? idInGroup + 1436 : -1; case 0x4E: return idInGroup < 8 ? idInGroup + 1470 : -1;
case 0x50: return idInGroup < 1 ? idInGroup + 1444 : -1; case 0x50: return idInGroup < 1 ? idInGroup + 1478 : -1;
default: return -1; default: return -1;
} }
} }
@@ -133,7 +133,7 @@ namespace Game.Networking.Packets
_worldPacket.WriteBit(SuccessInfo.NumPlayersHorde.HasValue); _worldPacket.WriteBit(SuccessInfo.NumPlayersHorde.HasValue);
_worldPacket.WriteBit(SuccessInfo.NumPlayersAlliance.HasValue); _worldPacket.WriteBit(SuccessInfo.NumPlayersAlliance.HasValue);
_worldPacket.WriteBit(SuccessInfo.ExpansionTrialExpiration.HasValue); _worldPacket.WriteBit(SuccessInfo.ExpansionTrialExpiration.HasValue);
_worldPacket.WriteBit(SuccessInfo.NewBuildKeys != null); _worldPacket.WriteBit(SuccessInfo.CurrentBuild != null);
_worldPacket.FlushBits(); _worldPacket.FlushBits();
{ {
@@ -155,12 +155,12 @@ namespace Game.Networking.Packets
if (SuccessInfo.ExpansionTrialExpiration.HasValue) if (SuccessInfo.ExpansionTrialExpiration.HasValue)
_worldPacket.WriteInt64(SuccessInfo.ExpansionTrialExpiration.Value); _worldPacket.WriteInt64(SuccessInfo.ExpansionTrialExpiration.Value);
if (SuccessInfo.NewBuildKeys != null) if (SuccessInfo.CurrentBuild != null)
{ {
for (int i = 0; i < 16; ++i) for (int i = 0; i < 16; ++i)
{ {
_worldPacket.WriteUInt8(SuccessInfo.NewBuildKeys.NewBuildKey[i]); _worldPacket.WriteUInt8(SuccessInfo.CurrentBuild.BuildKey[i]);
_worldPacket.WriteUInt8(SuccessInfo.NewBuildKeys.SomeKey[i]); _worldPacket.WriteUInt8(SuccessInfo.CurrentBuild.ConfigKey[i]);
} }
} }
@@ -217,7 +217,7 @@ namespace Game.Networking.Packets
public ushort? NumPlayersHorde; // number of horde players in this realm. @todo implement public ushort? NumPlayersHorde; // number of horde players in this realm. @todo implement
public ushort? NumPlayersAlliance; // number of alliance players in this realm. @todo implement public ushort? NumPlayersAlliance; // number of alliance players in this realm. @todo implement
public long? ExpansionTrialExpiration; // expansion trial expiration unix timestamp public long? ExpansionTrialExpiration; // expansion trial expiration unix timestamp
public NewBuild NewBuildKeys; public BaseBuildKey CurrentBuild;
public struct GameTime public struct GameTime
{ {
@@ -229,10 +229,10 @@ namespace Game.Networking.Packets
public bool IsCAISEnabled; public bool IsCAISEnabled;
} }
public class NewBuild public class BaseBuildKey
{ {
public Array<byte> NewBuildKey = new Array<byte>(16); public Array<byte> BuildKey = new Array<byte>(16);
public Array<byte> SomeKey = new Array<byte>(16); public Array<byte> ConfigKey = new Array<byte>(16);
} }
} }
} }
@@ -337,7 +337,7 @@ namespace Game.Networking.Packets
{ {
DosResponse = _worldPacket.ReadUInt64(); DosResponse = _worldPacket.ReadUInt64();
Key = _worldPacket.ReadUInt64(); Key = _worldPacket.ReadUInt64();
LocalChallenge = _worldPacket.ReadBytes(16); LocalChallenge = _worldPacket.ReadBytes(32);
Digest = _worldPacket.ReadBytes(24); Digest = _worldPacket.ReadBytes(24);
} }
@@ -402,7 +402,7 @@ namespace Game.Networking.Packets
{ {
HmacSha512 toSign = new(EncryptionKey); HmacSha512 toSign = new(EncryptionKey);
toSign.Process(BitConverter.GetBytes(Enabled), 1); toSign.Process(BitConverter.GetBytes(Enabled), 1);
toSign.Finish(EnableEncryptionSeed, 16); toSign.Finish(EnableEncryptionSeed, 32);
_worldPacket.WriteInt32(RegionGroup); _worldPacket.WriteInt32(RegionGroup);
_worldPacket.WriteBytes(Ed25519.Sign(toSign.Digest, expandedPrivateKey, 0, EnableEncryptionContext)); _worldPacket.WriteBytes(Ed25519.Sign(toSign.Digest, expandedPrivateKey, 0, EnableEncryptionContext));
@@ -84,7 +84,7 @@ namespace Game.Networking.Packets
_worldPacket.WriteCString(Stats.NameAlt[i]); _worldPacket.WriteCString(Stats.NameAlt[i]);
} }
for (var i = 0; i < 2; ++i) for (var i = 0; i < Stats.Flags.Length; ++i)
_worldPacket.WriteUInt32(Stats.Flags[i]); _worldPacket.WriteUInt32(Stats.Flags[i]);
_worldPacket.WriteInt8(Stats.CreatureType); _worldPacket.WriteInt8(Stats.CreatureType);
@@ -347,13 +347,13 @@ namespace Game.Networking.Packets
Visual.Write(_worldPacket); Visual.Write(_worldPacket);
_worldPacket.WriteUInt16(Reason); _worldPacket.WriteUInt8(Reason);
} }
public ObjectGuid CasterUnit; public ObjectGuid CasterUnit;
public uint SpellID; public uint SpellID;
public SpellCastVisual Visual; public SpellCastVisual Visual;
public ushort Reason; public byte Reason;
public ObjectGuid CastID; public ObjectGuid CastID;
} }
@@ -332,6 +332,7 @@ namespace Game.Networking.Packets
_worldPacket.WriteBit(PlayerIdentityOptionsEnabled); _worldPacket.WriteBit(PlayerIdentityOptionsEnabled);
_worldPacket.WriteBit(AccountExportEnabled); _worldPacket.WriteBit(AccountExportEnabled);
_worldPacket.WriteBit(AccountLockedPostExport); _worldPacket.WriteBit(AccountLockedPostExport);
_worldPacket.WriteBits(RealmHiddenAlert.GetByteCount() + 1, 11); _worldPacket.WriteBits(RealmHiddenAlert.GetByteCount() + 1, 11);
_worldPacket.WriteBit(BNSendWhisperUseV2Services); _worldPacket.WriteBit(BNSendWhisperUseV2Services);
@@ -372,7 +373,7 @@ namespace Game.Networking.Packets
_worldPacket.WriteInt32(LaunchDurationETA.Value); _worldPacket.WriteInt32(LaunchDurationETA.Value);
if (!RealmHiddenAlert.IsEmpty()) if (!RealmHiddenAlert.IsEmpty())
_worldPacket.WriteString(RealmHiddenAlert); _worldPacket.WriteCString(RealmHiddenAlert);
foreach (var sourceRegion in LiveRegionCharacterCopySourceRegions) foreach (var sourceRegion in LiveRegionCharacterCopySourceRegions)
_worldPacket.WriteInt32(sourceRegion); _worldPacket.WriteInt32(sourceRegion);
+1 -1
View File
@@ -536,7 +536,7 @@ namespace Game.Networking
sessionKeyHmac.Finish(SessionKeySeed, SessionKeySeed.Length); sessionKeyHmac.Finish(SessionKeySeed, SessionKeySeed.Length);
_sessionKey = new byte[40]; _sessionKey = new byte[40];
var sessionKeyGenerator = new SessionKeyGenerator512(sessionKeyHmac.Digest, 32); var sessionKeyGenerator = new SessionKeyGenerator512(sessionKeyHmac.Digest);
sessionKeyGenerator.Generate(_sessionKey, 40); sessionKeyGenerator.Generate(_sessionKey, 40);
HmacSha512 encryptKeyGen = new(_sessionKey); HmacSha512 encryptKeyGen = new(_sessionKey);
+1 -1
View File
@@ -410,7 +410,7 @@ namespace Game
if (!packet.IsValidOpcode()) if (!packet.IsValidOpcode())
{ {
string specialName = packet.GetOpcode() == ServerOpcodes.Unknown ? "UNKNOWN_OPCODE" : "INVALID_OPCODE"; string specialName = packet.GetOpcode() == ServerOpcodes.Unknown ? "UNKNOWN_OPCODE" : "INVALID_OPCODE";
Log.outError(LogFilter.Network, $"Prevented sending of {specialName} (0x{packet.GetOpcode():04X}) to {GetPlayerInfo()}"); Log.outError(LogFilter.Network, $"Prevented sending of {specialName} (0x{(int)packet.GetOpcode():04X}) to {GetPlayerInfo()}");
return; return;
} }
+2 -2
View File
@@ -863,7 +863,7 @@ namespace Game.Spells
Unit caster = GetCaster(); Unit caster = GetCaster();
foreach (AuraEffect aurEff in GetAuraEffects()) foreach (AuraEffect aurEff in GetAuraEffects())
aurEff.CalculatePeriodic(caster, resetPeriodicTimer, false); aurEff?.CalculatePeriodic(caster, resetPeriodicTimer, false);
} }
public void SetCharges(int charges) public void SetCharges(int charges)
@@ -1806,7 +1806,7 @@ namespace Game.Spells
// At least one effect has to pass checks to proc aura // At least one effect has to pass checks to proc aura
uint procEffectMask = aurApp.GetEffectMask(); uint procEffectMask = aurApp.GetEffectMask();
foreach (AuraEffect aurEff in GetAuraEffects()) foreach (AuraEffect aurEff in GetAuraEffects())
if ((procEffectMask & (1u << (int)aurEff.GetEffIndex())) != 0) if (aurEff != null && (procEffectMask & (1u << (int)aurEff.GetEffIndex())) != 0)
if ((procEntry.DisableEffectsMask & (1u << (int)aurEff.GetEffIndex())) != 0 || !GetEffect(aurEff.GetEffIndex()).CheckEffectProc(aurApp, eventInfo)) if ((procEntry.DisableEffectsMask & (1u << (int)aurEff.GetEffIndex())) != 0 || !GetEffect(aurEff.GetEffIndex()).CheckEffectProc(aurApp, eventInfo))
procEffectMask &= ~(1u << (int)aurEff.GetEffIndex()); procEffectMask &= ~(1u << (int)aurEff.GetEffIndex());
+1 -1
View File
@@ -505,7 +505,7 @@ namespace Game.Spells
else else
{ {
foreach (AuraEffect aurEff in aura.GetAuraEffects()) foreach (AuraEffect aurEff in aura.GetAuraEffects())
if (aurEff != triggeredBy) if (aurEff != null && aurEff != triggeredBy)
aurEff.RecalculateAmount(triggeredBy); aurEff.RecalculateAmount(triggeredBy);
} }
} }