SteamWar/SpigotCore
Archiviert
13
0
Dieser Commit ist enthalten in:
Chaoscaot 2020-10-06 10:40:57 +02:00
Ursprung 3472f71102
Commit 5491be4430
3 geänderte Dateien mit 0 neuen und 54 gelöschten Zeilen

Datei anzeigen

@ -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

Datei anzeigen

@ -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;

Datei anzeigen

@ -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 <https://www.gnu.org/licenses/>.
*/
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);
}
}