Updating commands and Packet API

- Added wrapper for PacketHandshakeInSetProtocol
- Took ProtocolAPI from Atlas to implement ViaVersion and ProtocolSupport version checking hooks.
- Added hook into "Login" style packets.
- Wth this new hook, we get player version numbers and store them by Channel now.
- Packets are now initialized in the same join listener as where APlayer is generated in JoinListener class.
- Removed Listener extension from HandlerAbstract, ModernHandler, LegacvHandler

NOTE: Protocol version grabbing needs implemented for LegacyHandler (1.7.10 version)
This commit is contained in:
Dawson
2022-08-11 12:27:16 -04:00
parent 0c3066103c
commit 234744e98d
17 changed files with 308 additions and 72 deletions
@@ -18,7 +18,7 @@ import java.util.Comparator;
import java.util.stream.Collectors;
@Init(priority = Priority.LOW)
@CommandAlias("anticheat")
@CommandAlias("anticheat|ac")
@CommandPermission("anticheat.command")
public class AnticheatCommand extends BaseCommand {
@@ -74,4 +74,25 @@ public class AnticheatCommand extends BaseCommand {
pl.spigot().sendMessage(Messages.ALERTS_ON);
}
}
@Subcommand("playerinfo|info|pi")
@Description("Get player's information")
@Syntax("[player]")
@CommandCompletion("@players")
@CommandPermission("anticheat.command.info")
public void onCommand(CommandSender sender, @Single Player target) {
Anticheat.INSTANCE.getScheduler().execute(() -> {
APlayer player = Anticheat.INSTANCE.getPlayerRegistry().getPlayer(target.getUniqueId()).orElse(null);
if(player == null) {
sender.spigot().sendMessage(Messages.NULL_APLAYER);
return;
}
sender.sendMessage(MiscUtils.line(Color.Dark_Gray));
sender.sendMessage(Color.translate("&6&lPing&8: &f" + player.getLagInfo().getTransPing() * 50 + "ms"));
sender.sendMessage(Color.translate("&6&lVersion&8: &f" + player.getPlayerVersion().name()));
sender.sendMessage(MiscUtils.line(Color.Dark_Gray));
});
}
}