Cleanup & Fixes for .NET 5 (#309)

- [X] Fixes several bugs
- [X] Updates more ordinal issues
- [X] Cleans up the code a bit
- [X] Turns classes static that should have been
- [X] Changes TcpServer.Instances to a HashSet

Bumps release version
This commit is contained in:
Kamron Batman 2020-11-15 10:03:50 -08:00 • committed by GitHub
parent 4ad8811df2
commit 525cda5413
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
266 changed files with 1348 additions and 1800 deletions

View file

@ -3,7 +3,7 @@ using System.Linq;
namespace Server.Factions
{
public class Generator
public static class Generator
{
public static void Initialize()
{
@ -35,14 +35,14 @@ namespace Server.Factions
var def = town.Definition;
if (!CheckExistance(def.Monolith, facet, typeof(TownMonolith)))
if (!CheckExistence(def.Monolith, facet, typeof(TownMonolith)))
{
var mono = new TownMonolith(town);
mono.MoveToWorld(def.Monolith, facet);
mono.Sigil = new Sigil(town);
}
if (!CheckExistance(def.TownStone, facet, typeof(TownStone)))
if (!CheckExistence(def.TownStone, facet, typeof(TownStone)))
{
new TownStone(town).MoveToWorld(def.TownStone, facet);
}
@ -56,12 +56,12 @@ namespace Server.Factions
var stronghold = faction.Definition.Stronghold;
if (!CheckExistance(stronghold.JoinStone, facet, typeof(JoinStone)))
if (!CheckExistence(stronghold.JoinStone, facet, typeof(JoinStone)))
{
new JoinStone(faction).MoveToWorld(stronghold.JoinStone, facet);
}
if (!CheckExistance(stronghold.FactionStone, facet, typeof(FactionStone)))
if (!CheckExistence(stronghold.FactionStone, facet, typeof(FactionStone)))
{
new FactionStone(faction).MoveToWorld(stronghold.FactionStone, facet);
}
@ -70,14 +70,14 @@ namespace Server.Factions
{
var monolith = stronghold.Monoliths[i];
if (!CheckExistance(monolith, facet, typeof(StrongholdMonolith)))
if (!CheckExistence(monolith, facet, typeof(StrongholdMonolith)))
{
new StrongholdMonolith(towns[i], faction).MoveToWorld(monolith, facet);
}
}
}
private static bool CheckExistance(Point3D loc, Map facet, Type type) =>
private static bool CheckExistence(Point3D loc, Map facet, Type type) =>
facet.GetItemsInRange(loc, 0).Any(type.IsInstanceOfType);
}
}

View file

@ -35,7 +35,7 @@ namespace Server.Factions
public TextDefinition Assigned { get; }
}
public class MerchantTitles
public static class MerchantTitles
{
public static MerchantTitleInfo[] Info { get; } =
{

View file

@ -5,7 +5,7 @@ using Server.Utilities;
namespace Server.Factions
{
public class Reflector
public static class Reflector
{
private static List<Town> m_Towns;

View file

@ -286,7 +286,7 @@ namespace Server.Factions
public void ConstructGuardLists()
{
var defs = Owner?.Definition.Guards ?? new GuardDefinition[0];
var defs = Owner?.Definition.Guards ?? Array.Empty<GuardDefinition>();
GuardLists = new List<GuardList>();

View file

@ -80,7 +80,7 @@ namespace Server.Factions
var silverToAward = from.Alive ? 20 : 40;
if (silverToAward > 0 && Placer != null && Faction != null)
if (Placer != null && Faction != null)
{
var victimState = PlayerState.Find(from);

View file

@ -24,7 +24,7 @@ namespace Server.Factions
public override void DoVisibleEffect()
{
Effects.SendLocationEffect(GetWorldLocation(), Map, 0x36BD, 15, 10);
Effects.SendLocationEffect(GetWorldLocation(), Map, 0x36BD, 15);
}
public override void DoAttackEffect(Mobile m)

View file

@ -20,7 +20,7 @@ namespace Server.Factions
public override void DoVisibleEffect()
{
Effects.SendLocationEffect(Location, Map, 0x11AD, 25, 10);
Effects.SendLocationEffect(Location, Map, 0x11AD, 25);
}
public override void DoAttackEffect(Mobile m)