RunUO 2.4 will be the latest release supporting the 2.0 .NET Framework.

Framework_4_0 preprocessors have been removed. ScriptCompiler will set Framework_4_0 as legacy.
This commit is contained in:
Mark Sturgill 2013-10-30 11:28:34 -07:00
parent 951f8b7d01
commit e67faba4d8
20 changed files with 43 additions and 623 deletions

View file

@ -24,9 +24,7 @@ using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Threading;
#if Framework_4_0
using System.Threading.Tasks;
#endif
using Server;
using Server.Accounting;
using Server.Network;
@ -1051,11 +1049,9 @@ namespace Server.Network {
}
public static void FlushAll() {
#if Framework_4_0
if (m_Instances.Count >= 1024)
Parallel.ForEach(m_Instances, ns => ns.Flush());
else
#endif
for ( int i = 0; i < m_Instances.Count; ++i ) {
m_Instances[i].Flush();
}
@ -1174,11 +1170,10 @@ namespace Server.Network {
public static void CheckAllAlive() {
try {
long curTicks = Core.TickCount;
#if Framework_4_0
if (m_Instances.Count >= 1024)
Parallel.ForEach(m_Instances, ns => ns.CheckAlive(curTicks));
else
#endif
for ( int i = 0; i < m_Instances.Count; ++i ) {
m_Instances[i].CheckAlive(curTicks);
}

View file

@ -23,9 +23,7 @@ using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Net;
#if Framework_4_0
using System.Threading;
#endif
using Server.Accounting;
using Server.Targeting;
using Server.Items;
@ -3357,13 +3355,8 @@ namespace Server.Network
return new MobileIncomingOld(beholder, beheld);
}
#if Framework_4_0
private static ThreadLocal<int[]> m_DupedLayersTL = new ThreadLocal<int[]>(() => {return new int[256];});
private static ThreadLocal<int> m_VersionTL = new ThreadLocal<int>();
#else
private static int[] m_DupedLayers = new int[256];
private static int m_Version;
#endif
public Mobile m_Beheld;
@ -3371,12 +3364,8 @@ namespace Server.Network
{
m_Beheld = beheld;
#if Framework_4_0
int m_Version = ++(m_VersionTL.Value);
int[] m_DupedLayers = m_DupedLayersTL.Value;
#else
++m_Version;
#endif
List<Item> eq = beheld.Items;
int count = eq.Count;
@ -3474,13 +3463,8 @@ namespace Server.Network
public sealed class MobileIncomingSA : Packet
{
#if Framework_4_0
private static ThreadLocal<int[]> m_DupedLayersTL = new ThreadLocal<int[]>(() => {return new int[256];});
private static ThreadLocal<int> m_VersionTL = new ThreadLocal<int>();
#else
private static int[] m_DupedLayers = new int[256];
private static int m_Version;
#endif
public Mobile m_Beheld;
@ -3488,12 +3472,8 @@ namespace Server.Network
{
m_Beheld = beheld;
#if Framework_4_0
int m_Version = ++(m_VersionTL.Value);
int[] m_DupedLayers = m_DupedLayersTL.Value;
#else
++m_Version;
#endif
List<Item> eq = beheld.Items;
int count = eq.Count;
@ -3609,13 +3589,8 @@ namespace Server.Network
// Pre-7.0.0.0 Mobile Incoming
public sealed class MobileIncomingOld : Packet
{
#if Framework_4_0
private static ThreadLocal<int[]> m_DupedLayersTL = new ThreadLocal<int[]>(() => {return new int[256];});
private static ThreadLocal<int> m_VersionTL = new ThreadLocal<int>();
#else
private static int[] m_DupedLayers = new int[256];
private static int m_Version;
#endif
public Mobile m_Beheld;
@ -3623,12 +3598,8 @@ namespace Server.Network
{
m_Beheld = beheld;
#if Framework_4_0
int m_Version = ++(m_VersionTL.Value);
int[] m_DupedLayers = m_DupedLayersTL.Value;
#else
++m_Version;
#endif
List<Item> eq = beheld.Items;
int count = eq.Count;