diff --git a/Scripts/Mobiles/AI/BaseAI.cs b/Scripts/Mobiles/AI/BaseAI.cs index 0c668ac3c..a917b1a82 100644 --- a/Scripts/Mobiles/AI/BaseAI.cs +++ b/Scripts/Mobiles/AI/BaseAI.cs @@ -2494,7 +2494,6 @@ namespace Server.Mobiles IPooledEnumerable eable = map.GetMobilesInRange(m_Mobile.Location, iRange); -#if !Framework_4_0 foreach (Mobile m in eable) { if (m.Deleted || m.Blessed) @@ -2587,105 +2586,6 @@ namespace Server.Mobiles val = theirVal; } } -#endif - -#if Framework_4_0 - object valLock = new object(); - - Parallel.ForEach(eable, m => { - if (m.Deleted || m.Blessed) - return; - - // Let's not target ourselves... - if (m == m_Mobile || m is BaseFamiliar) - return; - - // Dead targets are invalid. - if (!m.Alive || m.IsDeadBondedPet) - return; - - // Staff members cannot be targeted. - if (m.AccessLevel > AccessLevel.Player) - return; - - // Does it have to be a player? - if (bPlayerOnly && !m.Player) - return; - - // Can't acquire a target we can't see. - if (!m_Mobile.CanSee(m)) - return; - - if (Core.AOS && m is BaseCreature && (m as BaseCreature).Summoned && !(m as BaseCreature).Controlled) - return; - - if (m_Mobile.Summoned && m_Mobile.SummonMaster != null) - { - // If this is a summon, it can't target its controller. - if (m == m_Mobile.SummonMaster) - return; - - // It also must abide by harmful spell rules. - if (!Server.Spells.SpellHelper.ValidIndirectTarget(m_Mobile.SummonMaster, m)) - return; - - // Animated creatures cannot attack players directly. - if (m is PlayerMobile && m_Mobile.IsAnimatedDead) - return; - } - - // If we only want faction friends, make sure it's one. - if (bFacFriend && !m_Mobile.IsFriend(m)) - return; - - //Ignore anyone under EtherealVoyage - if (TransformationSpellHelper.UnderTransformation(m, typeof(EtherealVoyageSpell))) - return; - - // Ignore players with activated honor - if (m is PlayerMobile && ((PlayerMobile)m).HonorActive && !(m_Mobile.Combatant == m)) - return; - - if (acqType == FightMode.Aggressor || acqType == FightMode.Evil) - { - bool bValid = IsHostile(m); - - if (!bValid) - bValid = (m_Mobile.GetFactionAllegiance(m) == BaseCreature.Allegiance.Enemy || m_Mobile.GetEthicAllegiance(m) == BaseCreature.Allegiance.Enemy); - - if (acqType == FightMode.Evil && !bValid) - { - if (m is BaseCreature && ((BaseCreature)m).Controlled && ((BaseCreature)m).ControlMaster != null) - bValid = (((BaseCreature)m).ControlMaster.Karma < 0); - else - bValid = (m.Karma < 0); - } - - if (!bValid) - return; - } - else - { - // Same goes for faction enemies. - if (bFacFoe && !m_Mobile.IsEnemy(m)) - return; - - // If it's an enemy factioned mobile, make sure we can be harmful to it. - if (bFacFoe && !bFacFriend && !m_Mobile.CanBeHarmful(m, false)) - return; - } - - theirVal = m_Mobile.GetFightModeRanking(m, acqType, bPlayerOnly); - - lock (valLock) { - if (theirVal > val && m_Mobile.InLOS(m)) - { - newFocusMob = m; - val = theirVal; - } - } - }); -#endif eable.Free(); diff --git a/Server/Item.cs b/Server/Item.cs index 7c8555d23..2b3aa87f8 100644 --- a/Server/Item.cs +++ b/Server/Item.cs @@ -3308,7 +3308,7 @@ namespace Server #if Framework_4_0 _processing = true; - if (m_DeltaQueue.Count >= 64) { + if (m_DeltaQueue.Count >= 512) { Parallel.ForEach(m_DeltaQueue, i => i.ProcessDelta()); } else { for (int i = 0; i < m_DeltaQueue.Count; i++) m_DeltaQueue[i].ProcessDelta(); diff --git a/Server/Mobile.cs b/Server/Mobile.cs index a5fb2cdb9..0a19f6656 100644 --- a/Server/Mobile.cs +++ b/Server/Mobile.cs @@ -10328,7 +10328,7 @@ namespace Server #if Framework_4_0 _processing = true; - if (m_DeltaQueue.Count >= 64) { + if (m_DeltaQueue.Count >= 512) { Parallel.ForEach(m_DeltaQueue, m => m.ProcessDelta()); m_DeltaQueue.Clear(); } else { diff --git a/Server/Network/NetState.cs b/Server/Network/NetState.cs index 70d57cebb..f65fcc9d7 100644 --- a/Server/Network/NetState.cs +++ b/Server/Network/NetState.cs @@ -1052,7 +1052,7 @@ namespace Server.Network { public static void FlushAll() { #if Framework_4_0 - if (m_Instances.Count >= 128) + if (m_Instances.Count >= 1024) Parallel.ForEach(m_Instances, ns => ns.Flush()); else #endif @@ -1175,7 +1175,7 @@ namespace Server.Network { try { long curTicks = Core.TickCount; #if Framework_4_0 - if (m_Instances.Count >= 512) + if (m_Instances.Count >= 1024) Parallel.ForEach(m_Instances, ns => ns.CheckAlive(curTicks)); else #endif