Skip to content

Commit

Permalink
Fixes #251 & #418 (#420)
Browse files Browse the repository at this point in the history
* Should fix #251

* Fixes #418

* Update Server.cs
  • Loading branch information
TheVeryStarlk authored Jan 22, 2024
1 parent e3df216 commit 6efa497
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Obsidian/Commands/Framework/Entities/Command.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
11 changes: 10 additions & 1 deletion Obsidian/Server.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 6efa497

Please sign in to comment.