Replaces types with built-in types.

This commit is contained in:
Kamron Batman 2018-09-14 13:22:16 -07:00
parent fee83ce560
commit 22ab83ea9e
98 changed files with 248 additions and 248 deletions

View file

@ -223,15 +223,15 @@ namespace Server.Misc
return ( IPTable[ip] < MaxAccountsPerIP ); return ( IPTable[ip] < MaxAccountsPerIP );
} }
private static Dictionary<IPAddress, Int32> m_IPTable; private static Dictionary<IPAddress, int> m_IPTable;
public static Dictionary<IPAddress, Int32> IPTable public static Dictionary<IPAddress, int> IPTable
{ {
get get
{ {
if ( m_IPTable == null ) if ( m_IPTable == null )
{ {
m_IPTable = new Dictionary<IPAddress, Int32>(); m_IPTable = new Dictionary<IPAddress, int>();
foreach ( Account a in Accounts.GetAccounts() ) foreach ( Account a in Accounts.GetAccounts() )
if ( a.LoginIPs.Length > 0 ) if ( a.LoginIPs.Length > 0 )

View file

@ -686,10 +686,10 @@ namespace Server.Commands
} }
private static Type[] m_SignedNumerics = { private static Type[] m_SignedNumerics = {
typeof( Int64 ), typeof( long ),
typeof( Int32 ), typeof( int ),
typeof( Int16 ), typeof( short ),
typeof( SByte ) typeof( sbyte )
}; };
public static bool IsSignedNumeric( Type type ) public static bool IsSignedNumeric( Type type )
@ -702,10 +702,10 @@ namespace Server.Commands
} }
private static Type[] m_UnsignedNumerics = { private static Type[] m_UnsignedNumerics = {
typeof( UInt64 ), typeof( ulong ),
typeof( UInt32 ), typeof( uint ),
typeof( UInt16 ), typeof( ushort ),
typeof( Byte ) typeof( byte )
}; };
public static bool IsUnsignedNumeric( Type type ) public static bool IsUnsignedNumeric( Type type )

View file

@ -207,11 +207,11 @@ namespace Server.Commands
} }
int index = 0; int index = 0;
string file = String.Concat( name, ext ); string file = string.Concat( name, ext );
while( File.Exists( Path.Combine( root, file ) ) ) while( File.Exists( Path.Combine( root, file ) ) )
{ {
file = String.Concat( name, ++index, ext ); file = string.Concat( name, ++index, ext );
} }
return file; return file;
@ -370,7 +370,7 @@ namespace Server.Commands
aliased = realType.Name; aliased = realType.Name;
} }
string retval = String.Concat( prepend, aliased, append, name ); string retval = string.Concat( prepend, aliased, append, name );
//Console.WriteLine(">> getpair: "+retval); //Console.WriteLine(">> getpair: "+retval);
return retval; return retval;
} }
@ -1947,16 +1947,16 @@ namespace Server.Commands
private const string HtmlNewLine = "&#13;"; private const string HtmlNewLine = "&#13;";
private static object[,] m_Tooltips = { private static object[,] m_Tooltips = {
{ typeof( Byte ), "Numeric value in the range from 0 to 255, inclusive." }, { typeof( byte ), "Numeric value in the range from 0 to 255, inclusive." },
{ typeof( SByte ), "Numeric value in the range from negative 128 to positive 127, inclusive." }, { typeof( sbyte ), "Numeric value in the range from negative 128 to positive 127, inclusive." },
{ typeof( UInt16 ), "Numeric value in the range from 0 to 65,535, inclusive." }, { typeof( ushort ), "Numeric value in the range from 0 to 65,535, inclusive." },
{ typeof( Int16 ), "Numeric value in the range from negative 32,768 to positive 32,767, inclusive." }, { typeof( short ), "Numeric value in the range from negative 32,768 to positive 32,767, inclusive." },
{ typeof( UInt32 ), "Numeric value in the range from 0 to 4,294,967,295, inclusive." }, { typeof( uint ), "Numeric value in the range from 0 to 4,294,967,295, inclusive." },
{ typeof( Int32 ), "Numeric value in the range from negative 2,147,483,648 to positive 2,147,483,647, inclusive." }, { typeof( int ), "Numeric value in the range from negative 2,147,483,648 to positive 2,147,483,647, inclusive." },
{ typeof( UInt64 ), "Numeric value in the range from 0 through about 10^20." }, { typeof( ulong ), "Numeric value in the range from 0 through about 10^20." },
{ typeof( Int64 ), "Numeric value in the approximate range from negative 10^19 through 10^19." }, { typeof( long ), "Numeric value in the approximate range from negative 10^19 through 10^19." },
{ typeof( String ), "Text value. To specify a value containing spaces, encapsulate the value in quote characters:{0}{0}&quot;Spaced text example&quot;" }, { typeof( string ), "Text value. To specify a value containing spaces, encapsulate the value in quote characters:{0}{0}&quot;Spaced text example&quot;" },
{ typeof( Boolean ), "Boolean value which can be either True or False." }, { typeof( bool ), "Boolean value which can be either True or False." },
{ typeof( Map ), "Map or facet name. Possible values include:{0}{0}- Felucca{0}- Trammel{0}- Ilshenar{0}- Malas" }, { typeof( Map ), "Map or facet name. Possible values include:{0}{0}- Felucca{0}- Trammel{0}- Ilshenar{0}- Malas" },
{ typeof( Poison ), "Poison name or level. Possible values include:{0}{0}- Lesser{0}- Regular{0}- Greater{0}- Deadly{0}- Lethal" }, { typeof( Poison ), "Poison name or level. Possible values include:{0}{0}- Lesser{0}- Regular{0}- Greater{0}- Deadly{0}- Lethal" },
{ typeof( Point3D ), "Three-dimensional coordinate value. Format as follows:{0}{0}&quot;(<x value>, <y value>, <z value>)&quot;" } { typeof( Point3D ), "Three-dimensional coordinate value. Format as follows:{0}{0}&quot;(<x value>, <y value>, <z value>)&quot;" }
@ -1971,7 +1971,7 @@ namespace Server.Commands
Type checkType = (Type)m_Tooltips[i, 0]; Type checkType = (Type)m_Tooltips[i, 0];
if ( paramType == checkType ) if ( paramType == checkType )
return String.Format( (string)m_Tooltips[i, 1], HtmlNewLine ); return string.Format( (string)m_Tooltips[i, 1], HtmlNewLine );
} }
if ( paramType.IsEnum ) if ( paramType.IsEnum )
@ -2508,7 +2508,7 @@ namespace Server.Commands
{ {
// MONO: type.Namespace is null/empty for generic arguments // MONO: type.Namespace is null/empty for generic arguments
if ( type.Name == "T" || String.IsNullOrEmpty( type.Namespace ) || m_Namespaces == null ) if ( type.Name == "T" || string.IsNullOrEmpty( type.Namespace ) || m_Namespaces == null )
return true; return true;
if ( type.Namespace.StartsWith( "Server" ) ) if ( type.Namespace.StartsWith( "Server" ) )

View file

@ -387,7 +387,7 @@ namespace Server.Commands
for ( index = 0; index < input.Length; ++index ) for ( index = 0; index < input.Length; ++index )
{ {
if ( Char.IsLetter( input, index ) ) if ( char.IsLetter( input, index ) )
break; break;
} }

View file

@ -268,7 +268,7 @@ namespace Server.Commands.Generic
if ( m_IgnoreCase || methodName == "Equals" ) if ( m_IgnoreCase || methodName == "Equals" )
{ {
Type type = ( m_IgnoreCase ? typeof( Insensitive ) : typeof( String ) ); Type type = ( m_IgnoreCase ? typeof( Insensitive ) : typeof( string ) );
emitter.BeginCall( emitter.BeginCall(
type.GetMethod( type.GetMethod(

View file

@ -64,7 +64,7 @@ namespace Server.Commands
if ( !m_Enabled ) if ( !m_Enabled )
return; return;
WriteLine( from, String.Format( format, args ) ); WriteLine( from, string.Format( format, args ) );
} }
public static void WriteLine( Mobile from, string text ) public static void WriteLine( Mobile from, string text )

View file

@ -334,7 +334,7 @@ namespace Server.Commands
{ {
ArrayList types = new ArrayList(); ArrayList types = new ArrayList();
using ( BinaryReader bin = new BinaryReader( new FileStream( String.Format( "Saves/{0}/{0}.tdb", type ), FileMode.Open, FileAccess.Read, FileShare.Read ) ) ) using ( BinaryReader bin = new BinaryReader( new FileStream( string.Format( "Saves/{0}/{0}.tdb", type ), FileMode.Open, FileAccess.Read, FileShare.Read ) ) )
{ {
int count = bin.ReadInt32(); int count = bin.ReadInt32();
@ -346,7 +346,7 @@ namespace Server.Commands
Hashtable table = new Hashtable(); Hashtable table = new Hashtable();
using ( BinaryReader bin = new BinaryReader( new FileStream( String.Format( "Saves/{0}/{0}.idx", type ), FileMode.Open, FileAccess.Read, FileShare.Read ) ) ) using ( BinaryReader bin = new BinaryReader( new FileStream( string.Format( "Saves/{0}/{0}.idx", type ), FileMode.Open, FileAccess.Read, FileShare.Read ) ) )
{ {
int count = bin.ReadInt32(); int count = bin.ReadInt32();

View file

@ -309,9 +309,9 @@ namespace Server.Commands
if ( value == null ) if ( value == null )
toString = "null"; toString = "null";
else if ( IsNumeric( type ) ) else if ( IsNumeric( type ) )
toString = String.Format( "{0} (0x{0:X})", value ); toString = string.Format( "{0} (0x{0:X})", value );
else if ( IsChar( type ) ) else if ( IsChar( type ) )
toString = String.Format( "'{0}' ({1} [0x{1:X}])", value, (int) value ); toString = string.Format( "'{0}' ({1} [0x{1:X}])", value, (int) value );
else if ( IsString( type ) ) else if ( IsString( type ) )
toString = ( (string) value == "null" ? @"@""null""" : $"\"{value}\""); toString = ( (string) value == "null" ? @"@""null""" : $"\"{value}\"");
else if ( IsText( type ) ) else if ( IsText( type ) )
@ -332,7 +332,7 @@ namespace Server.Commands
concat[concat.Length-1] = toString; concat[concat.Length-1] = toString;
return String.Concat( concat ); return string.Concat( concat );
} }
public static string SetValue( Mobile from, object o, string name, string value ) public static string SetValue( Mobile from, object o, string name, string value )
@ -362,14 +362,14 @@ namespace Server.Commands
return ( t == typeofType ); return ( t == typeofType );
} }
private static Type typeofChar = typeof( Char ); private static Type typeofChar = typeof( char );
private static bool IsChar( Type t ) private static bool IsChar( Type t )
{ {
return ( t == typeofChar ); return ( t == typeofChar );
} }
private static Type typeofString = typeof( String ); private static Type typeofString = typeof( string );
private static bool IsString( Type t ) private static bool IsString( Type t )
{ {
@ -409,10 +409,10 @@ namespace Server.Commands
} }
private static Type[] m_NumericTypes = { private static Type[] m_NumericTypes = {
typeof( Byte ), typeof( SByte ), typeof( byte ), typeof( sbyte ),
typeof( Int16 ), typeof( UInt16 ), typeof( short ), typeof( ushort ),
typeof( Int32 ), typeof( UInt32 ), typeof( int ), typeof( uint ),
typeof( Int64 ), typeof( UInt64 ) typeof( long ), typeof( ulong )
}; };
private static bool IsNumeric( Type t ) private static bool IsNumeric( Type t )
@ -495,7 +495,7 @@ namespace Server.Commands
} }
if ( isSerial ) // mutate back if ( isSerial ) // mutate back
toSet = (Serial)((Int32)toSet); toSet = (Serial)((int)toSet);
constructed = toSet; constructed = toSet;
return null; return null;
@ -598,7 +598,7 @@ namespace Server
public sealed class NotYetBoundException : BindingException public sealed class NotYetBoundException : BindingException
{ {
public NotYetBoundException( Property property ) public NotYetBoundException( Property property )
: base( property, String.Format( "Property has not yet been bound." ) ) : base( property, string.Format( "Property has not yet been bound." ) )
{ {
} }
} }
@ -606,7 +606,7 @@ namespace Server
public sealed class AlreadyBoundException : BindingException public sealed class AlreadyBoundException : BindingException
{ {
public AlreadyBoundException( Property property ) public AlreadyBoundException( Property property )
: base( property, String.Format( "Property has already been bound." ) ) : base( property, string.Format( "Property has already been bound." ) )
{ {
} }
} }

View file

@ -49,7 +49,7 @@ namespace Server
public static void SendWarning( Mobile m, string header, string baseWarning, Map map, Point3D start, Point3D end, WarningGumpCallback callback ) public static void SendWarning( Mobile m, string header, string baseWarning, Map map, Point3D start, Point3D end, WarningGumpCallback callback )
{ {
m.SendGump( new WarningGump( 1060635, 30720, String.Format( baseWarning, String.Format( header, map ) ), 0xFFC000, 420, 400, callback, new StateInfo( map, start, end ) ) ); m.SendGump( new WarningGump( 1060635, 30720, string.Format( baseWarning, string.Format( header, map ) ), 0xFFC000, 420, 400, callback, new StateInfo( map, start, end ) ) );
} }
private const string BaseFreezeWarning = "{0} " + private const string BaseFreezeWarning = "{0} " +

View file

@ -262,7 +262,7 @@ namespace Server.Engines.BulkOrders
LabelTo(from, 1062344, m_Entries.Count.ToString()); // Deeds in book: ~1_val~ LabelTo(from, 1062344, m_Entries.Count.ToString()); // Deeds in book: ~1_val~
if (!String.IsNullOrEmpty(m_BookName)) if (!string.IsNullOrEmpty(m_BookName))
LabelTo(from, 1062481, m_BookName); LabelTo(from, 1062481, m_BookName);
} }

View file

@ -49,7 +49,7 @@ namespace Server.Engines.Chat
{ {
newValue = value.Trim(); newValue = value.Trim();
if ( String.IsNullOrEmpty( newValue ) ) if ( string.IsNullOrEmpty( newValue ) )
newValue = null; newValue = null;
} }

View file

@ -8,10 +8,10 @@ namespace Server.Engines.Chat
public ChatMessagePacket( Mobile who, int number, string param1, string param2 ) : base( 0xB2 ) public ChatMessagePacket( Mobile who, int number, string param1, string param2 ) : base( 0xB2 )
{ {
if ( param1 == null ) if ( param1 == null )
param1 = String.Empty; param1 = string.Empty;
if ( param2 == null ) if ( param2 == null )
param2 = String.Empty; param2 = string.Empty;
EnsureCapacity( 13 + ((param1.Length + param2.Length) * 2) ); EnsureCapacity( 13 + ((param1.Length + param2.Length) * 2) );

View file

@ -65,11 +65,11 @@ namespace Server.Engines.ConPVP
else else
fmt = "You have been challenged to a duel from {0}. Do you accept?"; fmt = "You have been challenged to a duel from {0}. Do you accept?";
AddHtml( 22-1, 50, 294, 40, Color( String.Format( fmt, challenger.Name ), BlackColor32 ), false, false ); AddHtml( 22-1, 50, 294, 40, Color( string.Format( fmt, challenger.Name ), BlackColor32 ), false, false );
AddHtml( 22+1, 50, 294, 40, Color( String.Format( fmt, challenger.Name ), BlackColor32 ), false, false ); AddHtml( 22+1, 50, 294, 40, Color( string.Format( fmt, challenger.Name ), BlackColor32 ), false, false );
AddHtml( 22, 50-1, 294, 40, Color( String.Format( fmt, challenger.Name ), BlackColor32 ), false, false ); AddHtml( 22, 50-1, 294, 40, Color( string.Format( fmt, challenger.Name ), BlackColor32 ), false, false );
AddHtml( 22, 50+1, 294, 40, Color( String.Format( fmt, challenger.Name ), BlackColor32 ), false, false ); AddHtml( 22, 50+1, 294, 40, Color( string.Format( fmt, challenger.Name ), BlackColor32 ), false, false );
AddHtml( 22, 50, 294, 40, Color( String.Format( fmt, challenger.Name ), 0xB0C868 ), false, false ); AddHtml( 22, 50, 294, 40, Color( string.Format( fmt, challenger.Name ), 0xB0C868 ), false, false );
AddImageTiled( 32, 88, 264, 1, 9107 ); AddImageTiled( 32, 88, 264, 1, 9107 );
AddImageTiled( 42, 90, 264, 1, 9157 ); AddImageTiled( 42, 90, 264, 1, 9157 );

View file

@ -1180,7 +1180,7 @@ namespace Server.Engines.ConPVP
string text = string text =
$"{{0}} are ranked {LadderGump.Rank(entry.Index + 1)} at level {Ladder.GetLevel(entry.Experience)}."; $"{{0}} are ranked {LadderGump.Rank(entry.Index + 1)} at level {Ladder.GetLevel(entry.Experience)}.";
pm.PrivateOverheadMessage( MessageType.Regular, pm.SpeechHue, true, String.Format( text, from==pm?"You":"They" ), from.NetState ); pm.PrivateOverheadMessage( MessageType.Regular, pm.SpeechHue, true, string.Format( text, from==pm?"You":"They" ), from.NetState );
} }
else if ( obj is Mobile mob ) else if ( obj is Mobile mob )
{ {
@ -1272,8 +1272,8 @@ namespace Server.Engines.ConPVP
string text = string text =
$"{{0}} {{1}} ranked {LadderGump.Rank(entry.Index + 1)} at level {Ladder.GetLevel(entry.Experience)}."; $"{{0}} {{1}} ranked {LadderGump.Rank(entry.Index + 1)} at level {Ladder.GetLevel(entry.Experience)}.";
pm.LocalOverheadMessage( MessageType.Regular, pm.SpeechHue, true, String.Format( text, "You", "are" ) ); pm.LocalOverheadMessage( MessageType.Regular, pm.SpeechHue, true, string.Format( text, "You", "are" ) );
pm.NonlocalOverheadMessage( MessageType.Regular, pm.SpeechHue, true, String.Format( text, pm.Name, "is" ) ); pm.NonlocalOverheadMessage( MessageType.Regular, pm.SpeechHue, true, string.Format( text, pm.Name, "is" ) );
//pm.PublicOverheadMessage( MessageType.Regular, pm.SpeechHue, true, String.Format( "Level {0} with {1} win{2} and {3} loss{4}.", Ladder.GetLevel( entry.Experience ), entry.Wins, entry.Wins==1?"":"s", entry.Losses, entry.Losses==1?"":"es" ) ); //pm.PublicOverheadMessage( MessageType.Regular, pm.SpeechHue, true, String.Format( "Level {0} with {1} win{2} and {3} loss{4}.", Ladder.GetLevel( entry.Experience ), entry.Wins, entry.Wins==1?"":"s", entry.Losses, entry.Losses==1?"":"es" ) );
//pm.PublicOverheadMessage( MessageType.Regular, pm.SpeechHue, true, String.Format( "Level {0} with {1} win{2} and {3} loss{4}.", Ladder.GetLevel( entry.Experience ), entry.Wins, entry.Wins==1?"":"s", entry.Losses, entry.Losses==1?"":"es" ) ); //pm.PublicOverheadMessage( MessageType.Regular, pm.SpeechHue, true, String.Format( "Level {0} with {1} win{2} and {3} loss{4}.", Ladder.GetLevel( entry.Experience ), entry.Wins, entry.Wins==1?"":"s", entry.Losses, entry.Losses==1?"":"es" ) );

View file

@ -65,7 +65,7 @@ namespace Server.Engines.ConPVP
{ {
Participant p = (Participant)context.Participants[i]; Participant p = (Participant)context.Participants[i];
AddGoldenButtonLabeled( x, y, 4 + i, String.Format( p.Count == 1 ? "Player {0}: {3}" : "Team {0}: {1}/{2}: {3}", 1 + i, p.FilledSlots, p.Count, p.NameList ) ); y += 22; AddGoldenButtonLabeled( x, y, 4 + i, string.Format( p.Count == 1 ? "Player {0}: {3}" : "Team {0}: {1}/{2}: {3}", 1 + i, p.FilledSlots, p.Count, p.NameList ) ); y += 22;
} }
} }

View file

@ -1581,7 +1581,7 @@ namespace Server.Engines.ConPVP
public void Alert( string format, params object[] args ) public void Alert( string format, params object[] args )
{ {
Alert( String.Format( format, args ) ); Alert( string.Format( format, args ) );
} }
public BRGame( BRController controller, DuelContext context ) : base( context ) public BRGame( BRController controller, DuelContext context ) : base( context )

View file

@ -925,7 +925,7 @@ namespace Server.Engines.ConPVP
public void Alert( string format, params object[] args ) public void Alert( string format, params object[] args )
{ {
Alert( String.Format( format, args ) ); Alert( string.Format( format, args ) );
} }
public CTFGame( CTFController controller, DuelContext context ) : base( context ) public CTFGame( CTFController controller, DuelContext context ) : base( context )

View file

@ -559,7 +559,7 @@ namespace Server.Engines.ConPVP
public void Alert( string format, params object[] args ) public void Alert( string format, params object[] args )
{ {
Alert( String.Format( format, args ) ); Alert( string.Format( format, args ) );
} }
public DDGame( DDController controller, DuelContext context ) : base( context ) public DDGame( DDController controller, DuelContext context ) : base( context )

View file

@ -947,7 +947,7 @@ namespace Server.Engines.ConPVP
public void Alert(string format, params object[] args) public void Alert(string format, params object[] args)
{ {
Alert(String.Format(format, args)); Alert(string.Format(format, args));
} }
public KHGame(KHController controller, DuelContext context) public KHGame(KHController controller, DuelContext context)

View file

@ -149,7 +149,7 @@ namespace Server.Engines.ConPVP
else else
AddImage( 466, height-12-2-16, 0x2622 ); AddImage( 466, height-12-2-16, 0x2622 );
AddHtml( 16, height-12-2-18, 400, 20, Color( String.Format( "Top {3} of {0:N0} duelists, page {1} of {2}", list.Count, page+1, (lc+14)/15, lc ), 0xFFC000 ), false, false ); AddHtml( 16, height-12-2-18, 400, 20, Color( string.Format( "Top {3} of {0:N0} duelists, page {1} of {2}", list.Count, page+1, (lc+14)/15, lc ), 0xFFC000 ), false, false );
AddColumnHeader( 75, "Rank" ); AddColumnHeader( 75, "Rank" );
AddColumnHeader( 115, "Level" ); AddColumnHeader( 115, "Level" );

View file

@ -51,7 +51,7 @@ namespace Server.Engines.ConPVP
m_Players[i].Mobile.SendMessage( hue, message ); m_Players[i].Mobile.SendMessage( hue, message );
if ( nonLocalOverhead != null ) if ( nonLocalOverhead != null )
m_Players[i].Mobile.NonlocalOverheadMessage( Network.MessageType.Regular, hue, false, String.Format( nonLocalOverhead, m_Players[i].Mobile.Name, m_Players[i].Mobile.Female ? "her" : "his" ) ); m_Players[i].Mobile.NonlocalOverheadMessage( Network.MessageType.Regular, hue, false, string.Format( nonLocalOverhead, m_Players[i].Mobile.Name, m_Players[i].Mobile.Female ? "her" : "his" ) );
if ( localOverhead != null ) if ( localOverhead != null )
m_Players[i].Mobile.LocalOverheadMessage( Network.MessageType.Regular, hue, false, localOverhead ); m_Players[i].Mobile.LocalOverheadMessage( Network.MessageType.Regular, hue, false, localOverhead );

View file

@ -716,7 +716,7 @@ namespace Server.Engines.ConPVP
timeUntil = $"in {minutesUntil} minute{(minutesUntil == 1 ? "" : "s")}"; timeUntil = $"in {minutesUntil} minute{(minutesUntil == 1 ? "" : "s")}";
m_Registrar.PrivateOverheadMessage( MessageType.Regular, m_Registrar.PrivateOverheadMessage( MessageType.Regular,
0x35, false, String.Format( fmt, from.Female ? "Lady" : "Lord", timeUntil ), from.NetState ); 0x35, false, string.Format( fmt, from.Female ? "Lady" : "Lord", timeUntil ), from.NetState );
} }
TournyParticipant part = new TournyParticipant( from ); TournyParticipant part = new TournyParticipant( from );
@ -2687,7 +2687,7 @@ namespace Server.Engines.ConPVP
public void AddLog( string format, params object[] args ) public void AddLog( string format, params object[] args )
{ {
AddLog( String.Format( format, args ) ); AddLog( string.Format( format, args ) );
} }
public void WonMatch( TournyMatch match ) public void WonMatch( TournyMatch match )

View file

@ -663,7 +663,7 @@ namespace Server.Engines.Craft
if ( res.MessageNumber > 0 ) if ( res.MessageNumber > 0 )
message = res.MessageNumber; message = res.MessageNumber;
else if ( !String.IsNullOrEmpty( res.MessageString ) ) else if ( !string.IsNullOrEmpty( res.MessageString ) )
message = res.MessageString; message = res.MessageString;
else else
message = 502925; // You don't have the resources required to make that item. message = 502925; // You don't have the resources required to make that item.
@ -791,7 +791,7 @@ namespace Server.Engines.Craft
if ( res.MessageNumber > 0 ) if ( res.MessageNumber > 0 )
message = res.MessageNumber; message = res.MessageNumber;
else if ( res.MessageString != null && res.MessageString != String.Empty ) else if ( res.MessageString != null && res.MessageString != string.Empty )
message = res.MessageString; message = res.MessageString;
else else
message = 502925; // You don't have the resources required to make that item. message = 502925; // You don't have the resources required to make that item.

View file

@ -32,7 +32,7 @@ namespace Server.Engines.Craft
{ {
if ( m_MessageNumber > 0 ) if ( m_MessageNumber > 0 )
from.SendLocalizedMessage( m_MessageNumber ); from.SendLocalizedMessage( m_MessageNumber );
else if ( !String.IsNullOrEmpty( m_MessageString ) ) else if ( !string.IsNullOrEmpty( m_MessageString ) )
from.SendMessage( m_MessageString ); from.SendMessage( m_MessageString );
else else
from.SendLocalizedMessage( 502925 ); // You don't have the resources required to make that item. from.SendLocalizedMessage( 502925 ); // You don't have the resources required to make that item.

View file

@ -17,8 +17,8 @@ namespace Server.Engines.Doom
private bool m_Enabled; private bool m_Enabled;
private static bool installed; private static bool installed;
private UInt16 m_MyKey; private ushort m_MyKey;
private UInt16 m_TheirKey; private ushort m_TheirKey;
private List<Item> m_Levers; private List<Item> m_Levers;
private List<Item> m_Teles; private List<Item> m_Teles;
@ -58,12 +58,12 @@ namespace Server.Engines.Doom
} }
[CommandProperty( AccessLevel.GameMaster )] [CommandProperty( AccessLevel.GameMaster )]
public UInt16 MyKey { get => m_MyKey; public ushort MyKey { get => m_MyKey;
set => m_MyKey = value; set => m_MyKey = value;
} }
[CommandProperty( AccessLevel.GameMaster )] [CommandProperty( AccessLevel.GameMaster )]
public UInt16 TheirKey { get => m_TheirKey; public ushort TheirKey { get => m_TheirKey;
set => m_TheirKey = value; set => m_TheirKey = value;
} }
@ -262,7 +262,7 @@ namespace Server.Engines.Doom
m_Successful=null; m_Successful=null;
} }
public virtual void LeverPulled( UInt16 code ) public virtual void LeverPulled( ushort code )
{ {
int Correct=0; int Correct=0;
Mobile m_Player; Mobile m_Player;
@ -326,7 +326,7 @@ namespace Server.Engines.Doom
public virtual void GenKey() /* Shuffle & build key */ public virtual void GenKey() /* Shuffle & build key */
{ {
UInt16 tmp; int n, i; ushort[] CA = { 1,2,4,8 }; ushort tmp; int n, i; ushort[] CA = { 1,2,4,8 };
for (i=0; i<4; i++) for (i=0; i<4; i++)
{ {
n=(((n = Utility.Random(0,3))==i) ? n&~i : n ); /* if (i==n) { return pointless; } */ n=(((n = Utility.Random(0,3))==i) ? n&~i : n ); /* if (i==n) { return pointless; } */

View file

@ -95,13 +95,13 @@ namespace Server.Engines.Doom
public class LeverPuzzleLever : Item public class LeverPuzzleLever : Item
{ {
private UInt16 m_Code; private ushort m_Code;
private LeverPuzzleController m_Controller; private LeverPuzzleController m_Controller;
[CommandProperty( AccessLevel.GameMaster )] [CommandProperty( AccessLevel.GameMaster )]
public UInt16 Code => m_Code; public ushort Code => m_Code;
public LeverPuzzleLever( UInt16 code, LeverPuzzleController controller ) : base( 0x108E ) public LeverPuzzleLever( ushort code, LeverPuzzleController controller ) : base( 0x108E )
{ {
m_Controller=controller; m_Controller=controller;
m_Code = code; m_Code = code;

View file

@ -62,7 +62,7 @@ namespace Server.Mobiles
if ( suffix.Length == 0 ) if ( suffix.Length == 0 )
suffix = Ethic.Evil.Definition.Adjunct.String; suffix = Ethic.Evil.Definition.Adjunct.String;
else else
suffix = String.Concat( suffix, " ", Ethic.Evil.Definition.Adjunct.String ); suffix = string.Concat( suffix, " ", Ethic.Evil.Definition.Adjunct.String );
return base.ApplyNameSuffix( suffix ); return base.ApplyNameSuffix( suffix );
} }

View file

@ -59,7 +59,7 @@ namespace Server.Mobiles
if ( suffix.Length == 0 ) if ( suffix.Length == 0 )
suffix = Ethic.Evil.Definition.Adjunct.String; suffix = Ethic.Evil.Definition.Adjunct.String;
else else
suffix = String.Concat( suffix, " ", Ethic.Evil.Definition.Adjunct.String ); suffix = string.Concat( suffix, " ", Ethic.Evil.Definition.Adjunct.String );
return base.ApplyNameSuffix( suffix ); return base.ApplyNameSuffix( suffix );
} }

View file

@ -63,7 +63,7 @@ namespace Server.Mobiles
if ( suffix.Length == 0 ) if ( suffix.Length == 0 )
suffix = Ethic.Hero.Definition.Adjunct.String; suffix = Ethic.Hero.Definition.Adjunct.String;
else else
suffix = String.Concat( suffix, " ", Ethic.Hero.Definition.Adjunct.String ); suffix = string.Concat( suffix, " ", Ethic.Hero.Definition.Adjunct.String );
return base.ApplyNameSuffix( suffix ); return base.ApplyNameSuffix( suffix );
} }

View file

@ -59,7 +59,7 @@ namespace Server.Mobiles
if ( suffix.Length == 0 ) if ( suffix.Length == 0 )
suffix = Ethic.Hero.Definition.Adjunct.String; suffix = Ethic.Hero.Definition.Adjunct.String;
else else
suffix = String.Concat( suffix, " ", Ethic.Hero.Definition.Adjunct.String ); suffix = string.Concat( suffix, " ", Ethic.Hero.Definition.Adjunct.String );
return base.ApplyNameSuffix( suffix ); return base.ApplyNameSuffix( suffix );
} }

View file

@ -100,12 +100,12 @@ namespace Server.Factions
public void Broadcast( string format, params object[] args ) public void Broadcast( string format, params object[] args )
{ {
Broadcast( String.Format( format, args ) ); Broadcast( string.Format( format, args ) );
} }
public void Broadcast( int hue, string format, params object[] args ) public void Broadcast( int hue, string format, params object[] args )
{ {
Broadcast( hue, String.Format( format, args ) ); Broadcast( hue, string.Format( format, args ) );
} }
public void BeginBroadcast( Mobile from ) public void BeginBroadcast( Mobile from )

View file

@ -66,9 +66,9 @@ namespace Server.Factions
AddRadio( x, y, 208, 209, ( town.Tax == ofs ), i+1 ); AddRadio( x, y, 208, 209, ( town.Tax == ofs ), i+1 );
if ( ofs < 0 ) if ( ofs < 0 )
AddLabel( x + 35, y, 0x26, String.Concat( "- ", -ofs, "%" ) ); AddLabel( x + 35, y, 0x26, string.Concat( "- ", -ofs, "%" ) );
else else
AddLabel( x + 35, y, 0x12A, String.Concat( "+ ", ofs, "%" ) ); AddLabel( x + 35, y, 0x12A, string.Concat( "+ ", ofs, "%" ) );
} }
AddRadio( 20, 270, 208, 209, ( town.Tax == 0 ), 0 ); AddRadio( 20, 270, 208, 209, ( town.Tax == 0 ), 0 );

View file

@ -252,7 +252,7 @@ namespace Server.Factions
{ {
if ( m_Faction != null && Map == Faction.Facet ) if ( m_Faction != null && Map == Faction.Facet )
{ {
string text = String.Concat( "(Guard, ", m_Faction.Definition.FriendlyName, ")" ); string text = string.Concat( "(Guard, ", m_Faction.Definition.FriendlyName, ")" );
int hue = ( Faction.Find( from ) == m_Faction ? 98 : 38 ); int hue = ( Faction.Find( from ) == m_Faction ? 98 : 38 );

View file

@ -372,10 +372,10 @@ namespace Server.Engines.MLQuests
foreach ( Item rewardItem in rewards ) foreach ( Item rewardItem in rewards )
{ {
string rewardName = ( rewardItem.Name != null ) ? rewardItem.Name : String.Concat( "#", rewardItem.LabelNumber ); string rewardName = ( rewardItem.Name != null ) ? rewardItem.Name : string.Concat( "#", rewardItem.LabelNumber );
if ( rewardItem.Stackable ) if ( rewardItem.Stackable )
m_Player.SendLocalizedMessage( 1115917, String.Concat( rewardItem.Amount, "\t", rewardName ) ); // You receive a reward: ~1_QUANTITY~ ~2_ITEM~ m_Player.SendLocalizedMessage( 1115917, string.Concat( rewardItem.Amount, "\t", rewardName ) ); // You receive a reward: ~1_QUANTITY~ ~2_ITEM~
else else
m_Player.SendLocalizedMessage( 1074360, rewardName ); // You receive a reward: ~1_REWARD~ m_Player.SendLocalizedMessage( 1074360, rewardName ); // You receive a reward: ~1_REWARD~
} }

View file

@ -293,7 +293,7 @@ namespace Server.Engines.MyRunUO
public void ExecuteNonQuery( string format, params string[] args ) public void ExecuteNonQuery( string format, params string[] args )
{ {
ExecuteNonQuery( String.Format( format, args ) ); ExecuteNonQuery( string.Format( format, args ) );
} }
public void ExecuteNonQueryIfNull( string select, string insert ) public void ExecuteNonQueryIfNull( string select, string insert )
@ -638,7 +638,7 @@ namespace Server.Engines.MyRunUO
string theirId = them.Id.ToString(); string theirId = them.Id.ToString();
ExecuteNonQueryIfNull( ExecuteNonQueryIfNull(
String.Format( "SELECT guild_1 FROM myrunuo_guilds_wars WHERE (guild_1={0} AND guild_2={1}) OR (guild_1={1} AND guild_2={0})", ourId, theirId ), string.Format( "SELECT guild_1 FROM myrunuo_guilds_wars WHERE (guild_1={0} AND guild_2={1}) OR (guild_1={1} AND guild_2={0})", ourId, theirId ),
$"INSERT INTO myrunuo_guilds_wars (guild_1, guild_2) VALUES ({ourId}, {theirId})"); $"INSERT INTO myrunuo_guilds_wars (guild_1, guild_2) VALUES ({ourId}, {theirId})");
} }
} }

View file

@ -379,7 +379,7 @@ namespace Server.Engines.PartySystem
} }
private void SendToStaffMessage( Mobile from, string format, params object[] args ) private void SendToStaffMessage( Mobile from, string format, params object[] args )
{ {
SendToStaffMessage( from, String.Format( format, args ) ); SendToStaffMessage( from, string.Format( format, args ) );
} }
public void SendToAll( Packet p ) public void SendToAll( Packet p )

View file

@ -35,7 +35,7 @@ namespace Server.RemoteAdmin
try try
{ {
m_Output = new StreamWriter( Path.Combine( directory, String.Format( LogSubDirectory + "{0}.log", DateTime.UtcNow.ToString( "yyyyMMdd" ) ) ), true ); m_Output = new StreamWriter( Path.Combine( directory, string.Format( LogSubDirectory + "{0}.log", DateTime.UtcNow.ToString( "yyyyMMdd" ) ) ), true );
m_Output.AutoFlush = true; m_Output.AutoFlush = true;
@ -66,7 +66,7 @@ namespace Server.RemoteAdmin
for ( int i = 0; i < args.Length; i++ ) for ( int i = 0; i < args.Length; i++ )
args[i] = Commands.CommandLogging.Format( args[i] ); args[i] = Commands.CommandLogging.Format( args[i] );
WriteLine( state, String.Format( format, args ) ); WriteLine( state, string.Format( format, args ) );
} }
public static void WriteLine( NetState state, string text ) public static void WriteLine( NetState state, string text )

View file

@ -83,7 +83,7 @@ namespace Server.Engines.Reports
- GetPageCount( this is StaffInfo ? PageResolution.Handled : PageResolution.None, DateTime.UtcNow - m_SortRange, DateTime.UtcNow ); - GetPageCount( this is StaffInfo ? PageResolution.Handled : PageResolution.None, DateTime.UtcNow - m_SortRange, DateTime.UtcNow );
if ( v == 0 ) if ( v == 0 )
v = String.Compare( Display, cmp.Display ); v = string.Compare( Display, cmp.Display );
return v; return v;
} }

View file

@ -436,7 +436,7 @@ namespace Server.Mobiles
string[] paramargs; string[] paramargs;
string[] propargs; string[] propargs;
if ( String.IsNullOrEmpty( entry.Properties ) ) if ( string.IsNullOrEmpty( entry.Properties ) )
propargs = new string[0]; propargs = new string[0];
else else
propargs = CommandSystem.Split( entry.Properties.Trim() ); propargs = CommandSystem.Split( entry.Properties.Trim() );
@ -451,7 +451,7 @@ namespace Server.Mobiles
return false; return false;
} }
if ( String.IsNullOrEmpty( entry.Parameters ) ) if ( string.IsNullOrEmpty( entry.Parameters ) )
paramargs = new string[0]; paramargs = new string[0];
else else
paramargs = entry.Parameters.Trim().Split( ' ' ); paramargs = entry.Parameters.Trim().Split( ' ' );
@ -872,7 +872,7 @@ namespace Server.Mobiles
for ( int i = 0; i < size; ++i ) for ( int i = 0; i < size; ++i )
if ( addentries ) if ( addentries )
m_Entries.Add( new SpawnerEntry( String.Empty, 100, reader.ReadInt() ) ); m_Entries.Add( new SpawnerEntry( string.Empty, 100, reader.ReadInt() ) );
else else
m_Entries[i].SpawnedMaxCount = reader.ReadInt(); m_Entries[i].SpawnedMaxCount = reader.ReadInt();
@ -886,7 +886,7 @@ namespace Server.Mobiles
for ( int i = 0; i < size; ++i ) for ( int i = 0; i < size; ++i )
if ( addentries ) if ( addentries )
m_Entries.Add( new SpawnerEntry( String.Empty, reader.ReadInt(), 1 ) ); m_Entries.Add( new SpawnerEntry( string.Empty, reader.ReadInt(), 1 ) );
else else
m_Entries[i].SpawnedProbability = reader.ReadInt(); m_Entries[i].SpawnedProbability = reader.ReadInt();

View file

@ -119,7 +119,7 @@ namespace Server.Engines.VeteranRewards
{ {
TimeSpan totalTime = (DateTime.UtcNow - acct.Created); TimeSpan totalTime = (DateTime.UtcNow - acct.Created);
Double level = (totalTime.TotalDays / RewardInterval.TotalDays); double level = (totalTime.TotalDays / RewardInterval.TotalDays);
return level >= 0.5; return level >= 0.5;
} }
@ -163,7 +163,7 @@ namespace Server.Engines.VeteranRewards
string tag = acct.GetTag( "numRewardsChosen" ); string tag = acct.GetTag( "numRewardsChosen" );
if ( String.IsNullOrEmpty( tag ) ) if ( string.IsNullOrEmpty( tag ) )
cur = 0; cur = 0;
else else
cur = Utility.ToInt32( tag ); cur = Utility.ToInt32( tag );

View file

@ -2323,7 +2323,7 @@ namespace Server.Gumps
break; break;
if ( rads.Count > 0 ) if ( rads.Count > 0 )
from.SendGump( new WarningGump( 1060635, 30720, String.Format( "You are about to <em><basefont color=red>permanently delete</basefont></em> {0} marked account{1}. Likewise, all characters on the account{1} will be deleted, including equipped, inventory, and banked items. Any houses tied to the account{1} will be demolished.<br><br>Do you wish to continue?", rads.Count, rads.Count == 1 ? "" : "s" ), 0xFFC000, 420, 280, new WarningGumpCallback( Marked_Callback ), new object[]{ false, list, rads, m_ListPage } ) ); from.SendGump( new WarningGump( 1060635, 30720, string.Format( "You are about to <em><basefont color=red>permanently delete</basefont></em> {0} marked account{1}. Likewise, all characters on the account{1} will be deleted, including equipped, inventory, and banked items. Any houses tied to the account{1} will be demolished.<br><br>Do you wish to continue?", rads.Count, rads.Count == 1 ? "" : "s" ), 0xFFC000, 420, 280, new WarningGumpCallback( Marked_Callback ), new object[]{ false, list, rads, m_ListPage } ) );
else else
from.SendGump( new NoticeGump( 1060637, 30720, "You have not yet marked any accounts. Place a check mark next to the accounts you wish to ban and then try again.", 0xFFC000, 420, 280, new NoticeGumpCallback( ResendGump_Callback ), new object[]{ list, rads, m_ListPage } ) ); from.SendGump( new NoticeGump( 1060637, 30720, "You have not yet marked any accounts. Place a check mark next to the accounts you wish to ban and then try again.", 0xFFC000, 420, 280, new NoticeGumpCallback( ResendGump_Callback ), new object[]{ list, rads, m_ListPage } ) );

View file

@ -60,7 +60,7 @@ namespace Server.Guilds
string s = guild.Charter; string s = guild.Charter;
if ( String.IsNullOrEmpty( s ) ) if ( string.IsNullOrEmpty( s ) )
s = "The guild leader has not yet set the guild charter."; s = "The guild leader has not yet set the guild charter.";
AddHtml( 65, 216, 480, 80, s, true, true ); AddHtml( 65, 216, 480, 80, s, true, true );

View file

@ -22,7 +22,7 @@ namespace Server.Gumps
AddHtmlLocalized( 125, 20, 250, 24, 1019070, false, false ); // You have agreed to purchase: AddHtmlLocalized( 125, 20, 250, 24, 1019070, false, false ); // You have agreed to purchase:
if ( !String.IsNullOrEmpty( vi.Description ) ) if ( !string.IsNullOrEmpty( vi.Description ) )
AddLabel( 125, 45, 0, vi.Description ); AddLabel( 125, 45, 0, vi.Description );
else else
AddHtmlLocalized( 125, 45, 250, 24, 1019072, false, false ); // an item without a description AddHtmlLocalized( 125, 45, 250, 24, 1019072, false, false ); // an item without a description

View file

@ -406,8 +406,8 @@ namespace Server.Gumps
private static Type typeofTimeSpan = typeof( TimeSpan ); private static Type typeofTimeSpan = typeof( TimeSpan );
private static Type typeofCustomEnum = typeof( CustomEnumAttribute ); private static Type typeofCustomEnum = typeof( CustomEnumAttribute );
private static Type typeofEnum = typeof( Enum ); private static Type typeofEnum = typeof( Enum );
private static Type typeofBool = typeof( Boolean ); private static Type typeofBool = typeof( bool );
private static Type typeofString = typeof( String ); private static Type typeofString = typeof( string );
private static Type typeofText = typeof( TextDefinition ); private static Type typeofText = typeof( TextDefinition );
private static Type typeofPoison = typeof( Poison ); private static Type typeofPoison = typeof( Poison );
private static Type typeofMap = typeof( Map ); private static Type typeofMap = typeof( Map );
@ -416,19 +416,19 @@ namespace Server.Gumps
private static Type typeofNoSort = typeof( NoSortAttribute ); private static Type typeofNoSort = typeof( NoSortAttribute );
private static Type[] typeofReal = { private static Type[] typeofReal = {
typeof( Single ), typeof( float ),
typeof( Double ) typeof( double )
}; };
private static Type[] typeofNumeric = { private static Type[] typeofNumeric = {
typeof( Byte ), typeof( byte ),
typeof( Int16 ), typeof( short ),
typeof( Int32 ), typeof( int ),
typeof( Int64 ), typeof( long ),
typeof( SByte ), typeof( sbyte ),
typeof( UInt16 ), typeof( ushort ),
typeof( UInt32 ), typeof( uint ),
typeof( UInt64 ) typeof( ulong )
}; };
private string ValueToString( PropertyInfo prop ) private string ValueToString( PropertyInfo prop )
@ -484,7 +484,7 @@ namespace Server.Gumps
} }
if ( o is byte || o is sbyte || o is short || o is ushort || o is int || o is uint || o is long || o is ulong ) if ( o is byte || o is sbyte || o is short || o is ushort || o is int || o is uint || o is long || o is ulong )
{ {
return String.Format( "{0} (0x{0:X})", o ); return string.Format( "{0} (0x{0:X})", o );
} }
if ( o is Mobile mobile ) if ( o is Mobile mobile )
{ {
@ -668,7 +668,7 @@ namespace Server.Gumps
} }
if ( o is byte || o is sbyte || o is short || o is ushort || o is int || o is uint || o is long || o is ulong ) if ( o is byte || o is sbyte || o is short || o is ushort || o is int || o is uint || o is long || o is ulong )
{ {
return String.Format( "{0} (0x{0:X})", o ); return string.Format( "{0} (0x{0:X})", o );
} }
if ( o is Mobile mobile ) if ( o is Mobile mobile )
{ {
@ -722,7 +722,7 @@ namespace Server.Gumps
m_Start = start; m_Start = start;
} }
private static Type typeofObject = typeof( Object ); private static Type typeofObject = typeof( object );
private int GetDistance( Type type ) private int GetDistance( Type type )
{ {

View file

@ -140,7 +140,7 @@ namespace Server.Engines.Events
public class PlayerBones : BaseContainer public class PlayerBones : BaseContainer
{ {
[Constructible] [Constructible]
public PlayerBones( String name ) public PlayerBones( string name )
: base( Utility.RandomMinMax( 0x0ECA, 0x0ED2 ) ) : base( Utility.RandomMinMax( 0x0ECA, 0x0ED2 ) )
{ {
Name = $"{name}'s bones"; Name = $"{name}'s bones";

View file

@ -119,7 +119,7 @@ namespace Server.Items
{ {
string line = box.Topic[i]; string line = box.Topic[i];
if ( !String.IsNullOrEmpty( line ) ) if ( !string.IsNullOrEmpty( line ) )
AddLabelCropped( 30, 90 + i * 20, 340, 20, 0x3E3, line ); AddLabelCropped( 30, 90 + i * 20, 340, 20, 0x3E3, line );
} }

View file

@ -31,7 +31,7 @@ namespace Server.Items
{ {
base.OnSingleClick( from ); base.OnSingleClick( from );
if ( !String.IsNullOrEmpty( m_Subtext ) ) if ( !string.IsNullOrEmpty( m_Subtext ) )
LabelTo( from, m_Subtext ); LabelTo( from, m_Subtext );
} }
@ -39,7 +39,7 @@ namespace Server.Items
{ {
base.AddNameProperties( list ); base.AddNameProperties( list );
if ( !String.IsNullOrEmpty( m_Subtext ) ) if ( !string.IsNullOrEmpty( m_Subtext ) )
list.Add( m_Subtext ); list.Add( m_Subtext );
} }

View file

@ -157,7 +157,7 @@ namespace Server.Items
1041361, 1041361,
"", "",
AffixType.Append, AffixType.Append,
String.Concat(" ", m_Worth.ToString()), string.Concat(" ", m_Worth.ToString()),
"")); // A bank check: "")); // A bank check:
} }

View file

@ -539,7 +539,7 @@ namespace Server.Items
public string SafeString( string v ) public string SafeString( string v )
{ {
if ( v == null ) if ( v == null )
return String.Empty; return string.Empty;
return v; return v;
} }
@ -618,7 +618,7 @@ namespace Server.Items
public string SafeString( string v ) public string SafeString( string v )
{ {
if ( v == null ) if ( v == null )
return String.Empty; return string.Empty;
return v; return v;
} }

View file

@ -216,7 +216,7 @@ namespace Server.Items
else if ( m_TargetMap == Map.Trammel ) else if ( m_TargetMap == Map.Trammel )
list.Add( (House != null ? 1062453 : 1060806), RuneFormat, desc ); // ~1_val~ (Trammel)[(House)] list.Add( (House != null ? 1062453 : 1060806), RuneFormat, desc ); // ~1_val~ (Trammel)[(House)]
else else
list.Add( (House != null ? "{0} ({1})(House)" : "{0} ({1})"), String.Format( RuneFormat, desc ), m_TargetMap ); list.Add( (House != null ? "{0} ({1})(House)" : "{0} ({1})"), string.Format( RuneFormat, desc ), m_TargetMap );
} }
} }
@ -230,15 +230,15 @@ namespace Server.Items
desc = "an unknown location"; desc = "an unknown location";
if ( m_TargetMap == Map.Tokuno ) if ( m_TargetMap == Map.Tokuno )
LabelTo( from, (House != null ? 1063260 : 1063259), String.Format( RuneFormat, desc ) ); // ~1_val~ (Tokuno Islands)[(House)] LabelTo( from, (House != null ? 1063260 : 1063259), string.Format( RuneFormat, desc ) ); // ~1_val~ (Tokuno Islands)[(House)]
else if ( m_TargetMap == Map.Malas ) else if ( m_TargetMap == Map.Malas )
LabelTo( from, (House != null ? 1062454 : 1060804), String.Format( RuneFormat, desc ) ); // ~1_val~ (Malas)[(House)] LabelTo( from, (House != null ? 1062454 : 1060804), string.Format( RuneFormat, desc ) ); // ~1_val~ (Malas)[(House)]
else if ( m_TargetMap == Map.Felucca ) else if ( m_TargetMap == Map.Felucca )
LabelTo( from, (House != null ? 1062452 : 1060805), String.Format( RuneFormat, desc ) ); // ~1_val~ (Felucca)[(House)] LabelTo( from, (House != null ? 1062452 : 1060805), string.Format( RuneFormat, desc ) ); // ~1_val~ (Felucca)[(House)]
else if ( m_TargetMap == Map.Trammel ) else if ( m_TargetMap == Map.Trammel )
LabelTo( from, (House != null ? 1062453 : 1060806), String.Format( RuneFormat, desc ) ); // ~1_val~ (Trammel)[(House)] LabelTo( from, (House != null ? 1062453 : 1060806), string.Format( RuneFormat, desc ) ); // ~1_val~ (Trammel)[(House)]
else else
LabelTo( from, (House != null ? "{0} ({1})(House)" : "{0} ({1})"), String.Format( RuneFormat, desc ), m_TargetMap ); LabelTo( from, (House != null ? "{0} ({1})(House)" : "{0} ({1})"), string.Format( RuneFormat, desc ), m_TargetMap );
} }
else else
{ {

View file

@ -176,7 +176,7 @@ namespace Server.Items
private static string FormatDescription( HouseRaffleDeed deed ) private static string FormatDescription( HouseRaffleDeed deed )
{ {
if ( deed == null ) if ( deed == null )
return String.Empty; return string.Empty;
if ( deed.IsExpired ) if ( deed.IsExpired )
{ {

View file

@ -32,7 +32,7 @@ namespace Server.Items
*level in that skill by the amount of points displayed on the scroll. *level in that skill by the amount of points displayed on the scroll.
*As you may not gain skills beyond your maximum skill cap, any excess points will be lost.*/ *As you may not gain skills beyond your maximum skill cap, any excess points will be lost.*/
public override string DefaultTitle => String.Format( "<basefont color=#FFFFFF>Scroll of Alacrity:</basefont>" ); public override string DefaultTitle => string.Format( "<basefont color=#FFFFFF>Scroll of Alacrity:</basefont>" );
public ScrollofAlacrity() : this( SkillName.Alchemy ) public ScrollofAlacrity() : this( SkillName.Alchemy )
{ {

View file

@ -50,7 +50,7 @@ namespace Server.Items
public virtual string GetNameLocalized() public virtual string GetNameLocalized()
{ {
return String.Concat( "#", AosSkillBonuses.GetLabel( m_Skill ).ToString() ); return string.Concat( "#", AosSkillBonuses.GetLabel( m_Skill ).ToString() );
} }
public virtual string GetName() public virtual string GetName()

View file

@ -248,7 +248,7 @@ namespace Server.Items
if ( relay != null ) if ( relay != null )
{ {
if ( String.IsNullOrEmpty( relay.Text ) ) if ( string.IsNullOrEmpty( relay.Text ) )
{ {
m_Target.EngravedText = null; m_Target.EngravedText = null;
state.Mobile.SendLocalizedMessage( 1072362 ); // You remove the engraving from the object. state.Mobile.SendLocalizedMessage( 1072362 ); // You remove the engraving from the object.

View file

@ -383,7 +383,7 @@ namespace Server.Items
if (Blessed) if (Blessed)
{ {
if (BlessedFor != null) if (BlessedFor != null)
list.Add(1072304, !String.IsNullOrEmpty(BlessedFor.Name) ? BlessedFor.Name : "Unnamed Warrior"); // Owned by ~1_name~ list.Add(1072304, !string.IsNullOrEmpty(BlessedFor.Name) ? BlessedFor.Name : "Unnamed Warrior"); // Owned by ~1_name~
else else
list.Add(1072304, "Nobody"); // Owned by ~1_name~ list.Add(1072304, "Nobody"); // Owned by ~1_name~
} }

View file

@ -2425,7 +2425,7 @@ namespace Server.Items
SetSaveFlag( ref flags, SaveFlag.SkillBonuses, !m_AosSkillBonuses.IsEmpty ); SetSaveFlag( ref flags, SaveFlag.SkillBonuses, !m_AosSkillBonuses.IsEmpty );
SetSaveFlag( ref flags, SaveFlag.Slayer2, m_Slayer2 != SlayerName.None ); SetSaveFlag( ref flags, SaveFlag.Slayer2, m_Slayer2 != SlayerName.None );
SetSaveFlag( ref flags, SaveFlag.ElementalDamages, !m_AosElementDamages.IsEmpty ); SetSaveFlag( ref flags, SaveFlag.ElementalDamages, !m_AosElementDamages.IsEmpty );
SetSaveFlag( ref flags, SaveFlag.EngravedText, !String.IsNullOrEmpty( m_EngravedText ) ); SetSaveFlag( ref flags, SaveFlag.EngravedText, !string.IsNullOrEmpty( m_EngravedText ) );
writer.Write( (int) flags ); writer.Write( (int) flags );
@ -3007,7 +3007,7 @@ namespace Server.Items
* method and engraving tool, to make it perm cleaned up. * method and engraving tool, to make it perm cleaned up.
*/ */
if ( !String.IsNullOrEmpty( m_EngravedText ) ) if ( !string.IsNullOrEmpty( m_EngravedText ) )
list.Add( 1062613, m_EngravedText ); list.Add( 1062613, m_EngravedText );
/* list.Add( 1062613, Utility.FixHtml( m_EngravedText ) ); */ /* list.Add( 1062613, Utility.FixHtml( m_EngravedText ) ); */

View file

@ -27,8 +27,8 @@ namespace Server.Misc
if ( !CheckAggressions( aggressor, aggressed ) ) if ( !CheckAggressions( aggressor, aggressed ) )
{ {
aggressor.LocalOverheadMessage( MessageType.Regular, Hue, true, String.Format( AggressorFormat, aggressed.Name ) ); aggressor.LocalOverheadMessage( MessageType.Regular, Hue, true, string.Format( AggressorFormat, aggressed.Name ) );
aggressed.LocalOverheadMessage( MessageType.Regular, Hue, true, String.Format( AggressedFormat, aggressor.Name ) ); aggressed.LocalOverheadMessage( MessageType.Regular, Hue, true, string.Format( AggressedFormat, aggressor.Name ) );
} }
} }

View file

@ -214,9 +214,9 @@ namespace Server.Misc
cont.Hue = 0x480; cont.Hue = 0x480;
cont.Name = "Spell Casting Stuff"; cont.Name = "Spell Casting Stuff";
PlaceItemIn( cont, 45, 105, new Spellbook( UInt64.MaxValue ) ); PlaceItemIn( cont, 45, 105, new Spellbook( ulong.MaxValue ) );
PlaceItemIn( cont, 65, 105, new NecromancerSpellbook( (UInt64)0xFFFF ) ); PlaceItemIn( cont, 65, 105, new NecromancerSpellbook( (ulong)0xFFFF ) );
PlaceItemIn( cont, 85, 105, new BookOfChivalry( (UInt64)0x3FF ) ); PlaceItemIn( cont, 85, 105, new BookOfChivalry( (ulong)0x3FF ) );
PlaceItemIn( cont, 105, 105, new BookOfBushido() ); //Default ctor = full PlaceItemIn( cont, 105, 105, new BookOfBushido() ); //Default ctor = full
PlaceItemIn( cont, 125, 105, new BookOfNinjitsu() ); //Default ctor = full PlaceItemIn( cont, 125, 105, new BookOfNinjitsu() ); //Default ctor = full

View file

@ -131,7 +131,7 @@ namespace Server.Misc
string root = GetRoot(); string root = GetRoot();
string rootBackup = Combine( root, $"Backups/Crashed/{timeStamp}/"); string rootBackup = Combine( root, $"Backups/Crashed/{timeStamp}/");
string rootOrigin = Combine( root, String.Format( "Saves/" ) ); string rootOrigin = Combine( root, string.Format( "Saves/" ) );
// Create new directories // Create new directories
CreateDirectory( rootBackup ); CreateDirectory( rootBackup );

View file

@ -76,14 +76,14 @@ namespace Server.Misc
else else
keyString = @"SOFTWARE\{0}"; keyString = @"SOFTWARE\{0}";
using( RegistryKey key = Registry.LocalMachine.OpenSubKey( String.Format( keyString, subName ) ) ) using( RegistryKey key = Registry.LocalMachine.OpenSubKey( string.Format( keyString, subName ) ) )
{ {
if ( key == null ) if ( key == null )
return null; return null;
string v = key.GetValue( keyName ) as string; string v = key.GetValue( keyName ) as string;
if ( String.IsNullOrEmpty( v ) ) if ( string.IsNullOrEmpty( v ) )
return null; return null;
if ( keyName == "InstallDir" ) if ( keyName == "InstallDir" )
@ -91,7 +91,7 @@ namespace Server.Misc
v = Path.GetDirectoryName( v ); v = Path.GetDirectoryName( v );
if ( String.IsNullOrEmpty( v ) ) if ( string.IsNullOrEmpty( v ) )
return null; return null;
return v; return v;

View file

@ -97,7 +97,7 @@ namespace Server.Items
} }
if ( m_Dipper != null ) if ( m_Dipper != null )
m_Dipper = String.Intern( m_Dipper ); m_Dipper = string.Intern( m_Dipper );
} }
} }
} }

View file

@ -283,7 +283,7 @@ namespace Server.Guilds
#region Alliance[Text]Message(...) #region Alliance[Text]Message(...)
public void AllianceMessage( int num, bool append, string format, params object[] args ) public void AllianceMessage( int num, bool append, string format, params object[] args )
{ {
AllianceMessage( num, append, String.Format( format, args) ); AllianceMessage( num, append, string.Format( format, args) );
} }
public void AllianceMessage( int number ) public void AllianceMessage( int number )
{ {
@ -319,7 +319,7 @@ namespace Server.Guilds
} }
public void AllianceTextMessage( string format, params object[] args ) public void AllianceTextMessage( string format, params object[] args )
{ {
AllianceTextMessage( 0x3B2, String.Format( format, args ) ); AllianceTextMessage( 0x3B2, string.Format( format, args ) );
} }
public void AllianceTextMessage( int hue, string text ) public void AllianceTextMessage( int hue, string text )
{ {
@ -328,7 +328,7 @@ namespace Server.Guilds
} }
public void AllianceTextMessage( int hue, string format, params object[] args ) public void AllianceTextMessage( int hue, string format, params object[] args )
{ {
AllianceTextMessage( hue, String.Format( format, args ) ); AllianceTextMessage( hue, string.Format( format, args ) );
} }
public void AllianceChat( Mobile from, int hue, string text ) public void AllianceChat( Mobile from, int hue, string text )
@ -1400,7 +1400,7 @@ namespace Server.Guilds
#region Guild[Text]Message(...) #region Guild[Text]Message(...)
public void GuildMessage( int num, bool append, string format, params object[] args ) public void GuildMessage( int num, bool append, string format, params object[] args )
{ {
GuildMessage( num, append, String.Format( format, args) ); GuildMessage( num, append, string.Format( format, args) );
} }
public void GuildMessage( int number ) public void GuildMessage( int number )
{ {
@ -1426,7 +1426,7 @@ namespace Server.Guilds
} }
public void GuildTextMessage( string format, params object[] args ) public void GuildTextMessage( string format, params object[] args )
{ {
GuildTextMessage( 0x3B2, String.Format( format, args ) ); GuildTextMessage( 0x3B2, string.Format( format, args ) );
} }
public void GuildTextMessage( int hue, string text ) public void GuildTextMessage( int hue, string text )
{ {
@ -1435,7 +1435,7 @@ namespace Server.Guilds
} }
public void GuildTextMessage( int hue, string format, params object[] args ) public void GuildTextMessage( int hue, string format, params object[] args )
{ {
GuildTextMessage( hue, String.Format( format, args ) ); GuildTextMessage( hue, string.Format( format, args ) );
} }
public void GuildChat( Mobile from, int hue, string text ) public void GuildChat( Mobile from, int hue, string text )

View file

@ -339,7 +339,7 @@ namespace Server.Misc
for ( int i = 0; i < syllableCount; ++i ) for ( int i = 0; i < syllableCount; ++i )
syllables[i] = GetRandomSyllable(); syllables[i] = GetRandomSyllable();
return String.Concat( syllables ); return string.Concat( syllables );
} }
public string ConstructSentance( int wordCount ) public string ConstructSentance( int wordCount )
@ -381,7 +381,7 @@ namespace Server.Misc
sentance.Append( word ); sentance.Append( word );
if ( needUpperCase ) if ( needUpperCase )
sentance.Replace( word[0], Char.ToUpper( word[0] ), sentance.Length - word.Length, 1 ); sentance.Replace( word[0], char.ToUpper( word[0] ), sentance.Length - word.Length, 1 );
needUpperCase = false; needUpperCase = false;
} }
@ -462,33 +462,33 @@ namespace Server.Misc
case 1: case 1:
{ {
response.Append( responseWord ).Append( " thee!" ); response.Append( responseWord ).Append( " thee!" );
response.Replace( responseWord[0], Char.ToUpper( responseWord[0] ), 0, 1 ); response.Replace( responseWord[0], char.ToUpper( responseWord[0] ), 0, 1 );
break; break;
} }
case 2: case 2:
{ {
response.Append( responseWord ).Append( '?' ); response.Append( responseWord ).Append( '?' );
response.Replace( responseWord[0], Char.ToUpper( responseWord[0] ), 0, 1 ); response.Replace( responseWord[0], char.ToUpper( responseWord[0] ), 0, 1 );
break; break;
} }
case 3: case 3:
{ {
response.Append( responseWord ).Append( "! " ).Append( secondResponseWord ).Append( '.' ); response.Append( responseWord ).Append( "! " ).Append( secondResponseWord ).Append( '.' );
response.Replace( responseWord[0], Char.ToUpper( responseWord[0] ), 0, 1 ); response.Replace( responseWord[0], char.ToUpper( responseWord[0] ), 0, 1 );
response.Replace( secondResponseWord[0], Char.ToUpper( secondResponseWord[0] ), responseWord.Length + 2, 1 ); response.Replace( secondResponseWord[0], char.ToUpper( secondResponseWord[0] ), responseWord.Length + 2, 1 );
break; break;
} }
case 4: case 4:
{ {
response.Append( responseWord ).Append( '.' ); response.Append( responseWord ).Append( '.' );
response.Replace( responseWord[0], Char.ToUpper( responseWord[0] ), 0, 1 ); response.Replace( responseWord[0], char.ToUpper( responseWord[0] ), 0, 1 );
break; break;
} }
case 5: case 5:
{ {
response.Append( responseWord ).Append( "? " ).Append( secondResponseWord ).Append( '.' ); response.Append( responseWord ).Append( "? " ).Append( secondResponseWord ).Append( '.' );
response.Replace( responseWord[0], Char.ToUpper( responseWord[0] ), 0, 1 ); response.Replace( responseWord[0], char.ToUpper( responseWord[0] ), 0, 1 );
response.Replace( secondResponseWord[0], Char.ToUpper( secondResponseWord[0] ), responseWord.Length + 2, 1 ); response.Replace( secondResponseWord[0], char.ToUpper( secondResponseWord[0] ), responseWord.Length + 2, 1 );
break; break;
} }
} }

View file

@ -88,7 +88,7 @@ namespace Server
{ {
string type = element.GetAttribute( "type" ); string type = element.GetAttribute( "type" );
if ( String.IsNullOrEmpty( type ) ) if ( string.IsNullOrEmpty( type ) )
continue; continue;
try try

View file

@ -84,7 +84,7 @@ namespace Server.Misc
{ {
if ( value >= 1.0 ) if ( value >= 1.0 )
{ {
op = String.Format( format, (int)value, (int)value != 1 ? "s" : "" ); op = string.Format( format, (int)value, (int)value != 1 ? "s" : "" );
return true; return true;
} }

View file

@ -650,7 +650,7 @@ namespace Server.Items
{ {
CraftResourceInfo info = GetInfo( resource ); CraftResourceInfo info = GetInfo( resource );
return ( info == null ? String.Empty : info.Name ); return ( info == null ? string.Empty : info.Name );
} }
/// <summary> /// <summary>

View file

@ -488,7 +488,7 @@ namespace Server.Misc
{ {
double perc = option.Votes / (double)totalVotes; double perc = option.Votes / (double)totalVotes;
text = String.Format( "[{1}: {2}%] {0}", text, option.Votes, (int)(perc*100) ); text = string.Format( "[{1}: {2}%] {0}", text, option.Votes, (int)(perc*100) );
} }
int optHeight = option.ComputeHeight(); int optHeight = option.ComputeHeight();
@ -600,7 +600,7 @@ namespace Server.Misc
} }
else if ( m.Groups[2].Success ) else if ( m.Groups[2].Success )
{ {
return String.Format( "<a href=\"{0}\">{0}</a>", m.Groups[2].Value ); return string.Format( "<a href=\"{0}\">{0}</a>", m.Groups[2].Value );
} }
return m.Value; return m.Value;

View file

@ -37,7 +37,7 @@ namespace Server
public override string ToString() public override string ToString()
{ {
if ( m_Number > 0 ) if ( m_Number > 0 )
return String.Concat( "#", m_Number.ToString() ); return string.Concat( "#", m_Number.ToString() );
else if ( m_String != null ) else if ( m_String != null )
return m_String; return m_String;
@ -47,7 +47,7 @@ namespace Server
public string Format( bool propsGump ) public string Format( bool propsGump )
{ {
if ( m_Number > 0 ) if ( m_Number > 0 )
return String.Format( "{0} (0x{0:X})", m_Number ); return string.Format( "{0} (0x{0:X})", m_Number );
else if ( m_String != null ) else if ( m_String != null )
return $"\"{m_String}\""; return $"\"{m_String}\"";

View file

@ -236,7 +236,7 @@ namespace Server.Misc
if ( mob.Female && skillTitle.EndsWith( "man" ) ) if ( mob.Female && skillTitle.EndsWith( "man" ) )
skillTitle = skillTitle.Substring( 0, skillTitle.Length - 3 ) + "woman"; skillTitle = skillTitle.Substring( 0, skillTitle.Length - 3 ) + "woman";
return String.Concat( skillLevel, " ", skillTitle ); return string.Concat( skillLevel, " ", skillTitle );
} }
return null; return null;

View file

@ -17,7 +17,7 @@ namespace Server.Misc
private static HttpListener _Listener; private static HttpListener _Listener;
private static string _StatusPage = String.Empty; private static string _StatusPage = string.Empty;
private static byte[] _StatusBuffer = new byte[0]; private static byte[] _StatusBuffer = new byte[0];
private static readonly object _StatusLock = new object(); private static readonly object _StatusLock = new object();
@ -144,7 +144,7 @@ namespace Server.Misc
var title = m.GuildTitle; var title = m.GuildTitle;
title = title != null ? title.Trim() : String.Empty; title = title != null ? title.Trim() : string.Empty;
if (title.Length > 0) if (title.Length > 0)
{ {

View file

@ -1022,7 +1022,7 @@ namespace Server.Mobiles
if ( suffix.Length == 0 ) if ( suffix.Length == 0 )
suffix = "(Paragon)"; suffix = "(Paragon)";
else else
suffix = String.Concat( suffix, " (Paragon)" ); suffix = string.Concat( suffix, " (Paragon)" );
} }
return base.ApplyNameSuffix( suffix ); return base.ApplyNameSuffix( suffix );
@ -2796,7 +2796,7 @@ namespace Server.Mobiles
public void DebugSay( string format, params object[] args ) public void DebugSay( string format, params object[] args )
{ {
if ( m_DebugAI ) if ( m_DebugAI )
PublicOverheadMessage( MessageType.Regular, 41, false, String.Format( format, args ) ); PublicOverheadMessage( MessageType.Regular, 41, false, string.Format( format, args ) );
} }
/* /*

View file

@ -75,7 +75,7 @@ namespace Server.Mobiles
"{0}!! You will pay for that!" "{0}!! You will pay for that!"
}; };
Say( true, String.Format( toSay[Utility.Random( toSay.Length )], from.Name ) ); Say( true, string.Format( toSay[Utility.Random( toSay.Length )], from.Name ) );
} }
base.OnDamage( amount, from, willKill ); base.OnDamage( amount, from, willKill );

View file

@ -3081,7 +3081,7 @@ namespace Server.Mobiles
private static void SendToStaffMessage( Mobile from, string format, params object[] args ) private static void SendToStaffMessage( Mobile from, string format, params object[] args )
{ {
SendToStaffMessage( from, String.Format( format, args ) ); SendToStaffMessage( from, string.Format( format, args ) );
} }
public override void Damage( int amount, Mobile from ) public override void Damage( int amount, Mobile from )
@ -3839,19 +3839,19 @@ namespace Server.Mobiles
Faction faction = pl.Faction; Faction faction = pl.Faction;
if ( faction.Commander == this ) if ( faction.Commander == this )
text = String.Concat( Female ? "(Commanding Lady of the " : "(Commanding Lord of the ", faction.Definition.FriendlyName, ")" ); text = string.Concat( Female ? "(Commanding Lady of the " : "(Commanding Lord of the ", faction.Definition.FriendlyName, ")" );
else if ( pl.Sheriff != null ) else if ( pl.Sheriff != null )
text = String.Concat( "(The Sheriff of ", pl.Sheriff.Definition.FriendlyName, ", ", faction.Definition.FriendlyName, ")" ); text = string.Concat( "(The Sheriff of ", pl.Sheriff.Definition.FriendlyName, ", ", faction.Definition.FriendlyName, ")" );
else if ( pl.Finance != null ) else if ( pl.Finance != null )
text = String.Concat( "(The Finance Minister of ", pl.Finance.Definition.FriendlyName, ", ", faction.Definition.FriendlyName, ")" ); text = string.Concat( "(The Finance Minister of ", pl.Finance.Definition.FriendlyName, ", ", faction.Definition.FriendlyName, ")" );
else else
{ {
ascii = true; ascii = true;
if ( pl.MerchantTitle != MerchantTitle.None ) if ( pl.MerchantTitle != MerchantTitle.None )
text = String.Concat( "(", MerchantTitles.GetInfo( pl.MerchantTitle ).Title.String, ", ", faction.Definition.FriendlyName, ")" ); text = string.Concat( "(", MerchantTitles.GetInfo( pl.MerchantTitle ).Title.String, ", ", faction.Definition.FriendlyName, ")" );
else else
text = String.Concat( "(", pl.Rank.Title.String, ", ", faction.Definition.FriendlyName, ")" ); text = string.Concat( "(", pl.Rank.Title.String, ", ", faction.Definition.FriendlyName, ")" );
} }
int hue = ( Faction.Find( from ) == faction ? 98 : 38 ); int hue = ( Faction.Find( from ) == faction ? 98 : 38 );
@ -4341,7 +4341,7 @@ namespace Server.Mobiles
if ( suffix.Length == 0 ) if ( suffix.Length == 0 )
suffix = "(Young)"; suffix = "(Young)";
else else
suffix = String.Concat( suffix, " (Young)" ); suffix = string.Concat( suffix, " (Young)" );
} }
#region Ethics #region Ethics
@ -4350,7 +4350,7 @@ namespace Server.Mobiles
if ( suffix.Length == 0 ) if ( suffix.Length == 0 )
suffix = m_EthicPlayer.Ethic.Definition.Adjunct.String; suffix = m_EthicPlayer.Ethic.Definition.Adjunct.String;
else else
suffix = String.Concat( suffix, " ", m_EthicPlayer.Ethic.Definition.Adjunct.String ); suffix = string.Concat( suffix, " ", m_EthicPlayer.Ethic.Definition.Adjunct.String );
} }
#endregion #endregion
@ -4364,7 +4364,7 @@ namespace Server.Mobiles
if ( suffix.Length == 0 ) if ( suffix.Length == 0 )
suffix = adjunct; suffix = adjunct;
else else
suffix = String.Concat( suffix, " ", adjunct ); suffix = string.Concat( suffix, " ", adjunct );
} }
} }

View file

@ -33,7 +33,7 @@ namespace Server.Mobiles
if (AccountGold.Enabled && m.Account != null) if (AccountGold.Enabled && m.Account != null)
{ {
balance = m.Account.GetTotalGold(); balance = m.Account.GetTotalGold();
if (balance >= Int32.MaxValue) { return Int32.MaxValue; } if (balance >= int.MaxValue) { return int.MaxValue; }
} }
Container bank = m.FindBankNoCreate(); Container bank = m.FindBankNoCreate();
@ -44,11 +44,11 @@ namespace Server.Mobiles
var checks = bank.FindItemsByType<BankCheck>(); var checks = bank.FindItemsByType<BankCheck>();
balance += gold.Aggregate(0L, (c, t) => c + t.Amount); balance += gold.Aggregate(0L, (c, t) => c + t.Amount);
if (balance >= Int32.MaxValue) { return Int32.MaxValue; } if (balance >= int.MaxValue) { return int.MaxValue; }
balance += checks.Aggregate(0L, (c, t) => c + t.Worth); balance += checks.Aggregate(0L, (c, t) => c + t.Worth);
} }
return Math.Max(0, (int)Math.Min(Int32.MaxValue, balance)); return Math.Max(0, (int)Math.Min(int.MaxValue, balance));
} }
public static int GetBalance(Mobile m, out Item[] gold, out Item[] checks) public static int GetBalance(Mobile m, out Item[] gold, out Item[] checks)
@ -59,10 +59,10 @@ namespace Server.Mobiles
{ {
balance = m.Account.GetTotalGold(); balance = m.Account.GetTotalGold();
if (balance > Int32.MaxValue) if (balance > int.MaxValue)
{ {
gold = checks = new Item[0]; gold = checks = new Item[0];
return Int32.MaxValue; return int.MaxValue;
} }
} }
@ -74,7 +74,7 @@ namespace Server.Mobiles
checks = bank.FindItemsByType(typeof(BankCheck)); checks = bank.FindItemsByType(typeof(BankCheck));
balance += gold.OfType<Gold>().Aggregate(0L, (c, t) => c + t.Amount); balance += gold.OfType<Gold>().Aggregate(0L, (c, t) => c + t.Amount);
if (balance >= Int32.MaxValue) { return Int32.MaxValue; } if (balance >= int.MaxValue) { return int.MaxValue; }
balance += checks.OfType<BankCheck>().Aggregate(0L, (c, t) => c + t.Worth); balance += checks.OfType<BankCheck>().Aggregate(0L, (c, t) => c + t.Worth);
} }
else else
@ -82,7 +82,7 @@ namespace Server.Mobiles
gold = checks = new Item[0]; gold = checks = new Item[0];
} }
return Math.Max(0, (int)Math.Min(Int32.MaxValue, balance)); return Math.Max(0, (int)Math.Min(int.MaxValue, balance));
} }
public static bool Withdraw(Mobile from, int amount) public static bool Withdraw(Mobile from, int amount)

View file

@ -153,7 +153,7 @@ namespace Server.Mobiles
from.SendMessage( "Duration set to: {0}", ts ); from.SendMessage( "Duration set to: {0}", ts );
from.SendMessage( "Enter the first line to shout:" ); from.SendMessage( "Enter the first line to shout:" );
from.Prompt = new TownCrierLinesPrompt( m_Owner, null, new List<String>(), ts ); from.Prompt = new TownCrierLinesPrompt( m_Owner, null, new List<string>(), ts );
} }
public override void OnCancel( Mobile from ) public override void OnCancel( Mobile from )
@ -167,10 +167,10 @@ namespace Server.Mobiles
{ {
private ITownCrierEntryList m_Owner; private ITownCrierEntryList m_Owner;
private TownCrierEntry m_Entry; private TownCrierEntry m_Entry;
private List<String> m_Lines; private List<string> m_Lines;
private TimeSpan m_Duration; private TimeSpan m_Duration;
public TownCrierLinesPrompt( ITownCrierEntryList owner, TownCrierEntry entry, List<String> lines, TimeSpan duration ) public TownCrierLinesPrompt( ITownCrierEntryList owner, TownCrierEntry entry, List<string> lines, TimeSpan duration )
{ {
m_Owner = owner; m_Owner = owner;
m_Entry = entry; m_Entry = entry;
@ -235,7 +235,7 @@ namespace Server.Mobiles
m_From.SendMessage( "Editing entry #{0}.", index + 1 ); m_From.SendMessage( "Editing entry #{0}.", index + 1 );
m_From.SendMessage( "Enter the first line to shout:" ); m_From.SendMessage( "Enter the first line to shout:" );
m_From.Prompt = new TownCrierLinesPrompt( m_Owner, tce, new List<String>(), ts ); m_From.Prompt = new TownCrierLinesPrompt( m_Owner, tce, new List<string>(), ts );
} }
} }
} }

View file

@ -430,12 +430,12 @@ namespace Server.Mobiles
continue; continue;
if ( split[i].Length > 1 ) if ( split[i].Length > 1 )
split[i] = Char.ToUpper( split[i][0] ) + split[i].Substring( 1 ); split[i] = char.ToUpper( split[i][0] ) + split[i].Substring( 1 );
else if ( split[i].Length > 0 ) else if ( split[i].Length > 0 )
split[i] = Char.ToUpper( split[i][0] ).ToString(); split[i] = char.ToUpper( split[i][0] ).ToString();
} }
Title = String.Join( " ", split ); Title = string.Join( " ", split );
} }
public virtual int GetHairHue() public virtual int GetHairHue()

View file

@ -241,7 +241,7 @@ namespace Server.Mobiles
else else
item.LabelTo( from, 1043304, vi.FormattedPrice ); // Price: ~1_COST~ item.LabelTo( from, 1043304, vi.FormattedPrice ); // Price: ~1_COST~
if ( !String.IsNullOrEmpty( vi.Description ) ) if ( !string.IsNullOrEmpty( vi.Description ) )
{ {
// The localized message (1043305) is no longer valid - <br>Seller's Description:<br>"~1_DESC~" // The localized message (1043305) is no longer valid - <br>Seller's Description:<br>"~1_DESC~"
item.LabelTo( from, "Description: {0}", vi.Description ); item.LabelTo( from, "Description: {0}", vi.Description );
@ -973,7 +973,7 @@ namespace Server.Mobiles
if ( vi != null ) if ( vi != null )
{ {
string name; string name;
if ( !String.IsNullOrEmpty( item.Name ) ) if ( !string.IsNullOrEmpty( item.Name ) )
name = item.Name; name = item.Name;
else else
name = "#" + item.LabelNumber.ToString(); name = "#" + item.LabelNumber.ToString();

View file

@ -909,7 +909,7 @@ namespace Server.Multis
int start = -1; int start = -1;
for ( int i = 0; i < navPoint.Length; i++ ) for ( int i = 0; i < navPoint.Length; i++ )
{ {
if ( Char.IsDigit( navPoint[i] ) ) if ( char.IsDigit( navPoint[i] ) )
{ {
start = i; start = i;
break; break;

View file

@ -224,7 +224,7 @@ namespace Server.Regions
} }
} }
private static List<Int32> m_SpawnBuffer1 = new List<Int32>(); private static List<int> m_SpawnBuffer1 = new List<int>();
private static List<Item> m_SpawnBuffer2 = new List<Item>(); private static List<Item> m_SpawnBuffer2 = new List<Item>();
public Point3D RandomSpawnLocation( int spawnHeight, bool land, bool water, Point3D home, int range ) public Point3D RandomSpawnLocation( int spawnHeight, bool land, bool water, Point3D home, int range )

View file

@ -193,7 +193,7 @@ namespace Server.Spells
public static void ClearAllMoves( Mobile m ) public static void ClearAllMoves( Mobile m )
{ {
foreach ( KeyValuePair<Int32, SpecialMove> kvp in SpellRegistry.SpecialMoves ) foreach ( KeyValuePair<int, SpecialMove> kvp in SpellRegistry.SpecialMoves )
{ {
int moveID = kvp.Key; int moveID = kvp.Key;

View file

@ -35,10 +35,10 @@ namespace Server.Spells
} }
} }
private static Dictionary<Type, Int32> m_IDsFromTypes = new Dictionary<Type, Int32>( m_Types.Length ); private static Dictionary<Type, int> m_IDsFromTypes = new Dictionary<Type, int>( m_Types.Length );
private static Dictionary<Int32, SpecialMove> m_SpecialMoves = new Dictionary<Int32, SpecialMove>(); private static Dictionary<int, SpecialMove> m_SpecialMoves = new Dictionary<int, SpecialMove>();
public static Dictionary<Int32, SpecialMove> SpecialMoves => m_SpecialMoves; public static Dictionary<int, SpecialMove> SpecialMoves => m_SpecialMoves;
public static int GetRegistryNumber( ISpell s ) public static int GetRegistryNumber( ISpell s )
{ {

View file

@ -80,7 +80,7 @@ namespace Server.Spells.Fifth
for ( int i = 0; i < mods.Length; ++i ) for ( int i = 0; i < mods.Length; ++i )
targ.AddResistanceMod( mods[i] ); targ.AddResistanceMod( mods[i] );
string buffFormat = String.Format( "{0}\t+{1}\t+{1}\t+{1}\t+{1}", physiMod, otherMod ); string buffFormat = string.Format( "{0}\t+{1}\t+{1}\t+{1}\t+{1}", physiMod, otherMod );
BuffInfo.AddBuff( targ, new BuffInfo( BuffIcon.MagicReflection, 1075817, buffFormat, true ) ); BuffInfo.AddBuff( targ, new BuffInfo( BuffIcon.MagicReflection, 1075817, buffFormat, true ) );
} }

View file

@ -103,9 +103,9 @@ namespace Server.Spells.Fourth
FinishSequence(); FinishSequence();
} }
private static Dictionary<Mobile, Int32> _Table = new Dictionary<Mobile, Int32>(); private static Dictionary<Mobile, int> _Table = new Dictionary<Mobile, int>();
private static void AddEntry( Mobile m, Int32 v ) private static void AddEntry( Mobile m, int v )
{ {
_Table[m] = v; _Table[m] = v;
} }

View file

@ -164,7 +164,7 @@ namespace Server
int br2 = fmt.IndexOf( '.', br1 + 1 ); int br2 = fmt.IndexOf( '.', br1 + 1 );
int br3 = br2 + 1; int br3 = br2 + 1;
while ( br3 < fmt.Length && Char.IsDigit( fmt, br3 ) ) while ( br3 < fmt.Length && char.IsDigit( fmt, br3 ) )
br3++; br3++;
m_Major = Utility.ToInt32( fmt.Substring( 0, br1 ) ); m_Major = Utility.ToInt32( fmt.Substring( 0, br1 ) );
@ -175,7 +175,7 @@ namespace Server
{ {
if ( m_Major <= 5 && m_Minor <= 0 && m_Revision <= 6 ) //Anything before 5.0.7 if ( m_Major <= 5 && m_Minor <= 0 && m_Revision <= 6 ) //Anything before 5.0.7
{ {
if ( !Char.IsWhiteSpace( fmt, br3 ) ) if ( !char.IsWhiteSpace( fmt, br3 ) )
m_Patch = (fmt[br3] - 'a') + 1; m_Patch = (fmt[br3] - 'a') + 1;
} }
else else

View file

@ -41,7 +41,7 @@ namespace Server
public static void Error( int eventID, string format, params object[] args ) public static void Error( int eventID, string format, params object[] args )
{ {
Error( eventID, String.Format( format, args ) ); Error( eventID, string.Format( format, args ) );
} }
public static void Warning( int eventID, string text ) public static void Warning( int eventID, string text )
@ -51,7 +51,7 @@ namespace Server
public static void Warning( int eventID, string format, params object[] args ) public static void Warning( int eventID, string format, params object[] args )
{ {
Warning( eventID, String.Format( format, args ) ); Warning( eventID, string.Format( format, args ) );
} }
public static void Inform( int eventID, string text ) public static void Inform( int eventID, string text )
@ -61,7 +61,7 @@ namespace Server
public static void Inform( int eventID, string format, params object[] args ) public static void Inform( int eventID, string format, params object[] args )
{ {
Inform( eventID, String.Format( format, args ) ); Inform( eventID, string.Format( format, args ) );
} }
} }
} }

View file

@ -1277,7 +1277,7 @@ namespace Server
public void LabelTo( Mobile to, string format, params object[] args ) public void LabelTo( Mobile to, string format, params object[] args )
{ {
LabelTo( to, String.Format( format, args ) ); LabelTo( to, string.Format( format, args ) );
} }
public void LabelToAffix( Mobile to, int number, AffixType type, string affix ) public void LabelToAffix( Mobile to, int number, AffixType type, string affix )

View file

@ -1667,7 +1667,7 @@ namespace Server.Items
base.OnSingleClick( from ); base.OnSingleClick( from );
if ( CheckContentDisplay( from ) ) if ( CheckContentDisplay( from ) )
LabelTo( from, "({0} item{2}, {1} stones)", TotalItems, TotalWeight, TotalItems != 1 ? "s" : String.Empty ); LabelTo( from, "({0} item{2}, {1} stones)", TotalItems, TotalWeight, TotalItems != 1 ? "s" : string.Empty );
//LabelTo( from, 1050044, String.Format( "{0}\t{1}", TotalItems.ToString(), TotalWeight.ToString() ) ); //LabelTo( from, 1050044, String.Format( "{0}\t{1}", TotalItems.ToString(), TotalWeight.ToString() ) );
} }

View file

@ -328,12 +328,12 @@ namespace Server
var platText = info.GetTextEntry(0).Text; var platText = info.GetTextEntry(0).Text;
var goldText = info.GetTextEntry(1).Text; var goldText = info.GetTextEntry(1).Text;
if (!Int32.TryParse(platText, out _Plat)) if (!int.TryParse(platText, out _Plat))
{ {
User.SendMessage("That is not a valid amount of platinum."); User.SendMessage("That is not a valid amount of platinum.");
refresh = true; refresh = true;
} }
else if (!Int32.TryParse(goldText, out _Gold)) else if (!int.TryParse(goldText, out _Gold))
{ {
User.SendMessage("That is not a valid amount of gold."); User.SendMessage("That is not a valid amount of gold.");
refresh = true; refresh = true;

View file

@ -178,7 +178,7 @@ namespace Server
public static string FindDataFile( string format, params object[] args ) public static string FindDataFile( string format, params object[] args )
{ {
return FindDataFile( String.Format( format, args ) ); return FindDataFile( string.Format( format, args ) );
} }
#region Expansions #region Expansions
@ -789,7 +789,7 @@ namespace Server
public override void WriteLine(string line, params object[] args) public override void WriteLine(string line, params object[] args)
{ {
WriteLine(String.Format(line, args)); WriteLine(string.Format(line, args));
} }
public override Encoding Encoding => Encoding.Default; public override Encoding Encoding => Encoding.Default;

View file

@ -338,7 +338,7 @@ namespace Server
public static Map Parse(string value) public static Map Parse(string value)
{ {
if (String.IsNullOrWhiteSpace(value)) if (string.IsNullOrWhiteSpace(value))
{ {
return null; return null;
} }
@ -348,7 +348,7 @@ namespace Server
return Internal; return Internal;
} }
if (!Int32.TryParse(value, out int index)) if (!int.TryParse(value, out int index))
{ {
return m_Maps.FirstOrDefault(m => m != null && Insensitive.Equals(m.Name, value)); return m_Maps.FirstOrDefault(m => m != null && Insensitive.Equals(m.Name, value));
} }

View file

@ -333,7 +333,7 @@ namespace Server.Network {
} }
public void WriteConsole( string format, params object[] args ) { public void WriteConsole( string format, params object[] args ) {
WriteConsole( String.Format( format, args ) ); WriteConsole( string.Format( format, args ) );
} }
public void AddMenu( IMenu menu ) { public void AddMenu( IMenu menu ) {

View file

@ -222,7 +222,7 @@ namespace Server.Network
if ( m_Index >= m_Size ) if ( m_Index >= m_Size )
{ {
m_Index += fixedLength; m_Index += fixedLength;
return String.Empty; return string.Empty;
} }
int bound = m_Index + fixedLength; int bound = m_Index + fixedLength;
@ -270,7 +270,7 @@ namespace Server.Network
public string ReadUTF8StringSafe() public string ReadUTF8StringSafe()
{ {
if ( m_Index >= m_Size ) if ( m_Index >= m_Size )
return String.Empty; return string.Empty;
int count = 0; int count = 0;
int index = m_Index; int index = m_Index;
@ -310,7 +310,7 @@ namespace Server.Network
public string ReadUTF8String() public string ReadUTF8String()
{ {
if ( m_Index >= m_Size ) if ( m_Index >= m_Size )
return String.Empty; return string.Empty;
int count = 0; int count = 0;
int index = m_Index; int index = m_Index;

View file

@ -203,7 +203,7 @@ namespace Server.Network
if ( value == null ) if ( value == null )
{ {
Console.WriteLine( "Network: Attempted to WriteAsciiFixed() with null value" ); Console.WriteLine( "Network: Attempted to WriteAsciiFixed() with null value" );
value = String.Empty; value = string.Empty;
} }
int length = value.Length; int length = value.Length;
@ -239,7 +239,7 @@ namespace Server.Network
if ( value == null ) if ( value == null )
{ {
Console.WriteLine( "Network: Attempted to WriteAsciiNull() with null value" ); Console.WriteLine( "Network: Attempted to WriteAsciiNull() with null value" );
value = String.Empty; value = string.Empty;
} }
int length = value.Length; int length = value.Length;
@ -263,7 +263,7 @@ namespace Server.Network
if ( value == null ) if ( value == null )
{ {
Console.WriteLine( "Network: Attempted to WriteLittleUniNull() with null value" ); Console.WriteLine( "Network: Attempted to WriteLittleUniNull() with null value" );
value = String.Empty; value = string.Empty;
} }
int length = value.Length; int length = value.Length;
@ -290,7 +290,7 @@ namespace Server.Network
if ( value == null ) if ( value == null )
{ {
Console.WriteLine( "Network: Attempted to WriteLittleUniFixed() with null value" ); Console.WriteLine( "Network: Attempted to WriteLittleUniFixed() with null value" );
value = String.Empty; value = string.Empty;
} }
size *= 2; size *= 2;
@ -330,7 +330,7 @@ namespace Server.Network
if ( value == null ) if ( value == null )
{ {
Console.WriteLine( "Network: Attempted to WriteBigUniNull() with null value" ); Console.WriteLine( "Network: Attempted to WriteBigUniNull() with null value" );
value = String.Empty; value = string.Empty;
} }
int length = value.Length; int length = value.Length;
@ -357,7 +357,7 @@ namespace Server.Network
if ( value == null ) if ( value == null )
{ {
Console.WriteLine( "Network: Attempted to WriteBigUniFixed() with null value" ); Console.WriteLine( "Network: Attempted to WriteBigUniFixed() with null value" );
value = String.Empty; value = string.Empty;
} }
size *= 2; size *= 2;

View file

@ -2435,7 +2435,7 @@ namespace Server.Network
string v = strings[i]; string v = strings[i];
if ( v == null ) if ( v == null )
v = String.Empty; v = string.Empty;
m_Strings.Write( (ushort) v.Length ); m_Strings.Write( (ushort) v.Length );
m_Strings.WriteBigUniFixed( v, v.Length ); m_Strings.WriteBigUniFixed( v, v.Length );
@ -2593,7 +2593,7 @@ namespace Server.Network
string v = text[i]; string v = text[i];
if ( v == null ) if ( v == null )
v = String.Empty; v = string.Empty;
int length = (ushort) v.Length; int length = (ushort) v.Length;

View file

@ -127,22 +127,22 @@ namespace Server
public void Add( int number, string format, object arg0 ) public void Add( int number, string format, object arg0 )
{ {
Add( number, String.Format( format, arg0 ) ); Add( number, string.Format( format, arg0 ) );
} }
public void Add( int number, string format, object arg0, object arg1 ) public void Add( int number, string format, object arg0, object arg1 )
{ {
Add( number, String.Format( format, arg0, arg1 ) ); Add( number, string.Format( format, arg0, arg1 ) );
} }
public void Add( int number, string format, object arg0, object arg1, object arg2 ) public void Add( int number, string format, object arg0, object arg1, object arg2 )
{ {
Add( number, String.Format( format, arg0, arg1, arg2 ) ); Add( number, string.Format( format, arg0, arg1, arg2 ) );
} }
public void Add( int number, string format, params object[] args ) public void Add( int number, string format, params object[] args )
{ {
Add( number, String.Format( format, args ) ); Add( number, string.Format( format, args ) );
} }
// Each of these are localized to "~1_NOTHING~" which allows the string argument to be used // Each of these are localized to "~1_NOTHING~" which allows the string argument to be used
@ -163,22 +163,22 @@ namespace Server
public void Add( string format, string arg0 ) public void Add( string format, string arg0 )
{ {
Add( GetStringNumber(), String.Format( format, arg0 ) ); Add( GetStringNumber(), string.Format( format, arg0 ) );
} }
public void Add( string format, string arg0, string arg1 ) public void Add( string format, string arg0, string arg1 )
{ {
Add( GetStringNumber(), String.Format( format, arg0, arg1 ) ); Add( GetStringNumber(), string.Format( format, arg0, arg1 ) );
} }
public void Add( string format, string arg0, string arg1, string arg2 ) public void Add( string format, string arg0, string arg1, string arg2 )
{ {
Add( GetStringNumber(), String.Format( format, arg0, arg1, arg2 ) ); Add( GetStringNumber(), string.Format( format, arg0, arg1, arg2 ) );
} }
public void Add( string format, params object[] args ) public void Add( string format, params object[] args )
{ {
Add( GetStringNumber(), String.Format( format, args ) ); Add( GetStringNumber(), string.Format( format, args ) );
} }
} }

View file

@ -384,7 +384,7 @@ namespace Server
public override void Write( decimal value ) public override void Write( decimal value )
{ {
int[] bits = Decimal.GetBits( value ); int[] bits = decimal.GetBits( value );
for( int i = 0; i < bits.Length; ++i ) for( int i = 0; i < bits.Length; ++i )
Write( bits[i] ); Write( bits[i] );

View file

@ -69,9 +69,9 @@ namespace Server
if ( str == null ) if ( str == null )
return null; return null;
else if ( str.Length == 0 ) else if ( str.Length == 0 )
return String.Empty; return string.Empty;
return String.Intern( str ); return string.Intern( str );
} }
public static void Intern( ref string str ) public static void Intern( ref string str )

View file

@ -110,7 +110,7 @@ namespace Server {
} }
public static void Broadcast( int hue, bool ascii, string format, params object[] args ) { public static void Broadcast( int hue, bool ascii, string format, params object[] args ) {
Broadcast( hue, ascii, String.Format( format, args ) ); Broadcast( hue, ascii, string.Format( format, args ) );
} }
private interface IEntityEntry { private interface IEntityEntry {
@ -607,7 +607,7 @@ namespace Server {
} }
private static void AppendSafetyLog( string action, IEntity entity ) { private static void AppendSafetyLog( string action, IEntity entity ) {
string message = String.Format( "Warning: Attempted to {1} {2} during world save." + string message = string.Format( "Warning: Attempted to {1} {2} during world save." +
"{0}This action could cause inconsistent state." + "{0}This action could cause inconsistent state." +
"{0}It is strongly advised that the offending scripts be corrected.", "{0}It is strongly advised that the offending scripts be corrected.",
Environment.NewLine, Environment.NewLine,