Skip to content

Commit

Permalink
small tweak to restart and runas command
Browse files Browse the repository at this point in the history
  • Loading branch information
RaidMax committed Apr 5, 2023
1 parent 8aed1ae commit 25cec34
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 3 additions & 4 deletions SharedLibraryCore/Commands/NativeCommands.cs
Expand Up @@ -54,11 +54,10 @@ public class RestartCommand : Command
RequiresTarget = false;
}

public override Task ExecuteAsync(GameEvent E)
public override async Task ExecuteAsync(GameEvent gameEvent)
{
E.Owner.Manager.Restart();
E.Origin.Tell(_translationLookup["COMMANDS_RESTART_SUCCESS"]);
return Task.CompletedTask;
await gameEvent.Owner.Manager.Restart();
gameEvent.Origin.Tell(_translationLookup["COMMANDS_RESTART_SUCCESS"]);
}
}

Expand Down
7 changes: 3 additions & 4 deletions SharedLibraryCore/Commands/RunAsCommand.cs
Expand Up @@ -63,9 +63,8 @@ public override async Task ExecuteAsync(GameEvent gameEvent)
.SelectMany(ev => ev.Value.Output)
.ToList();

foreach (var output in responses)
await gameEvent.Origin.Tell(_translationLookup["COMMANDS_RUN_AS_SUCCESS"].FormatExt(output))
.WaitAsync();
await gameEvent.Origin.TellAsync(responses.Select(output =>
_translationLookup["COMMANDS_RUN_AS_SUCCESS"].FormatExt(output)));
}
}
}
}

0 comments on commit 25cec34

Please sign in to comment.