From 5491be4430b33b5c08fcfb28bf7f527b71b2dac8 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Tue, 6 Oct 2020 10:40:57 +0200 Subject: [PATCH] Fixing Bugs --- .../src/de/steamwar/comms/BungeeReceiver.java | 7 --- .../de/steamwar/comms/PacketIdManager.java | 2 - .../comms/packets/PluginCallbackPacket.java | 45 ------------------- 3 files changed, 54 deletions(-) delete mode 100644 SpigotCore_Main/src/de/steamwar/comms/packets/PluginCallbackPacket.java diff --git a/SpigotCore_Main/src/de/steamwar/comms/BungeeReceiver.java b/SpigotCore_Main/src/de/steamwar/comms/BungeeReceiver.java index 3778223..071a1a5 100644 --- a/SpigotCore_Main/src/de/steamwar/comms/BungeeReceiver.java +++ b/SpigotCore_Main/src/de/steamwar/comms/BungeeReceiver.java @@ -23,7 +23,6 @@ import com.google.common.io.ByteArrayDataInput; import com.google.common.io.ByteStreams; import de.steamwar.comms.handlers.BungeeHandler; import de.steamwar.comms.handlers.InventoryHandler; -import de.steamwar.comms.packets.PluginCallbackPacket; import de.steamwar.sql.*; import org.bukkit.Bukkit; import org.bukkit.Sound; @@ -34,7 +33,6 @@ import org.bukkit.plugin.messaging.PluginMessageListener; import java.util.HashMap; import java.util.Map; import java.util.UUID; -import java.util.stream.Collectors; public class BungeeReceiver implements PluginMessageListener { @@ -58,11 +56,6 @@ public class BungeeReceiver implements PluginMessageListener { Player player = Bukkit.getPlayer(SteamwarUser.get(byteArrayDataInput.readInt()).getUUID()); player.closeInventory(); }); - registerHandler(PacketIdManager.CHECK_PLUGIN, byteArrayDataInput -> { - String id = byteArrayDataInput.readUTF(); - String plugin = byteArrayDataInput.readUTF(); - new PluginCallbackPacket(id, Bukkit.getPluginManager().getPlugin(plugin) != null).send(Bukkit.getOnlinePlayers().stream().limit(1).collect(Collectors.toList()).get(0)); - }); } @Override diff --git a/SpigotCore_Main/src/de/steamwar/comms/PacketIdManager.java b/SpigotCore_Main/src/de/steamwar/comms/PacketIdManager.java index 5d9bd2e..63d0327 100644 --- a/SpigotCore_Main/src/de/steamwar/comms/PacketIdManager.java +++ b/SpigotCore_Main/src/de/steamwar/comms/PacketIdManager.java @@ -23,8 +23,6 @@ public class PacketIdManager { //0x0(X) Standalone Packets public final static byte PING_PACKET = 0x01; - public static final byte CHECK_PLUGIN = 0x02; - public static final byte CHECK_PLUGIN_CALLBACK = 0x03; //0x1(X) Bungee Inventory public final static byte INVENTORY_PACKET = 0x10; public final static byte INVENTORY_CALLBACK_PACKET = 0x11; diff --git a/SpigotCore_Main/src/de/steamwar/comms/packets/PluginCallbackPacket.java b/SpigotCore_Main/src/de/steamwar/comms/packets/PluginCallbackPacket.java deleted file mode 100644 index b4feec8..0000000 --- a/SpigotCore_Main/src/de/steamwar/comms/packets/PluginCallbackPacket.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - This file is a part of the SteamWar software. - - Copyright (C) 2020 SteamWar.de-Serverteam - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - */ - -package de.steamwar.comms.packets; - -import com.google.common.io.ByteArrayDataOutput; -import de.steamwar.comms.PacketIdManager; - -public class PluginCallbackPacket extends SpigotPacket { - - private final String id; - private final boolean hasPlugin; - - public PluginCallbackPacket(String id, boolean hasPlugin) { - this.id = id; - this.hasPlugin = hasPlugin; - } - - @Override - public int getName() { - return PacketIdManager.CHECK_PLUGIN_CALLBACK; - } - - @Override - public void writeVars(ByteArrayDataOutput byteArrayDataOutput) { - byteArrayDataOutput.writeUTF(id); - byteArrayDataOutput.writeBoolean(hasPlugin); - } -}