Skip to content

Commit 7656fb4

Browse files
fix(punishment): remove GetAllBannedIds endpoint that doesn't scale
1 parent 4e35348 commit 7656fb4

3 files changed

Lines changed: 1 addition & 108 deletions

File tree

commons/src/main/java/net/swofty/commons/protocol/objects/punishment/GetAllBannedIdsProtocolObject.java

Lines changed: 0 additions & 66 deletions
This file was deleted.

service.punishment/src/main/java/net/swofty/service/punishment/endpoints/GetAllBannedIdsEndpoint.java

Lines changed: 0 additions & 25 deletions
This file was deleted.

type.generic/src/main/java/net/swofty/type/generic/command/commands/UnBanCommand.java

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
package net.swofty.type.generic.command.commands;
22

3-
import net.minestom.server.command.builder.arguments.Argument;
43
import net.minestom.server.command.builder.arguments.ArgumentType;
54
import net.minestom.server.entity.Player;
65
import net.minestom.server.utils.mojang.MojangUtils;
7-
import net.minestom.server.command.builder.suggestion.SuggestionEntry;
86
import net.swofty.commons.ServiceType;
9-
import net.swofty.commons.protocol.objects.punishment.GetAllBannedIdsProtocolObject;
107
import net.swofty.commons.protocol.objects.punishment.UnpunishPlayerProtocolObject;
118
import net.swofty.proxyapi.ProxyService;
129
import net.swofty.type.generic.command.CommandParameters;
@@ -29,20 +26,7 @@ public class UnBanCommand extends HypixelCommand {
2926

3027
@Override
3128
public void registerUsage(MinestomCommand command) {
32-
Argument<String> argument = ArgumentType.String("player").setSuggestionCallback((sender, context, suggestion) -> {
33-
try {
34-
ProxyService service = new ProxyService(ServiceType.PUNISHMENT);
35-
var response = service.handleRequest(new GetAllBannedIdsProtocolObject.GetAllBannedIdsMessage())
36-
.orTimeout(2, TimeUnit.SECONDS)
37-
.join();
38-
if (response instanceof GetAllBannedIdsProtocolObject.GetAllBannedIdsResponse r) {
39-
for (String playerId : r.ids()) {
40-
suggestion.addEntry(new SuggestionEntry(playerId));
41-
}
42-
}
43-
} catch (Exception ignored) {
44-
}
45-
});
29+
var argument = ArgumentType.String("player");
4630

4731
command.addSyntax((sender, context) -> {
4832
String playerName = context.get(argument);

0 commit comments

Comments
 (0)