2.8.8
This update fixes a security vulnerability where players with modified clients could intercept all commands. This bug affects the proxy (Bungee, Waterfall etc.)!
This commit is contained in:
parent
abe9cfbe76
commit
fa1af88777
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>net.t2code</groupId>
|
<groupId>net.t2code</groupId>
|
||||||
<artifactId>CommandGUI_V2</artifactId>
|
<artifactId>CommandGUI_V2</artifactId>
|
||||||
<version>2.8.7</version>
|
<version>2.8.8</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>CommandGUI</name>
|
<name>CommandGUI</name>
|
||||||
|
@ -16,7 +16,7 @@ public class BListener implements Listener {
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPluginmessage(PluginMessageEvent event) {
|
public void onPluginmessage(PluginMessageEvent event) {
|
||||||
if (event.getTag().equalsIgnoreCase("cgui:bungee")) {
|
if (event.getTag().equalsIgnoreCase("cgui:bungee")) {
|
||||||
|
event.setCancelled(true);
|
||||||
DataInputStream stream = new DataInputStream(new ByteArrayInputStream(event.getData()));
|
DataInputStream stream = new DataInputStream(new ByteArrayInputStream(event.getData()));
|
||||||
try {
|
try {
|
||||||
String channel = stream.readUTF();
|
String channel = stream.readUTF();
|
||||||
@ -41,25 +41,12 @@ public class BListener implements Listener {
|
|||||||
public void onJoin(PostLoginEvent e) {
|
public void onJoin(PostLoginEvent e) {
|
||||||
ProxiedPlayer player = e.getPlayer();
|
ProxiedPlayer player = e.getPlayer();
|
||||||
sendToSpigotPlayer(player.getName(), true);
|
sendToSpigotPlayer(player.getName(), true);
|
||||||
/*
|
|
||||||
if (BMySQL.Enable) {
|
|
||||||
BMySQL.query("INSERT INTO `gui-bungeeplayer` (`UUID`, `Name`, `Online`) VALUES ('" + player.getUniqueId() + "', '" + player.getName()
|
|
||||||
+ "', 'true') ON DUPLICATE KEY UPDATE `Name` = '" + player.getName() + "', `Online` = 'true';");
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onDisconnect(PlayerDisconnectEvent e) {
|
public void onDisconnect(PlayerDisconnectEvent e) {
|
||||||
ProxiedPlayer player = e.getPlayer();
|
ProxiedPlayer player = e.getPlayer();
|
||||||
sendToSpigotPlayer(e.getPlayer().getName(), false);
|
sendToSpigotPlayer(e.getPlayer().getName(), false);
|
||||||
/*
|
|
||||||
if (BMySQL.Enable) {
|
|
||||||
BMySQL.query("INSERT INTO `gui-bungeeplayer` (`UUID`, `Name`, `Online`) VALUES ('" + player.getUniqueId() + "', '" + player.getName()
|
|
||||||
+ "', 'true') ON DUPLICATE KEY UPDATE `Name` = '" + player.getName() + "', `Online` = 'false';");
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void sendToSpigotPlayer(String name, Boolean join) {
|
public static void sendToSpigotPlayer(String name, Boolean join) {
|
||||||
|
@ -42,7 +42,6 @@ public class GUIListener implements Listener {
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void onInventoryClick(InventoryClickEvent e) {
|
public void onInventoryClick(InventoryClickEvent e) {
|
||||||
Player player = (Player) e.getWhoClicked();
|
Player player = (Player) e.getWhoClicked();
|
||||||
JavaPlugin plugin = Main.getPlugin();
|
|
||||||
if (e.getInventory() == null) return;
|
if (e.getInventory() == null) return;
|
||||||
if (e.getCurrentItem() == null) return;
|
if (e.getCurrentItem() == null) return;
|
||||||
for (Gui gui : Main.guiHashMap.values()) {
|
for (Gui gui : Main.guiHashMap.values()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user