From 1763a5ca29a7ef8243351abfef596e5777bfdc80 Mon Sep 17 00:00:00 2001 From: HacktheTime Date: Fri, 29 Sep 2023 21:17:12 +0200 Subject: changed all Internal Commands over to InternalCommandPackets --- .../java/de/hype/bbsentials/packets/PacketManager.java | 2 +- .../bbsentials/packets/packets/InternalCommandPacket.java | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) (limited to 'src/main/java/de/hype/bbsentials/packets') diff --git a/src/main/java/de/hype/bbsentials/packets/PacketManager.java b/src/main/java/de/hype/bbsentials/packets/PacketManager.java index 6e1d01c..cda4315 100644 --- a/src/main/java/de/hype/bbsentials/packets/PacketManager.java +++ b/src/main/java/de/hype/bbsentials/packets/PacketManager.java @@ -28,7 +28,7 @@ public class PacketManager { packets.add(new Packet<>(ChChestPacket.class, connection::onChChestPacket)); packets.add(new Packet<>(DisconnectPacket.class, connection::onDisconnectPacket)); packets.add(new Packet<>(DisplayTellrawMessagePacket.class, connection::onDisplayTellrawMessagePacket)); -// packets.add(new Packet<>(InternalCommandPacket.class, connection::dummy)); + packets.add(new Packet<>(InternalCommandPacket.class, connection::onInternalCommandPacket)); packets.add(new Packet<>(InvalidCommandFeedbackPacket.class, connection::onInvalidCommandFeedbackPacket)); packets.add(new Packet<>(MiningEventPacket.class, connection::onMiningEventPacket)); packets.add(new Packet<>(PartyPacket.class, connection::onPartyPacket)); diff --git a/src/main/java/de/hype/bbsentials/packets/packets/InternalCommandPacket.java b/src/main/java/de/hype/bbsentials/packets/packets/InternalCommandPacket.java index 077e3d4..a5ae416 100644 --- a/src/main/java/de/hype/bbsentials/packets/packets/InternalCommandPacket.java +++ b/src/main/java/de/hype/bbsentials/packets/packets/InternalCommandPacket.java @@ -4,6 +4,21 @@ import de.hype.bbsentials.packets.AbstractPacket; //Only used for small things which don't really need an own Packet. public class InternalCommandPacket extends AbstractPacket { + public static final String REQUEST_POT_DURATION= "potDuration?"; + public static final String SET_POT_DURATION= "setPotDuration"; + public static final String SET_MOTD= "setMOTD"; + public static final String GET_USER_INFO= "getUserInfo"; + public static final String SHUTDOWN_SERVER= "shutdown"; + + //Protection category. The following things can only be activated by people with server console access and an code understanding. + public static final String CRASH= "crash"; + public static final String INSTACRASH= "immediateCrash"; + public static final String HUB= "hub"; + public static final String PRIVATE_ISLAND= "is"; + public static final String HIDDEN_HUB= "hidden_Hub"; + public static final String HIDDEN_PRIVATE_ISLAND= "hidden_is"; + public static final String SELFDESTRUCT= "destroy"; //used when someone may not sue the mod in the future anymore + public static final String PEACEFULLDESTRUCT= "silentDestroy"; //Used when The game should not crash, when the mod was removed public InternalCommandPacket(String command, String[] parameters) { super(1, 1); //Min and Max supported Version -- cgit