C# 9 Cleanup (#325)

- [X] Removes EventArgs - not needed
- [X] Merges sequential checks
- [X] Removes redundant type declarations
This commit is contained in:
Kamron Batman 2020-11-27 00:29:21 -08:00 • committed by GitHub
parent 351611a23a
commit 3551d962f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
417 changed files with 2209 additions and 2213 deletions

View file

@ -10,7 +10,7 @@ namespace Server.Accounting
{
public static bool Enabled;
private static readonly List<InvalidAccountAccessLog> m_List = new List<InvalidAccountAccessLog>();
private static readonly List<InvalidAccountAccessLog> m_List = new();
public static void Configure()
{

View file

@ -19,15 +19,15 @@ namespace Server.Misc
private static readonly CityInfo[] StartingCities =
{
new CityInfo("New Haven", "New Haven Bank", 1150168, 3667, 2625, 0),
new CityInfo("Yew", "The Empath Abbey", 1075072, 633, 858, 0),
new CityInfo("Minoc", "The Barnacle", 1075073, 2476, 413, 15),
new CityInfo("Britain", "The Wayfarer's Inn", 1075074, 1602, 1591, 20),
new CityInfo("Moonglow", "The Scholars Inn", 1075075, 4408, 1168, 0),
new CityInfo("Trinsic", "The Traveler's Inn", 1075076, 1845, 2745, 0),
new CityInfo("Jhelom", "The Mercenary Inn", 1075078, 1374, 3826, 0),
new CityInfo("Skara Brae", "The Falconer's Inn", 1075079, 618, 2234, 0),
new CityInfo("Vesper", "The Ironwood Inn", 1075080, 2771, 976, 0)
new("New Haven", "New Haven Bank", 1150168, 3667, 2625, 0),
new("Yew", "The Empath Abbey", 1075072, 633, 858, 0),
new("Minoc", "The Barnacle", 1075073, 2476, 413, 15),
new("Britain", "The Wayfarer's Inn", 1075074, 1602, 1591, 20),
new("Moonglow", "The Scholars Inn", 1075075, 4408, 1168, 0),
new("Trinsic", "The Traveler's Inn", 1075076, 1845, 2745, 0),
new("Jhelom", "The Mercenary Inn", 1075078, 1374, 3826, 0),
new("Skara Brae", "The Falconer's Inn", 1075079, 618, 2234, 0),
new("Vesper", "The Ironwood Inn", 1075080, 2771, 976, 0)
};
/* Old Haven/Magincia Locations

View file

@ -7,7 +7,7 @@ namespace Server.Accounting
{
public static class Accounts
{
private static Dictionary<string, IAccount> m_Accounts = new Dictionary<string, IAccount>();
private static Dictionary<string, IAccount> m_Accounts = new();
static Accounts()
{

View file

@ -22,7 +22,7 @@ namespace Server.Accounting.Security
{
public static IPasswordProtection Instance = new Argon2PasswordProtection();
private readonly Argon2PasswordHasher m_PasswordHasher = new Argon2PasswordHasher(
private readonly Argon2PasswordHasher m_PasswordHasher = new(
rng: (RandomSources.SecureSource as SecureRandom)?.Generator
);

View file

@ -23,7 +23,7 @@ namespace Server.Accounting.Security
{
public static IPasswordProtection Instance = new MD5PasswordProtection();
#pragma warning disable CA5351
private readonly MD5CryptoServiceProvider m_MD5HashProvider = new MD5CryptoServiceProvider();
private readonly MD5CryptoServiceProvider m_MD5HashProvider = new();
#pragma warning restore CA5351
public string EncryptPassword(string plainPassword)

View file

@ -23,7 +23,7 @@ namespace Server.Accounting.Security
{
public static IPasswordProtection Instance = new SHA1PasswordProtection();
#pragma warning disable CA5350
private readonly SHA1CryptoServiceProvider m_SHA1HashProvider = new SHA1CryptoServiceProvider();
private readonly SHA1CryptoServiceProvider m_SHA1HashProvider = new();
#pragma warning restore CA5350
public string EncryptPassword(string plainPassword)

View file

@ -22,7 +22,7 @@ namespace Server.Accounting.Security
public class SHA2PasswordProtection : IPasswordProtection
{
public static IPasswordProtection Instance = new SHA2PasswordProtection();
private readonly SHA512CryptoServiceProvider m_SHA2HashProvider = new SHA512CryptoServiceProvider();
private readonly SHA512CryptoServiceProvider m_SHA2HashProvider = new();
public string EncryptPassword(string plainPassword)
{