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

@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
using Server.Commands.Generic;
@ -8,7 +9,7 @@ using CommandInfoSorter = Server.Commands.Docs.CommandEntrySorter;
namespace Server.Commands
{
public class HelpInfo
public static class HelpInfo
{
public static Dictionary<string, CommandInfo> HelpInfos { get; } = new Dictionary<string, CommandInfo>();
@ -22,10 +23,9 @@ namespace Server.Commands
FillTable();
}
[Usage("HelpInfo [<command>]")]
[Description(
"Gives information on a specified command, or when no argument specified, displays a gump containing all commands"
)]
[Usage("HelpInfo [<command>]"), Description(
"Gives information on a specified command, or when no argument specified, displays a gump containing all commands"
)]
private static void HelpInfo_OnCommand(CommandEventArgs e)
{
if (e.Length > 0)
@ -93,7 +93,9 @@ namespace Server.Commands
var aliases = attrs.Length == 0 ? null : attrs[0] as AliasesAttribute;
var descString = desc.Description.Replace("<", "(").Replace(">", ")");
var descString = desc.Description
.Replace("<", "(", StringComparison.Ordinal)
.Replace(">", ")", StringComparison.Ordinal);
if (aliases == null)
{
@ -137,7 +139,9 @@ namespace Server.Commands
aliases[j] = cmds[j + 1];
}
desc = desc.Replace("<", "(").Replace(">", ")");
desc = desc
.Replace("<", "(", StringComparison.Ordinal)
.Replace(">", ")", StringComparison.Ordinal);
if (command.Supports != CommandSupport.Single)
{
@ -224,7 +228,9 @@ namespace Server.Commands
aliases[j] = cmds[j + 1];
}
desc = desc.Replace("<", ")").Replace(">", ")");
desc = desc
.Replace("<", ")", StringComparison.Ordinal)
.Replace(">", ")", StringComparison.Ordinal);
list.Add(new CommandInfo(command.AccessLevel, cmd, aliases, usage, desc));
@ -406,7 +412,10 @@ namespace Server.Commands
var sb = new StringBuilder();
sb.Append("Usage: ");
sb.Append(info.Usage.Replace("<", "(").Replace(">", ")"));
var usage = info.Usage
.Replace("<", "(", StringComparison.Ordinal)
.Replace(">", ")", StringComparison.Ordinal);
sb.Append(usage);
sb.Append("<BR>");
var aliases = info.Aliases;