diff --git a/Obsidian/Commands/Framework/Entities/Command.cs b/Obsidian/Commands/Framework/Entities/Command.cs index b3788e10b..96fbaf754 100644 --- a/Obsidian/Commands/Framework/Entities/Command.cs +++ b/Obsidian/Commands/Framework/Entities/Command.cs @@ -106,8 +106,9 @@ public async Task ExecuteAsync(CommandContext context, string[] args) { // Current param and arg var paraminfo = methodparams[i]; - var arg = args[i]; + var arg = args.Length > 0 ? args[i] : string.Empty; + // This can only be true if we get a [Remaining] arg. Sets arg to remaining text. if (args.Length > methodparams.Length && i == methodparams.Length - 1) { diff --git a/Obsidian/Server.cs b/Obsidian/Server.cs index e3b277ac6..a7e72fe39 100644 --- a/Obsidian/Server.cs +++ b/Obsidian/Server.cs @@ -331,8 +331,17 @@ private async Task AcceptClientsAsync() // No longer accepting clients. break; } - connection = acceptedConnection; + + if (!WorldManager.ReadyToJoin) + { + connection.Abort(); + await connection.DisposeAsync(); + + _logger.LogDebug("Server has not been fully initialized. Aborted the connection"); + continue; + } + } catch (OperationCanceledException) {