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.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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue