C# 9 Cleanup (#325)
- [X] Removes EventArgs - not needed - [X] Merges sequential checks - [X] Removes redundant type declarations
This commit is contained in:
parent
351611a23a
commit
3551d962f7
417 changed files with 2209 additions and 2213 deletions
|
|
@ -24,7 +24,7 @@ namespace Server
|
|||
{
|
||||
public static class AssemblyHandler
|
||||
{
|
||||
private static readonly Dictionary<Assembly, TypeCache> m_TypeCaches = new Dictionary<Assembly, TypeCache>();
|
||||
private static readonly Dictionary<Assembly, TypeCache> m_TypeCaches = new();
|
||||
private static TypeCache m_NullCache;
|
||||
public static Assembly[] Assemblies { get; set; }
|
||||
|
||||
|
|
@ -158,7 +158,7 @@ namespace Server
|
|||
|
||||
public class TypeCache
|
||||
{
|
||||
private readonly Dictionary<string, int[]> m_NameMap = new Dictionary<string, int[]>();
|
||||
private readonly Dictionary<string, int[]> m_NameMap = new();
|
||||
private readonly Type[] m_Types;
|
||||
|
||||
public TypeCache(Assembly asm)
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ namespace Server.Collections
|
|||
{
|
||||
public class ArraySet<T> : IList<T>
|
||||
{
|
||||
private readonly List<T> m_List = new List<T>();
|
||||
private readonly List<T> m_List = new();
|
||||
|
||||
public T this[int index]
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ namespace Server
|
|||
{
|
||||
public delegate void CommandEventHandler(CommandEventArgs e);
|
||||
|
||||
public class CommandEventArgs : EventArgs
|
||||
public class CommandEventArgs
|
||||
{
|
||||
public CommandEventArgs(Mobile mobile, string command, string argString, string[] arguments)
|
||||
{
|
||||
|
|
@ -116,7 +116,7 @@ namespace Server
|
|||
public static string Prefix { get; set; } = "[";
|
||||
|
||||
public static Dictionary<string, CommandEntry> Entries { get; } =
|
||||
new Dictionary<string, CommandEntry>(StringComparer.OrdinalIgnoreCase);
|
||||
new(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
public static AccessLevel BadCommandIgnoreLevel { get; set; } = AccessLevel.Player;
|
||||
|
||||
|
|
|
|||
|
|
@ -303,13 +303,13 @@ namespace Server
|
|||
internal class ServerSettings
|
||||
{
|
||||
[JsonPropertyName("dataDirectories")]
|
||||
public List<string> dataDirectories { get; set; } = new List<string>();
|
||||
public List<string> dataDirectories { get; set; } = new();
|
||||
|
||||
[JsonPropertyName("listeners")]
|
||||
public List<IPEndPoint> listeners { get; set; } = new List<IPEndPoint>();
|
||||
public List<IPEndPoint> listeners { get; set; } = new();
|
||||
|
||||
[JsonPropertyName("settings")]
|
||||
public SortedDictionary<string, string> settings { get; set; } = new SortedDictionary<string, string>();
|
||||
public SortedDictionary<string, string> settings { get; set; } = new();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ namespace Server.Diagnostics
|
|||
{
|
||||
public class GumpProfile : BaseProfile
|
||||
{
|
||||
private static readonly Dictionary<Type, GumpProfile> _profiles = new Dictionary<Type, GumpProfile>();
|
||||
private static readonly Dictionary<Type, GumpProfile> _profiles = new();
|
||||
|
||||
public GumpProfile(Type type) : base(type.FullName)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ namespace Server.Diagnostics
|
|||
|
||||
public class PacketSendProfile : BasePacketProfile
|
||||
{
|
||||
private static readonly Dictionary<Type, PacketSendProfile> _profiles = new Dictionary<Type, PacketSendProfile>();
|
||||
private static readonly Dictionary<Type, PacketSendProfile> _profiles = new();
|
||||
|
||||
private long _created;
|
||||
|
||||
|
|
@ -70,7 +70,7 @@ namespace Server.Diagnostics
|
|||
public class PacketReceiveProfile : BasePacketProfile
|
||||
{
|
||||
private static readonly Dictionary<int, PacketReceiveProfile>
|
||||
_profiles = new Dictionary<int, PacketReceiveProfile>();
|
||||
_profiles = new();
|
||||
|
||||
public PacketReceiveProfile(int packetId)
|
||||
: base($"0x{packetId:X2}")
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ namespace Server.Diagnostics
|
|||
{
|
||||
public class TargetProfile : BaseProfile
|
||||
{
|
||||
private static readonly Dictionary<Type, TargetProfile> _profiles = new Dictionary<Type, TargetProfile>();
|
||||
private static readonly Dictionary<Type, TargetProfile> _profiles = new();
|
||||
|
||||
public TargetProfile(Type type)
|
||||
: base(type.FullName)
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ namespace Server.Diagnostics
|
|||
{
|
||||
public class TimerProfile : BaseProfile
|
||||
{
|
||||
private static readonly Dictionary<string, TimerProfile> _profiles = new Dictionary<string, TimerProfile>();
|
||||
private static readonly Dictionary<string, TimerProfile> _profiles = new();
|
||||
|
||||
public TimerProfile(string name)
|
||||
: base(name)
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ using Server.Network;
|
|||
|
||||
namespace Server
|
||||
{
|
||||
public class AccountLoginEventArgs : EventArgs
|
||||
public class AccountLoginEventArgs
|
||||
{
|
||||
public AccountLoginEventArgs(NetState state, string username, string password)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ namespace Server
|
|||
{
|
||||
public class AggressiveActionEventArgs : EventArgs
|
||||
{
|
||||
private static readonly Queue<AggressiveActionEventArgs> m_Pool = new Queue<AggressiveActionEventArgs>();
|
||||
private static readonly Queue<AggressiveActionEventArgs> m_Pool = new();
|
||||
|
||||
private AggressiveActionEventArgs(Mobile aggressed, Mobile aggressor, bool criminal)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ using Server.Network;
|
|||
|
||||
namespace Server
|
||||
{
|
||||
public class CharacterCreatedEventArgs : EventArgs
|
||||
public class CharacterCreatedEventArgs
|
||||
{
|
||||
public CharacterCreatedEventArgs(
|
||||
NetState state, IAccount a, string name, bool female, int hue, int str, int dex,
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ using Server.Network;
|
|||
|
||||
namespace Server
|
||||
{
|
||||
public class GameLoginEventArgs : EventArgs
|
||||
public class GameLoginEventArgs
|
||||
{
|
||||
public GameLoginEventArgs(NetState state, string un, string pw)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ namespace Server
|
|||
{
|
||||
public class MovementEventArgs : EventArgs
|
||||
{
|
||||
private static readonly Queue<MovementEventArgs> m_Pool = new Queue<MovementEventArgs>();
|
||||
private static readonly Queue<MovementEventArgs> m_Pool = new();
|
||||
|
||||
public MovementEventArgs(Mobile mobile, Direction dir)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ using System;
|
|||
|
||||
namespace Server
|
||||
{
|
||||
public class ServerCrashedEventArgs : EventArgs
|
||||
public class ServerCrashedEventArgs
|
||||
{
|
||||
public ServerCrashedEventArgs(Exception e) => Exception = e;
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ using Server.Network;
|
|||
|
||||
namespace Server
|
||||
{
|
||||
public class ServerListEventArgs : EventArgs
|
||||
public class ServerListEventArgs
|
||||
{
|
||||
public ServerListEventArgs(NetState state, IAccount account)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ using System.Net.Sockets;
|
|||
|
||||
namespace Server
|
||||
{
|
||||
public class SocketConnectEventArgs : EventArgs
|
||||
public class SocketConnectEventArgs
|
||||
{
|
||||
public SocketConnectEventArgs(Socket c)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ using Server.Network;
|
|||
|
||||
namespace Server
|
||||
{
|
||||
public class SpeechEventArgs : EventArgs
|
||||
public class SpeechEventArgs
|
||||
{
|
||||
public SpeechEventArgs(Mobile mobile, string speech, MessageType type, int hue, int[] keywords)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ namespace Server
|
|||
internal int m_X;
|
||||
internal int m_Y;
|
||||
|
||||
public static readonly Point2D Zero = new Point2D(0, 0);
|
||||
public static readonly Point2D Zero = new(0, 0);
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public int X
|
||||
|
|
@ -71,7 +71,7 @@ namespace Server
|
|||
public bool Equals(Point2D other) => m_X == other.m_X && m_Y == other.m_Y;
|
||||
|
||||
public bool Equals(IPoint2D other) =>
|
||||
!ReferenceEquals(other, null) && m_X == other.X && m_Y == other.Y;
|
||||
m_X == other?.X && m_Y == other.Y;
|
||||
|
||||
public override bool Equals(object obj) => obj is Point2D other && Equals(other);
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ namespace Server
|
|||
internal int m_Y;
|
||||
internal int m_Z;
|
||||
|
||||
public static readonly Point3D Zero = new Point3D(0, 0, 0);
|
||||
public static readonly Point3D Zero = new(0, 0, 0);
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public int X
|
||||
|
|
@ -69,7 +69,7 @@ namespace Server
|
|||
public bool Equals(Point3D other) => m_X == other.m_X && m_Y == other.m_Y && m_Z == other.m_Z;
|
||||
|
||||
public bool Equals(IPoint3D other) =>
|
||||
!ReferenceEquals(other, null) && m_X == other.X && m_Y == other.Y && m_Z == other.Z;
|
||||
m_X == other?.X && m_Y == other.Y && m_Z == other.Z;
|
||||
|
||||
public override bool Equals(object obj) => obj is Point3D other && Equals(other);
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ namespace Server
|
|||
internal Point3D m_Loc;
|
||||
internal Map m_Map;
|
||||
|
||||
public static readonly WorldLocation Zero = new WorldLocation(0, 0, 0, Map.Internal);
|
||||
public static readonly WorldLocation Zero = new(0, 0, 0, Map.Internal);
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public Point3D Location
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@ namespace Server.Items
|
|||
|
||||
public class Container : Item
|
||||
{
|
||||
private static readonly QueuePool m_QueuePool = new QueuePool(QueueRef<Container>.Generate, 2, 5);
|
||||
private static readonly List<Item> m_FindItemsList = new List<Item>();
|
||||
private static readonly QueuePool m_QueuePool = new(QueueRef<Container>.Generate, 2, 5);
|
||||
private static readonly List<Item> m_FindItemsList = new();
|
||||
|
||||
private ContainerData m_ContainerData;
|
||||
|
||||
|
|
|
|||
|
|
@ -194,9 +194,9 @@ namespace Server
|
|||
public class Item : IHued, IComparable<Item>, ISpawnable, IPropertyListObject
|
||||
{
|
||||
public const int QuestItemHue = 0x4EA; // Hmmmm... "for EA"?
|
||||
public static readonly List<Item> EmptyItems = new List<Item>();
|
||||
public static readonly List<Item> EmptyItems = new();
|
||||
|
||||
private static readonly List<Item> m_DeltaQueue = new List<Item>();
|
||||
private static readonly List<Item> m_DeltaQueue = new();
|
||||
|
||||
private static bool _processing;
|
||||
|
||||
|
|
@ -923,7 +923,7 @@ namespace Server
|
|||
flags |= SaveFlag.Parent;
|
||||
}
|
||||
|
||||
if (items != null && items.Count > 0)
|
||||
if (items?.Count > 0)
|
||||
{
|
||||
flags |= SaveFlag.Items;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,9 +95,7 @@ namespace Server
|
|||
public static Assembly Assembly { get; set; }
|
||||
|
||||
// Assembly file version
|
||||
public static Version Version => Version.Parse(
|
||||
FileVersionInfo.GetVersionInfo(Assembly.Location).FileVersion
|
||||
);
|
||||
public static Version Version => new(ThisAssembly.AssemblyFileVersion);
|
||||
|
||||
public static Process Process { get; private set; }
|
||||
|
||||
|
|
@ -135,7 +133,7 @@ namespace Server
|
|||
}
|
||||
}
|
||||
|
||||
public static CancellationTokenSource ClosingTokenSource { get; } = new CancellationTokenSource();
|
||||
public static CancellationTokenSource ClosingTokenSource { get; } = new();
|
||||
|
||||
public static bool Closing => ClosingTokenSource.IsCancellationRequested;
|
||||
|
||||
|
|
|
|||
|
|
@ -270,9 +270,9 @@ namespace Server
|
|||
public const int SectorShift = 4;
|
||||
public static readonly int SectorActiveRange = 2;
|
||||
|
||||
private static readonly Queue<List<Item>> m_FixPool = new Queue<List<Item>>(128);
|
||||
private static readonly Queue<List<Item>> m_FixPool = new(128);
|
||||
|
||||
private static readonly List<Item> m_EmptyFixItems = new List<Item>();
|
||||
private static readonly List<Item> m_EmptyFixItems = new();
|
||||
|
||||
private readonly int m_FileIndex;
|
||||
private readonly Sector[][] m_Sectors;
|
||||
|
|
@ -280,7 +280,7 @@ namespace Server
|
|||
|
||||
private readonly int m_SectorsWidth;
|
||||
|
||||
private readonly object tileLock = new object();
|
||||
private readonly object tileLock = new();
|
||||
private Region m_DefaultRegion;
|
||||
|
||||
private string m_Name;
|
||||
|
|
@ -314,7 +314,7 @@ namespace Server
|
|||
public static Map TerMur => Maps[5];
|
||||
public static Map Internal => Maps[0x7F];
|
||||
|
||||
public static List<Map> AllMaps { get; } = new List<Map>();
|
||||
public static List<Map> AllMaps { get; } = new();
|
||||
|
||||
public int Season { get; set; }
|
||||
|
||||
|
|
@ -1546,7 +1546,7 @@ namespace Server
|
|||
|
||||
public class NullEnumerable<T> : IPooledEnumerable<T>
|
||||
{
|
||||
public static readonly NullEnumerable<T> Instance = new NullEnumerable<T>();
|
||||
public static readonly NullEnumerable<T> Instance = new();
|
||||
|
||||
private readonly IEnumerable<T> m_Empty;
|
||||
|
||||
|
|
@ -1563,11 +1563,11 @@ namespace Server
|
|||
|
||||
public sealed class PooledEnumerable<T> : IPooledEnumerable<T>, IDisposable
|
||||
{
|
||||
private static readonly Queue<PooledEnumerable<T>> _Buffer = new Queue<PooledEnumerable<T>>(0x400);
|
||||
private static readonly Queue<PooledEnumerable<T>> _Buffer = new(0x400);
|
||||
|
||||
private bool m_IsDisposed;
|
||||
|
||||
private List<T> m_Pool = new List<T>(0x40);
|
||||
private List<T> m_Pool = new(0x40);
|
||||
|
||||
public PooledEnumerable(IEnumerable<T> pool)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ namespace Server
|
|||
{
|
||||
public class AggressorInfo
|
||||
{
|
||||
private static readonly Queue<AggressorInfo> m_Pool = new Queue<AggressorInfo>();
|
||||
private static readonly Queue<AggressorInfo> m_Pool = new();
|
||||
private Mobile m_Attacker, m_Defender;
|
||||
private bool m_CanReportMurder;
|
||||
private bool m_CriminalAggression;
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ namespace Server
|
|||
|
||||
public static implicit operator int(Body a) => a.BodyID;
|
||||
|
||||
public static implicit operator Body(int a) => new Body(a);
|
||||
public static implicit operator Body(int a) => new(a);
|
||||
|
||||
public override string ToString() => $"0x{BodyID:X}";
|
||||
|
||||
|
|
|
|||
|
|
@ -3611,7 +3611,7 @@ namespace Server
|
|||
Resistances[3] += BasePoisonResistance;
|
||||
Resistances[4] += BaseEnergyResistance;
|
||||
|
||||
for (var i = 0; ResistanceMods != null && i < ResistanceMods.Count; ++i)
|
||||
for (var i = 0; i < ResistanceMods?.Count; ++i)
|
||||
{
|
||||
var mod = ResistanceMods[i];
|
||||
var v = (int)mod.Type;
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ namespace Server
|
|||
bin.Close();
|
||||
}
|
||||
|
||||
public static Dictionary<int, MultiComponentList> Components { get; } = new Dictionary<int, MultiComponentList>();
|
||||
public static Dictionary<int, MultiComponentList> Components { get; } = new();
|
||||
|
||||
public static MultiComponentList GetComponents(int multiID)
|
||||
{
|
||||
|
|
@ -251,7 +251,7 @@ namespace Server
|
|||
|
||||
public sealed class MultiComponentList
|
||||
{
|
||||
public static readonly MultiComponentList Empty = new MultiComponentList();
|
||||
public static readonly MultiComponentList Empty = new();
|
||||
|
||||
private Point2D m_Min, m_Max;
|
||||
|
||||
|
|
|
|||
|
|
@ -19,22 +19,22 @@ namespace Server.Network
|
|||
{
|
||||
public partial class NetState
|
||||
{
|
||||
private static readonly ClientVersion m_Version400a = new ClientVersion("4.0.0a");
|
||||
private static readonly ClientVersion m_Version407a = new ClientVersion("4.0.7a");
|
||||
private static readonly ClientVersion m_Version500a = new ClientVersion("5.0.0a");
|
||||
private static readonly ClientVersion m_Version502b = new ClientVersion("5.0.2b");
|
||||
private static readonly ClientVersion m_Version6000 = new ClientVersion("6.0.0.0");
|
||||
private static readonly ClientVersion m_Version6017 = new ClientVersion("6.0.1.7");
|
||||
private static readonly ClientVersion m_Version60142 = new ClientVersion("6.0.14.2");
|
||||
private static readonly ClientVersion m_Version7000 = new ClientVersion("7.0.0.0");
|
||||
private static readonly ClientVersion m_Version7090 = new ClientVersion("7.0.9.0");
|
||||
private static readonly ClientVersion m_Version70130 = new ClientVersion("7.0.13.0");
|
||||
private static readonly ClientVersion m_Version70160 = new ClientVersion("7.0.16.0");
|
||||
private static readonly ClientVersion m_Version70300 = new ClientVersion("7.0.30.0");
|
||||
private static readonly ClientVersion m_Version70331 = new ClientVersion("7.0.33.1");
|
||||
private static readonly ClientVersion m_Version704565 = new ClientVersion("7.0.45.65");
|
||||
private static readonly ClientVersion m_Version70500 = new ClientVersion("7.0.50.0");
|
||||
private static readonly ClientVersion m_Version70610 = new ClientVersion("7.0.61.0");
|
||||
private static readonly ClientVersion m_Version400a = new("4.0.0a");
|
||||
private static readonly ClientVersion m_Version407a = new("4.0.7a");
|
||||
private static readonly ClientVersion m_Version500a = new("5.0.0a");
|
||||
private static readonly ClientVersion m_Version502b = new("5.0.2b");
|
||||
private static readonly ClientVersion m_Version6000 = new("6.0.0.0");
|
||||
private static readonly ClientVersion m_Version6017 = new("6.0.1.7");
|
||||
private static readonly ClientVersion m_Version60142 = new("6.0.14.2");
|
||||
private static readonly ClientVersion m_Version7000 = new("7.0.0.0");
|
||||
private static readonly ClientVersion m_Version7090 = new("7.0.9.0");
|
||||
private static readonly ClientVersion m_Version70130 = new("7.0.13.0");
|
||||
private static readonly ClientVersion m_Version70160 = new("7.0.16.0");
|
||||
private static readonly ClientVersion m_Version70300 = new("7.0.30.0");
|
||||
private static readonly ClientVersion m_Version70331 = new("7.0.33.1");
|
||||
private static readonly ClientVersion m_Version704565 = new("7.0.45.65");
|
||||
private static readonly ClientVersion m_Version70500 = new("7.0.50.0");
|
||||
private static readonly ClientVersion m_Version70610 = new("7.0.61.0");
|
||||
|
||||
public ProtocolChanges ProtocolChanges { get; set; }
|
||||
public ClientFlags Flags { get; set; }
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ namespace Server.Network
|
|||
private static int HuePickerCap = 512;
|
||||
private static int MenuCap = 512;
|
||||
|
||||
private static readonly ConcurrentQueue<NetState> m_Disposed = new ConcurrentQueue<NetState>();
|
||||
private static readonly ConcurrentQueue<NetState> m_Disposed = new();
|
||||
private static NetworkState m_NetworkState = NetworkState.ResumeState;
|
||||
|
||||
public static NetStateCreatedCallback CreatedCallback { get; set; }
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ namespace Server.Network
|
|||
{
|
||||
public class NetworkState
|
||||
{
|
||||
public static readonly NetworkState PauseState = new NetworkState(true);
|
||||
public static readonly NetworkState ResumeState = new NetworkState(false);
|
||||
public static readonly NetworkState PauseState = new(true);
|
||||
public static readonly NetworkState ResumeState = new(false);
|
||||
|
||||
public bool Paused { get; }
|
||||
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ namespace Server.Network
|
|||
}
|
||||
}
|
||||
|
||||
private readonly object _object = new object();
|
||||
private readonly object _object = new();
|
||||
|
||||
public byte[] Compile(bool compress, out int length)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ namespace Server.Network
|
|||
/// </summary>
|
||||
public class PacketWriter
|
||||
{
|
||||
private static readonly ConcurrentQueue<PacketWriter> m_Pool = new ConcurrentQueue<PacketWriter>();
|
||||
private static readonly ConcurrentQueue<PacketWriter> m_Pool = new();
|
||||
|
||||
/// <summary>
|
||||
/// Internal format buffer.
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ namespace Server.Network
|
|||
{
|
||||
private const int m_AuthIDWindowSize = 128;
|
||||
private static readonly Dictionary<int, AuthIDPersistence> m_AuthIDWindow =
|
||||
new Dictionary<int, AuthIDPersistence>(m_AuthIDWindowSize);
|
||||
new(m_AuthIDWindowSize);
|
||||
|
||||
internal struct AuthIDPersistence
|
||||
{
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ namespace Server.Network
|
|||
public static class IncomingExtendedCommandPackets
|
||||
{
|
||||
private static readonly PacketHandler[] m_ExtendedHandlersLow = new PacketHandler[0x100];
|
||||
private static readonly Dictionary<int, PacketHandler> m_ExtendedHandlersHigh = new Dictionary<int, PacketHandler>();
|
||||
private static readonly Dictionary<int, PacketHandler> m_ExtendedHandlersHigh = new();
|
||||
|
||||
// TODO: Change to outside configuration
|
||||
public static int[] ValidAnimations { get; set; } =
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ namespace Server.Network
|
|||
|
||||
public static class IncomingMessagePackets
|
||||
{
|
||||
private static readonly KeywordList m_KeywordList = new KeywordList();
|
||||
private static readonly KeywordList m_KeywordList = new();
|
||||
|
||||
public static void Configure()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ namespace Server.Network
|
|||
private static readonly EncodedPacketHandler[] m_EncodedHandlersLow = new EncodedPacketHandler[0x100];
|
||||
|
||||
private static readonly Dictionary<int, EncodedPacketHandler> m_EncodedHandlersHigh =
|
||||
new Dictionary<int, EncodedPacketHandler>();
|
||||
new();
|
||||
|
||||
public static PacketHandler[] Handlers { get; } = new PacketHandler[0x100];
|
||||
|
||||
|
|
|
|||
|
|
@ -230,7 +230,7 @@ namespace Server.Network
|
|||
|
||||
var p = from.Prompt;
|
||||
|
||||
if (p != null && p.Serial == serial && p.Serial == prompt)
|
||||
if (p?.Serial == serial && p.Serial == prompt)
|
||||
{
|
||||
from.Prompt = null;
|
||||
|
||||
|
|
@ -267,7 +267,7 @@ namespace Server.Network
|
|||
|
||||
var p = from.Prompt;
|
||||
|
||||
if (p != null && p.Serial == serial && p.Serial == prompt)
|
||||
if (p?.Serial == serial && p.Serial == prompt)
|
||||
{
|
||||
from.Prompt = null;
|
||||
|
||||
|
|
|
|||
|
|
@ -541,8 +541,8 @@ namespace Server.Network
|
|||
|
||||
public sealed class MobileIncoming : Packet
|
||||
{
|
||||
private static readonly ThreadLocal<int[]> m_DupedLayersTL = new ThreadLocal<int[]>(() => new int[256]);
|
||||
private static readonly ThreadLocal<int> m_VersionTL = new ThreadLocal<int>();
|
||||
private static readonly ThreadLocal<int[]> m_DupedLayersTL = new(() => new int[256]);
|
||||
private static readonly ThreadLocal<int> m_VersionTL = new();
|
||||
|
||||
public MobileIncoming(Mobile beholder, Mobile beheld) : base(0x78)
|
||||
{
|
||||
|
|
@ -673,8 +673,8 @@ namespace Server.Network
|
|||
|
||||
public sealed class MobileIncomingSA : Packet
|
||||
{
|
||||
private static readonly ThreadLocal<int[]> m_DupedLayersTL = new ThreadLocal<int[]>(() => new int[256]);
|
||||
private static readonly ThreadLocal<int> m_VersionTL = new ThreadLocal<int>();
|
||||
private static readonly ThreadLocal<int[]> m_DupedLayersTL = new(() => new int[256]);
|
||||
private static readonly ThreadLocal<int> m_VersionTL = new();
|
||||
|
||||
public MobileIncomingSA(Mobile beholder, Mobile beheld) : base(0x78)
|
||||
{
|
||||
|
|
@ -820,8 +820,8 @@ namespace Server.Network
|
|||
// Pre-7.0.0.0 Mobile Incoming
|
||||
public sealed class MobileIncomingOld : Packet
|
||||
{
|
||||
private static readonly ThreadLocal<int[]> m_DupedLayersTL = new ThreadLocal<int[]>(() => new int[256]);
|
||||
private static readonly ThreadLocal<int> m_VersionTL = new ThreadLocal<int>();
|
||||
private static readonly ThreadLocal<int[]> m_DupedLayersTL = new(() => new int[256]);
|
||||
private static readonly ThreadLocal<int> m_VersionTL = new();
|
||||
|
||||
public MobileIncomingOld(Mobile beholder, Mobile beheld) : base(0x78)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ namespace Server.Network
|
|||
{
|
||||
private readonly Pipe<T> _pipe;
|
||||
|
||||
private Result _result = new Result(2);
|
||||
private Result _result = new(2);
|
||||
|
||||
internal PipeWriter(Pipe<T> pipe) => _pipe = pipe;
|
||||
|
||||
|
|
@ -273,7 +273,7 @@ namespace Server.Network
|
|||
{
|
||||
private readonly Pipe<T> _pipe;
|
||||
|
||||
private Result _result = new Result(2);
|
||||
private Result _result = new(2);
|
||||
|
||||
internal PipeReader(Pipe<T> pipe) => _pipe = pipe;
|
||||
|
||||
|
|
|
|||
|
|
@ -20,19 +20,19 @@ namespace Server.Network
|
|||
public static class StaticPacketHandlers
|
||||
{
|
||||
private static readonly ConcurrentDictionary<IPropertyListObject, OPLInfo> OPLInfoPackets =
|
||||
new ConcurrentDictionary<IPropertyListObject, OPLInfo>();
|
||||
new();
|
||||
|
||||
private static readonly ConcurrentDictionary<IEntity, RemoveEntity> RemoveEntityPackets =
|
||||
new ConcurrentDictionary<IEntity, RemoveEntity>();
|
||||
new();
|
||||
|
||||
private static readonly ConcurrentDictionary<Item, WorldItem> WorldItemPackets =
|
||||
new ConcurrentDictionary<Item, WorldItem>();
|
||||
new();
|
||||
|
||||
private static readonly ConcurrentDictionary<Item, WorldItemSA> WorldItemSAPackets =
|
||||
new ConcurrentDictionary<Item, WorldItemSA>();
|
||||
new();
|
||||
|
||||
private static readonly ConcurrentDictionary<Item, WorldItemHS> WorldItemHSPackets =
|
||||
new ConcurrentDictionary<Item, WorldItemHS>();
|
||||
new();
|
||||
|
||||
public static OPLInfo GetOPLInfoPacket(IPropertyListObject obj)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -39,9 +39,9 @@ namespace Server.Network
|
|||
|
||||
public static IPEndPoint[] ListeningAddresses { get; private set; }
|
||||
public static TcpListener[] Listeners { get; private set; }
|
||||
public static HashSet<NetState> Instances { get; } = new HashSet<NetState>(128);
|
||||
public static HashSet<NetState> Instances { get; } = new(128);
|
||||
|
||||
public static ConcurrentQueue<NetState> m_ConnectedQueue = new ConcurrentQueue<NetState>();
|
||||
public static ConcurrentQueue<NetState> m_ConnectedQueue = new();
|
||||
|
||||
public static void Configure()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ namespace Server
|
|||
public static Poison Deadly => GetPoison("Deadly");
|
||||
public static Poison Lethal => GetPoison("Lethal");
|
||||
|
||||
public static List<Poison> Poisons { get; } = new List<Poison>();
|
||||
public static List<Poison> Poisons { get; } = new();
|
||||
|
||||
public abstract Timer ConstructTimer(Mobile m);
|
||||
/*public abstract void OnDamage( Mobile m, ref object state );*/
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ namespace Server
|
|||
public static Race Elf => Races[1];
|
||||
public static Race Gargoyle => Races[2];
|
||||
|
||||
public static List<Race> AllRaces { get; } = new List<Race>();
|
||||
public static List<Race> AllRaces { get; } = new();
|
||||
|
||||
public Expansion RequiredExpansion { get; }
|
||||
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ namespace Server
|
|||
Music = json.GetEnumProperty("music", options, out MusicName music) ? music : DefaultMusic;
|
||||
}
|
||||
|
||||
public static List<Region> Regions { get; } = new List<Region>();
|
||||
public static List<Region> Regions { get; } = new();
|
||||
|
||||
public static Type DefaultRegionType { get; set; } = typeof(Region);
|
||||
|
||||
|
|
@ -190,7 +190,7 @@ namespace Server
|
|||
|
||||
public Region Parent { get; }
|
||||
|
||||
public List<Region> Children { get; } = new List<Region>();
|
||||
public List<Region> Children { get; } = new();
|
||||
|
||||
public Rectangle3D[] Area { get; }
|
||||
|
||||
|
|
@ -297,7 +297,7 @@ namespace Server
|
|||
}
|
||||
|
||||
public static Rectangle3D ConvertTo3D(Rectangle2D rect) =>
|
||||
new Rectangle3D(new Point3D(rect.Start, MinZ), new Point3D(rect.End, MaxZ));
|
||||
new(new Point3D(rect.Start, MinZ), new Point3D(rect.End, MaxZ));
|
||||
|
||||
public static Rectangle3D[] ConvertTo3D(Rectangle2D[] rects)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -27,11 +27,11 @@ namespace Server
|
|||
public class Sector
|
||||
{
|
||||
// TODO: Can we avoid this?
|
||||
private static readonly List<Mobile> m_DefaultMobileList = new List<Mobile>();
|
||||
private static readonly List<Item> m_DefaultItemList = new List<Item>();
|
||||
private static readonly List<NetState> m_DefaultClientList = new List<NetState>();
|
||||
private static readonly List<BaseMulti> m_DefaultMultiList = new List<BaseMulti>();
|
||||
private static readonly List<RegionRect> m_DefaultRectList = new List<RegionRect>();
|
||||
private static readonly List<Mobile> m_DefaultMobileList = new();
|
||||
private static readonly List<Item> m_DefaultItemList = new();
|
||||
private static readonly List<NetState> m_DefaultClientList = new();
|
||||
private static readonly List<BaseMulti> m_DefaultMultiList = new();
|
||||
private static readonly List<RegionRect> m_DefaultRectList = new();
|
||||
private bool m_Active;
|
||||
private List<NetState> m_Clients;
|
||||
private List<Item> m_Items;
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ namespace Server
|
|||
{
|
||||
public readonly struct Serial : IComparable<Serial>, IComparable<uint>, IEquatable<Serial>
|
||||
{
|
||||
public static readonly Serial MinusOne = new Serial(0xFFFFFFFF);
|
||||
public static readonly Serial Zero = new Serial(0);
|
||||
public static readonly Serial MinusOne = new(0xFFFFFFFF);
|
||||
public static readonly Serial Zero = new(0);
|
||||
|
||||
private Serial(uint serial) => Value = serial;
|
||||
|
||||
|
|
@ -54,7 +54,7 @@ namespace Server
|
|||
|
||||
public static implicit operator uint(Serial a) => a.Value;
|
||||
|
||||
public static implicit operator Serial(uint a) => new Serial(a);
|
||||
public static implicit operator Serial(uint a) => new(a);
|
||||
|
||||
public bool Equals(Serial other) => Value == other.Value;
|
||||
|
||||
|
|
|
|||
|
|
@ -48,11 +48,11 @@ namespace Server
|
|||
return s;
|
||||
}
|
||||
|
||||
public DateTime ReadDateTime() => new DateTime(ReadLong());
|
||||
public DateTime ReadDateTime() => new(ReadLong());
|
||||
|
||||
public DateTimeOffset ReadDateTimeOffset() => new DateTimeOffset(ReadLong(), ReadTimeSpan());
|
||||
public DateTimeOffset ReadDateTimeOffset() => new(ReadLong(), ReadTimeSpan());
|
||||
|
||||
public TimeSpan ReadTimeSpan() => new TimeSpan(ReadLong());
|
||||
public TimeSpan ReadTimeSpan() => new(ReadLong());
|
||||
|
||||
public DateTime ReadDeltaTime()
|
||||
{
|
||||
|
|
@ -79,7 +79,7 @@ namespace Server
|
|||
}
|
||||
}
|
||||
|
||||
public decimal ReadDecimal() => new decimal(new[] { ReadInt(), ReadInt(), ReadInt(), ReadInt() });
|
||||
public decimal ReadDecimal() => new(new[] { ReadInt(), ReadInt(), ReadInt(), ReadInt() });
|
||||
|
||||
public long ReadLong()
|
||||
{
|
||||
|
|
@ -158,15 +158,15 @@ namespace Server
|
|||
return v;
|
||||
}
|
||||
|
||||
public IPAddress ReadIPAddress() => new IPAddress(ReadLong());
|
||||
public IPAddress ReadIPAddress() => new(ReadLong());
|
||||
|
||||
public Point3D ReadPoint3D() => new Point3D(ReadInt(), ReadInt(), ReadInt());
|
||||
public Point3D ReadPoint3D() => new(ReadInt(), ReadInt(), ReadInt());
|
||||
|
||||
public Point2D ReadPoint2D() => new Point2D(ReadInt(), ReadInt());
|
||||
public Point2D ReadPoint2D() => new(ReadInt(), ReadInt());
|
||||
|
||||
public Rectangle2D ReadRect2D() => new Rectangle2D(ReadPoint2D(), ReadPoint2D());
|
||||
public Rectangle2D ReadRect2D() => new(ReadPoint2D(), ReadPoint2D());
|
||||
|
||||
public Rectangle3D ReadRect3D() => new Rectangle3D(ReadPoint3D(), ReadPoint3D());
|
||||
public Rectangle3D ReadRect3D() => new(ReadPoint3D(), ReadPoint3D());
|
||||
|
||||
public Map ReadMap() => Map.Maps[ReadByte()];
|
||||
|
||||
|
|
|
|||
|
|
@ -430,64 +430,64 @@ namespace Server
|
|||
|
||||
public static SkillInfo[] Table { get; set; } =
|
||||
{
|
||||
new SkillInfo(0, "Alchemy", 0.0, 5.0, 5.0, "Alchemist", null, 0.0, 0.5, 0.5, 1.0),
|
||||
new SkillInfo(1, "Anatomy", 0.0, 0.0, 0.0, "Biologist", null, 0.15, 0.15, 0.7, 1.0),
|
||||
new SkillInfo(2, "Animal Lore", 0.0, 0.0, 0.0, "Naturalist", null, 0.0, 0.0, 1.0, 1.0),
|
||||
new SkillInfo(3, "Item Identification", 0.0, 0.0, 0.0, "Merchant", null, 0.0, 0.0, 1.0, 1.0),
|
||||
new SkillInfo(4, "Arms Lore", 0.0, 0.0, 0.0, "Weapon Master", null, 0.75, 0.15, 0.1, 1.0),
|
||||
new SkillInfo(5, "Parrying", 7.5, 2.5, 0.0, "Duelist", null, 0.75, 0.25, 0.0, 1.0),
|
||||
new SkillInfo(6, "Begging", 0.0, 0.0, 0.0, "Beggar", null, 0.0, 0.0, 0.0, 1.0),
|
||||
new SkillInfo(7, "Blacksmithy", 10.0, 0.0, 0.0, "Blacksmith", null, 1.0, 0.0, 0.0, 1.0),
|
||||
new SkillInfo(8, "Bowcraft/Fletching", 6.0, 16.0, 0.0, "Bowyer", null, 0.6, 1.6, 0.0, 1.0),
|
||||
new SkillInfo(9, "Peacemaking", 0.0, 0.0, 0.0, "Pacifier", null, 0.0, 0.0, 0.0, 1.0),
|
||||
new SkillInfo(10, "Camping", 20.0, 15.0, 15.0, "Explorer", null, 2.0, 1.5, 1.5, 1.0),
|
||||
new SkillInfo(11, "Carpentry", 20.0, 5.0, 0.0, "Carpenter", null, 2.0, 0.5, 0.0, 1.0),
|
||||
new SkillInfo(12, "Cartography", 0.0, 7.5, 7.5, "Cartographer", null, 0.0, 0.75, 0.75, 1.0),
|
||||
new SkillInfo(13, "Cooking", 0.0, 20.0, 30.0, "Chef", null, 0.0, 2.0, 3.0, 1.0),
|
||||
new SkillInfo(14, "Detecting Hidden", 0.0, 0.0, 0.0, "Scout", null, 0.0, 0.4, 0.6, 1.0),
|
||||
new SkillInfo(15, "Discordance", 0.0, 2.5, 2.5, "Demoralizer", null, 0.0, 0.25, 0.25, 1.0),
|
||||
new SkillInfo(16, "Evaluating Intelligence", 0.0, 0.0, 0.0, "Scholar", null, 0.0, 0.0, 1.0, 1.0),
|
||||
new SkillInfo(17, "Healing", 6.0, 6.0, 8.0, "Healer", null, 0.6, 0.6, 0.8, 1.0),
|
||||
new SkillInfo(18, "Fishing", 0.0, 0.0, 0.0, "Fisherman", null, 0.5, 0.5, 0.0, 1.0),
|
||||
new SkillInfo(19, "Forensic Evaluation", 0.0, 0.0, 0.0, "Detective", null, 0.0, 0.2, 0.8, 1.0),
|
||||
new SkillInfo(20, "Herding", 16.25, 6.25, 2.5, "Shepherd", null, 1.625, 0.625, 0.25, 1.0),
|
||||
new SkillInfo(21, "Hiding", 0.0, 0.0, 0.0, "Shade", null, 0.0, 0.8, 0.2, 1.0),
|
||||
new SkillInfo(22, "Provocation", 0.0, 4.5, 0.5, "Rouser", null, 0.0, 0.45, 0.05, 1.0),
|
||||
new SkillInfo(23, "Inscription", 0.0, 2.0, 8.0, "Scribe", null, 0.0, 0.2, 0.8, 1.0),
|
||||
new SkillInfo(24, "Lockpicking", 0.0, 25.0, 0.0, "Infiltrator", null, 0.0, 2.0, 0.0, 1.0),
|
||||
new SkillInfo(25, "Magery", 0.0, 0.0, 15.0, "Mage", null, 0.0, 0.0, 1.5, 1.0),
|
||||
new SkillInfo(26, "Resisting Spells", 0.0, 0.0, 0.0, "Warder", null, 0.25, 0.25, 0.5, 1.0),
|
||||
new SkillInfo(27, "Tactics", 0.0, 0.0, 0.0, "Tactician", null, 0.0, 0.0, 0.0, 1.0),
|
||||
new SkillInfo(28, "Snooping", 0.0, 25.0, 0.0, "Spy", null, 0.0, 2.5, 0.0, 1.0),
|
||||
new SkillInfo(29, "Musicianship", 0.0, 0.0, 0.0, "Bard", null, 0.0, 0.8, 0.2, 1.0),
|
||||
new SkillInfo(30, "Poisoning", 0.0, 4.0, 16.0, "Assassin", null, 0.0, 0.4, 1.6, 1.0),
|
||||
new SkillInfo(31, "Archery", 2.5, 7.5, 0.0, "Archer", null, 0.25, 0.75, 0.0, 1.0),
|
||||
new SkillInfo(32, "Spirit Speak", 0.0, 0.0, 0.0, "Medium", null, 0.0, 0.0, 1.0, 1.0),
|
||||
new SkillInfo(33, "Stealing", 0.0, 10.0, 0.0, "Pickpocket", null, 0.0, 1.0, 0.0, 1.0),
|
||||
new SkillInfo(34, "Tailoring", 3.75, 16.25, 5.0, "Tailor", null, 0.38, 1.63, 0.5, 1.0),
|
||||
new SkillInfo(35, "Animal Taming", 14.0, 2.0, 4.0, "Tamer", null, 1.4, 0.2, 0.4, 1.0),
|
||||
new SkillInfo(36, "Taste Identification", 0.0, 0.0, 0.0, "Praegustator", null, 0.2, 0.0, 0.8, 1.0),
|
||||
new SkillInfo(37, "Tinkering", 5.0, 2.0, 3.0, "Tinker", null, 0.5, 0.2, 0.3, 1.0),
|
||||
new SkillInfo(38, "Tracking", 0.0, 12.5, 12.5, "Ranger", null, 0.0, 1.25, 1.25, 1.0),
|
||||
new SkillInfo(39, "Veterinary", 8.0, 4.0, 8.0, "Veterinarian", null, 0.8, 0.4, 0.8, 1.0),
|
||||
new SkillInfo(40, "Swordsmanship", 7.5, 2.5, 0.0, "Swordsman", null, 0.75, 0.25, 0.0, 1.0),
|
||||
new SkillInfo(41, "Mace Fighting", 9.0, 1.0, 0.0, "Armsman", null, 0.9, 0.1, 0.0, 1.0),
|
||||
new SkillInfo(42, "Fencing", 4.5, 5.5, 0.0, "Fencer", null, 0.45, 0.55, 0.0, 1.0),
|
||||
new SkillInfo(43, "Wrestling", 9.0, 1.0, 0.0, "Wrestler", null, 0.9, 0.1, 0.0, 1.0),
|
||||
new SkillInfo(44, "Lumberjacking", 20.0, 0.0, 0.0, "Lumberjack", null, 2.0, 0.0, 0.0, 1.0),
|
||||
new SkillInfo(45, "Mining", 20.0, 0.0, 0.0, "Miner", null, 2.0, 0.0, 0.0, 1.0),
|
||||
new SkillInfo(46, "Meditation", 0.0, 0.0, 0.0, "Stoic", null, 0.0, 0.0, 0.0, 1.0),
|
||||
new SkillInfo(47, "Stealth", 0.0, 0.0, 0.0, "Rogue", null, 0.0, 0.0, 0.0, 1.0),
|
||||
new SkillInfo(48, "Remove Trap", 0.0, 0.0, 0.0, "Trap Specialist", null, 0.0, 0.0, 0.0, 1.0),
|
||||
new SkillInfo(49, "Necromancy", 0.0, 0.0, 0.0, "Necromancer", null, 0.0, 0.0, 0.0, 1.0),
|
||||
new SkillInfo(50, "Focus", 0.0, 0.0, 0.0, "Driven", null, 0.0, 0.0, 0.0, 1.0),
|
||||
new SkillInfo(51, "Chivalry", 0.0, 0.0, 0.0, "Paladin", null, 0.0, 0.0, 0.0, 1.0),
|
||||
new SkillInfo(52, "Bushido", 0.0, 0.0, 0.0, "Samurai", null, 0.0, 0.0, 0.0, 1.0),
|
||||
new SkillInfo(53, "Ninjitsu", 0.0, 0.0, 0.0, "Ninja", null, 0.0, 0.0, 0.0, 1.0),
|
||||
new SkillInfo(54, "Spellweaving", 0.0, 0.0, 0.0, "Arcanist", null, 0.0, 0.0, 0.0, 1.0),
|
||||
new SkillInfo(55, "Mysticism", 0.0, 0.0, 0.0, "Mystic", null, 0.0, 0.0, 0.0, 1.0),
|
||||
new SkillInfo(56, "Imbuing", 0.0, 0.0, 0.0, "Artificer", null, 0.0, 0.0, 0.0, 1.0),
|
||||
new SkillInfo(57, "Throwing", 0.0, 0.0, 0.0, "Bladeweaver", null, 0.0, 0.0, 0.0, 1.0)
|
||||
new(0, "Alchemy", 0.0, 5.0, 5.0, "Alchemist", null, 0.0, 0.5, 0.5, 1.0),
|
||||
new(1, "Anatomy", 0.0, 0.0, 0.0, "Biologist", null, 0.15, 0.15, 0.7, 1.0),
|
||||
new(2, "Animal Lore", 0.0, 0.0, 0.0, "Naturalist", null, 0.0, 0.0, 1.0, 1.0),
|
||||
new(3, "Item Identification", 0.0, 0.0, 0.0, "Merchant", null, 0.0, 0.0, 1.0, 1.0),
|
||||
new(4, "Arms Lore", 0.0, 0.0, 0.0, "Weapon Master", null, 0.75, 0.15, 0.1, 1.0),
|
||||
new(5, "Parrying", 7.5, 2.5, 0.0, "Duelist", null, 0.75, 0.25, 0.0, 1.0),
|
||||
new(6, "Begging", 0.0, 0.0, 0.0, "Beggar", null, 0.0, 0.0, 0.0, 1.0),
|
||||
new(7, "Blacksmithy", 10.0, 0.0, 0.0, "Blacksmith", null, 1.0, 0.0, 0.0, 1.0),
|
||||
new(8, "Bowcraft/Fletching", 6.0, 16.0, 0.0, "Bowyer", null, 0.6, 1.6, 0.0, 1.0),
|
||||
new(9, "Peacemaking", 0.0, 0.0, 0.0, "Pacifier", null, 0.0, 0.0, 0.0, 1.0),
|
||||
new(10, "Camping", 20.0, 15.0, 15.0, "Explorer", null, 2.0, 1.5, 1.5, 1.0),
|
||||
new(11, "Carpentry", 20.0, 5.0, 0.0, "Carpenter", null, 2.0, 0.5, 0.0, 1.0),
|
||||
new(12, "Cartography", 0.0, 7.5, 7.5, "Cartographer", null, 0.0, 0.75, 0.75, 1.0),
|
||||
new(13, "Cooking", 0.0, 20.0, 30.0, "Chef", null, 0.0, 2.0, 3.0, 1.0),
|
||||
new(14, "Detecting Hidden", 0.0, 0.0, 0.0, "Scout", null, 0.0, 0.4, 0.6, 1.0),
|
||||
new(15, "Discordance", 0.0, 2.5, 2.5, "Demoralizer", null, 0.0, 0.25, 0.25, 1.0),
|
||||
new(16, "Evaluating Intelligence", 0.0, 0.0, 0.0, "Scholar", null, 0.0, 0.0, 1.0, 1.0),
|
||||
new(17, "Healing", 6.0, 6.0, 8.0, "Healer", null, 0.6, 0.6, 0.8, 1.0),
|
||||
new(18, "Fishing", 0.0, 0.0, 0.0, "Fisherman", null, 0.5, 0.5, 0.0, 1.0),
|
||||
new(19, "Forensic Evaluation", 0.0, 0.0, 0.0, "Detective", null, 0.0, 0.2, 0.8, 1.0),
|
||||
new(20, "Herding", 16.25, 6.25, 2.5, "Shepherd", null, 1.625, 0.625, 0.25, 1.0),
|
||||
new(21, "Hiding", 0.0, 0.0, 0.0, "Shade", null, 0.0, 0.8, 0.2, 1.0),
|
||||
new(22, "Provocation", 0.0, 4.5, 0.5, "Rouser", null, 0.0, 0.45, 0.05, 1.0),
|
||||
new(23, "Inscription", 0.0, 2.0, 8.0, "Scribe", null, 0.0, 0.2, 0.8, 1.0),
|
||||
new(24, "Lockpicking", 0.0, 25.0, 0.0, "Infiltrator", null, 0.0, 2.0, 0.0, 1.0),
|
||||
new(25, "Magery", 0.0, 0.0, 15.0, "Mage", null, 0.0, 0.0, 1.5, 1.0),
|
||||
new(26, "Resisting Spells", 0.0, 0.0, 0.0, "Warder", null, 0.25, 0.25, 0.5, 1.0),
|
||||
new(27, "Tactics", 0.0, 0.0, 0.0, "Tactician", null, 0.0, 0.0, 0.0, 1.0),
|
||||
new(28, "Snooping", 0.0, 25.0, 0.0, "Spy", null, 0.0, 2.5, 0.0, 1.0),
|
||||
new(29, "Musicianship", 0.0, 0.0, 0.0, "Bard", null, 0.0, 0.8, 0.2, 1.0),
|
||||
new(30, "Poisoning", 0.0, 4.0, 16.0, "Assassin", null, 0.0, 0.4, 1.6, 1.0),
|
||||
new(31, "Archery", 2.5, 7.5, 0.0, "Archer", null, 0.25, 0.75, 0.0, 1.0),
|
||||
new(32, "Spirit Speak", 0.0, 0.0, 0.0, "Medium", null, 0.0, 0.0, 1.0, 1.0),
|
||||
new(33, "Stealing", 0.0, 10.0, 0.0, "Pickpocket", null, 0.0, 1.0, 0.0, 1.0),
|
||||
new(34, "Tailoring", 3.75, 16.25, 5.0, "Tailor", null, 0.38, 1.63, 0.5, 1.0),
|
||||
new(35, "Animal Taming", 14.0, 2.0, 4.0, "Tamer", null, 1.4, 0.2, 0.4, 1.0),
|
||||
new(36, "Taste Identification", 0.0, 0.0, 0.0, "Praegustator", null, 0.2, 0.0, 0.8, 1.0),
|
||||
new(37, "Tinkering", 5.0, 2.0, 3.0, "Tinker", null, 0.5, 0.2, 0.3, 1.0),
|
||||
new(38, "Tracking", 0.0, 12.5, 12.5, "Ranger", null, 0.0, 1.25, 1.25, 1.0),
|
||||
new(39, "Veterinary", 8.0, 4.0, 8.0, "Veterinarian", null, 0.8, 0.4, 0.8, 1.0),
|
||||
new(40, "Swordsmanship", 7.5, 2.5, 0.0, "Swordsman", null, 0.75, 0.25, 0.0, 1.0),
|
||||
new(41, "Mace Fighting", 9.0, 1.0, 0.0, "Armsman", null, 0.9, 0.1, 0.0, 1.0),
|
||||
new(42, "Fencing", 4.5, 5.5, 0.0, "Fencer", null, 0.45, 0.55, 0.0, 1.0),
|
||||
new(43, "Wrestling", 9.0, 1.0, 0.0, "Wrestler", null, 0.9, 0.1, 0.0, 1.0),
|
||||
new(44, "Lumberjacking", 20.0, 0.0, 0.0, "Lumberjack", null, 2.0, 0.0, 0.0, 1.0),
|
||||
new(45, "Mining", 20.0, 0.0, 0.0, "Miner", null, 2.0, 0.0, 0.0, 1.0),
|
||||
new(46, "Meditation", 0.0, 0.0, 0.0, "Stoic", null, 0.0, 0.0, 0.0, 1.0),
|
||||
new(47, "Stealth", 0.0, 0.0, 0.0, "Rogue", null, 0.0, 0.0, 0.0, 1.0),
|
||||
new(48, "Remove Trap", 0.0, 0.0, 0.0, "Trap Specialist", null, 0.0, 0.0, 0.0, 1.0),
|
||||
new(49, "Necromancy", 0.0, 0.0, 0.0, "Necromancer", null, 0.0, 0.0, 0.0, 1.0),
|
||||
new(50, "Focus", 0.0, 0.0, 0.0, "Driven", null, 0.0, 0.0, 0.0, 1.0),
|
||||
new(51, "Chivalry", 0.0, 0.0, 0.0, "Paladin", null, 0.0, 0.0, 0.0, 1.0),
|
||||
new(52, "Bushido", 0.0, 0.0, 0.0, "Samurai", null, 0.0, 0.0, 0.0, 1.0),
|
||||
new(53, "Ninjitsu", 0.0, 0.0, 0.0, "Ninja", null, 0.0, 0.0, 0.0, 1.0),
|
||||
new(54, "Spellweaving", 0.0, 0.0, 0.0, "Arcanist", null, 0.0, 0.0, 0.0, 1.0),
|
||||
new(55, "Mysticism", 0.0, 0.0, 0.0, "Mystic", null, 0.0, 0.0, 0.0, 1.0),
|
||||
new(56, "Imbuing", 0.0, 0.0, 0.0, "Artificer", null, 0.0, 0.0, 0.0, 1.0),
|
||||
new(57, "Throwing", 0.0, 0.0, 0.0, "Bladeweaver", null, 0.0, 0.0, 0.0, 1.0)
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -621,7 +621,7 @@ namespace Server
|
|||
{
|
||||
var sk = m_Skills[i];
|
||||
|
||||
if (sk != null && sk.BaseFixedPoint > value)
|
||||
if (sk?.BaseFixedPoint > value)
|
||||
{
|
||||
value = sk.BaseFixedPoint;
|
||||
highest = sk;
|
||||
|
|
|
|||
|
|
@ -9,10 +9,10 @@ namespace Server
|
|||
{
|
||||
public class TileMatrix
|
||||
{
|
||||
private static readonly List<TileMatrix> m_Instances = new List<TileMatrix>();
|
||||
private static readonly List<TileMatrix> m_Instances = new();
|
||||
|
||||
private readonly int m_FileIndex;
|
||||
private readonly List<TileMatrix> m_FileShare = new List<TileMatrix>();
|
||||
private readonly List<TileMatrix> m_FileShare = new();
|
||||
|
||||
private readonly BinaryReader m_IndexReader;
|
||||
|
||||
|
|
@ -29,7 +29,7 @@ namespace Server
|
|||
private readonly int[][] m_StaticPatches;
|
||||
private readonly StaticTile[][][][][] m_StaticTiles;
|
||||
|
||||
private readonly TileList m_TilesList = new TileList();
|
||||
private readonly TileList m_TilesList = new();
|
||||
|
||||
private TileList[][] m_Lists;
|
||||
private DateTime m_NextLandWarning;
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ namespace Server
|
|||
|
||||
public partial class Timer
|
||||
{
|
||||
private static readonly Queue<Timer> m_Queue = new Queue<Timer>();
|
||||
private static readonly Queue<Timer> m_Queue = new();
|
||||
|
||||
private static int m_QueueCountAtSlice;
|
||||
private readonly int m_Count;
|
||||
|
|
@ -253,7 +253,7 @@ namespace Server
|
|||
public class TimerThread
|
||||
{
|
||||
private static readonly Dictionary<Timer, TimerChangeEntry>
|
||||
m_Changed = new Dictionary<Timer, TimerChangeEntry>();
|
||||
m_Changed = new();
|
||||
|
||||
private static readonly long[] m_NextPriorities = new long[8];
|
||||
|
||||
|
|
@ -271,17 +271,17 @@ namespace Server
|
|||
|
||||
private static readonly List<Timer>[] m_Timers =
|
||||
{
|
||||
new List<Timer>(),
|
||||
new List<Timer>(),
|
||||
new List<Timer>(),
|
||||
new List<Timer>(),
|
||||
new List<Timer>(),
|
||||
new List<Timer>(),
|
||||
new List<Timer>(),
|
||||
new List<Timer>()
|
||||
new(),
|
||||
new(),
|
||||
new(),
|
||||
new(),
|
||||
new(),
|
||||
new(),
|
||||
new(),
|
||||
new()
|
||||
};
|
||||
|
||||
private static readonly AutoResetEvent m_Signal = new AutoResetEvent(false);
|
||||
private static readonly AutoResetEvent m_Signal = new(false);
|
||||
|
||||
public static void DumpInfo(TextWriter tw)
|
||||
{
|
||||
|
|
@ -443,7 +443,7 @@ namespace Server
|
|||
|
||||
private class TimerChangeEntry
|
||||
{
|
||||
private static readonly Queue<TimerChangeEntry> m_InstancePool = new Queue<TimerChangeEntry>();
|
||||
private static readonly Queue<TimerChangeEntry> m_InstancePool = new();
|
||||
public bool m_IsAdd;
|
||||
public int m_NewIndex;
|
||||
public Timer m_Timer;
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ namespace Server.Utilities
|
|||
public const int DEFAULT_RESOURCE_RETENTION = 10;
|
||||
private readonly Generator m_Generator;
|
||||
|
||||
private readonly Stack<TRef> m_Resources = new Stack<TRef>();
|
||||
private readonly Stack<TRef> m_Resources = new();
|
||||
private int m_MaxRefrenceRetention;
|
||||
|
||||
/// <param name="generator">The generator function for creating new resources.</param>
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ namespace Server
|
|||
SkillName.Tinkering
|
||||
};
|
||||
|
||||
private static readonly Stack<ConsoleColor> m_ConsoleColors = new Stack<ConsoleColor>();
|
||||
private static readonly Stack<ConsoleColor> m_ConsoleColors = new();
|
||||
|
||||
public static Encoding UTF8 => m_UTF8 ??= new UTF8Encoding(false, false);
|
||||
public static Encoding UTF8WithEncoding => m_UTF8WithEncoding ??= new UTF8Encoding(true, false);
|
||||
|
|
|
|||
|
|
@ -40,10 +40,10 @@ namespace Server
|
|||
|
||||
public static class World
|
||||
{
|
||||
private static readonly ManualResetEvent m_DiskWriteHandle = new ManualResetEvent(true);
|
||||
private static readonly Dictionary<Serial, IEntity> _pendingAdd = new Dictionary<Serial, IEntity>();
|
||||
private static readonly Dictionary<Serial, IEntity> _pendingDelete = new Dictionary<Serial, IEntity>();
|
||||
private static readonly ConcurrentQueue<Item> _decayQueue = new ConcurrentQueue<Item>();
|
||||
private static readonly ManualResetEvent m_DiskWriteHandle = new(true);
|
||||
private static readonly Dictionary<Serial, IEntity> _pendingAdd = new();
|
||||
private static readonly Dictionary<Serial, IEntity> _pendingDelete = new();
|
||||
private static readonly ConcurrentQueue<Item> _decayQueue = new();
|
||||
|
||||
public const uint ItemOffset = 0x40000000;
|
||||
public const uint MaxItemSerial = 0x7FFFFFFF;
|
||||
|
|
@ -121,9 +121,9 @@ namespace Server
|
|||
private static void OutOfMemory(string message) => throw new OutOfMemoryException(message);
|
||||
|
||||
internal static int _Saves;
|
||||
internal static List<Type> ItemTypes { get; } = new List<Type>();
|
||||
internal static List<Type> MobileTypes { get; } = new List<Type>();
|
||||
internal static List<Type> GuildTypes { get; } = new List<Type>();
|
||||
internal static List<Type> ItemTypes { get; } = new();
|
||||
internal static List<Type> MobileTypes { get; } = new();
|
||||
internal static List<Type> GuildTypes { get; } = new();
|
||||
|
||||
public static WorldState WorldState { get; private set; }
|
||||
public static bool Saving => WorldState == WorldState.Saving;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue