Skip to content

Commit

Permalink
Remove server side command history
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexProgrammerDE committed Sep 21, 2024
1 parent 071f57b commit 0bb3331
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
import javax.inject.Inject;
import java.io.IOException;
import java.nio.file.Files;
import java.time.Instant;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ThreadLocalRandom;
Expand All @@ -84,8 +83,6 @@ public class ServerCommandManager implements PlatformCommandManager<ServerComman
@Getter
private final CommandDispatcher<ServerCommandSource> dispatcher = new CommandDispatcher<>();
private final SoulFireServer soulFireServer;
private final List<Map.Entry<Instant, String>> commandHistory =
Collections.synchronizedList(new ArrayList<>());

private static String getCurrentUsername() {
var currentUser = ServerRPCConstants.USER_CONTEXT_KEY.get();
Expand Down Expand Up @@ -860,10 +857,7 @@ public int execute(String command, ServerCommandSource source) {
command = command.strip();

try {
var result = dispatcher.execute(command, source);
commandHistory.add(Map.entry(Instant.now(), command));

return result;
return dispatcher.execute(command, source);
} catch (CommandSyntaxException e) {
source.sendWarn(e.getMessage());
return Command.SINGLE_SUCCESS;
Expand Down

0 comments on commit 0bb3331

Please sign in to comment.