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:
parent
951f8b7d01
commit
e67faba4d8
20 changed files with 43 additions and 623 deletions
|
|
@ -668,11 +668,8 @@ namespace Server.Accounting
|
|||
break;
|
||||
}
|
||||
}
|
||||
#if Framework_4_0
|
||||
|
||||
Enum.TryParse( Utility.GetText( node["accessLevel"], "Player" ), true, out m_AccessLevel );
|
||||
#else
|
||||
m_AccessLevel = (AccessLevel)Enum.Parse( typeof( AccessLevel ), Utility.GetText( node["accessLevel"], "Player" ), true );
|
||||
#endif
|
||||
m_Flags = Utility.GetXMLInt32( Utility.GetText( node["flags"], "0" ), 0 );
|
||||
m_Created = Utility.GetXMLDateTime( Utility.GetText( node["created"], null ), DateTime.UtcNow );
|
||||
m_LastLogin = Utility.GetXMLDateTime( Utility.GetText( node["lastLogin"], null ), DateTime.UtcNow );
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ namespace Server.Commands
|
|||
else
|
||||
{
|
||||
SkillName skill;
|
||||
#if Framework_4_0
|
||||
if( Enum.TryParse( arg.GetString( 0 ), true, out skill ) )
|
||||
{
|
||||
arg.Mobile.Target = new SkillTarget( skill, arg.GetDouble( 1 ) );
|
||||
|
|
@ -34,18 +33,6 @@ namespace Server.Commands
|
|||
{
|
||||
arg.Mobile.SendLocalizedMessage( 1005631 ); // You have specified an invalid skill to set.
|
||||
}
|
||||
#else
|
||||
try
|
||||
{
|
||||
skill = (SkillName)Enum.Parse( typeof( SkillName ), arg.GetString( 0 ), true );
|
||||
}
|
||||
catch
|
||||
{
|
||||
arg.Mobile.SendLocalizedMessage( 1005631 ); // You have specified an invalid skill to set.
|
||||
return;
|
||||
}
|
||||
arg.Mobile.Target = new SkillTarget( skill, arg.GetDouble( 1 ) );
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -74,7 +61,6 @@ namespace Server.Commands
|
|||
else
|
||||
{
|
||||
SkillName skill;
|
||||
#if Framework_4_0
|
||||
if( Enum.TryParse( arg.GetString( 0 ), true, out skill ) )
|
||||
{
|
||||
arg.Mobile.Target = new SkillTarget( skill );
|
||||
|
|
@ -83,19 +69,6 @@ namespace Server.Commands
|
|||
{
|
||||
arg.Mobile.SendMessage( "You have specified an invalid skill to get." );
|
||||
}
|
||||
#else
|
||||
try
|
||||
{
|
||||
skill = (SkillName)Enum.Parse( typeof( SkillName ), arg.GetString( 0 ), true );
|
||||
}
|
||||
catch
|
||||
{
|
||||
arg.Mobile.SendLocalizedMessage( 1005631 ); // You have specified an invalid skill to set.
|
||||
return;
|
||||
}
|
||||
|
||||
arg.Mobile.Target = new SkillTarget( skill );
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,10 +2,8 @@ using System;
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
#if Framework_4_0
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
#endif
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Targeting;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
#if Framework_4_0
|
||||
using System.Threading.Tasks;
|
||||
#endif
|
||||
using Server.Regions;
|
||||
using Server.Targeting;
|
||||
using Server.Network;
|
||||
|
|
@ -5767,19 +5765,11 @@ namespace Server.Mobiles
|
|||
// added array for wild creatures in house regions to be removed
|
||||
List<BaseCreature> toRemove = new List<BaseCreature>();
|
||||
|
||||
#if Framework_4_0
|
||||
Parallel.ForEach(World.Mobiles.Values, m => {
|
||||
#else
|
||||
foreach ( Mobile m in World.Mobiles.Values ) {
|
||||
#endif
|
||||
if ( m is BaseMount && ((BaseMount)m).Rider != null )
|
||||
{
|
||||
((BaseCreature)m).OwnerAbandonTime = DateTime.MinValue;
|
||||
#if Framework_4_0
|
||||
return;
|
||||
#else
|
||||
continue;
|
||||
#endif
|
||||
}
|
||||
|
||||
if ( m is BaseCreature )
|
||||
|
|
@ -5838,10 +5828,7 @@ namespace Server.Mobiles
|
|||
c.RemoveStep = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
#if Framework_4_0
|
||||
);
|
||||
#endif
|
||||
});
|
||||
|
||||
foreach ( BaseCreature c in toRelease )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -121,29 +121,13 @@ namespace Server.Misc
|
|||
private static void ChangeSkill( Mobile from, string name, double value )
|
||||
{
|
||||
SkillName index;
|
||||
#if Framework_4_0
|
||||
|
||||
if( !Enum.TryParse( name, true, out index ) || (!Core.SE && (int)index > 51) || (!Core.AOS && (int)index > 48) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1005631 ); // You have specified an invalid skill to set.
|
||||
return;
|
||||
}
|
||||
#else
|
||||
try
|
||||
{
|
||||
index = (SkillName)Enum.Parse( typeof( SkillName ), name, true );
|
||||
}
|
||||
catch
|
||||
{
|
||||
from.SendLocalizedMessage( 1005631 ); // You have specified an invalid skill to set.
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ( !Core.SE && (int)index > 51 ) || ( !Core.AOS && (int)index > 48 ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1005631 ); // You have specified an invalid skill to set.
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
Skill skill = from.Skills[index];
|
||||
|
||||
if ( skill != null )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue