SteamWar/SpigotCore
Archiviert
13
0

Implement execute command packet for lobby
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
Lixfel 2022-01-02 11:36:49 +01:00
Ursprung aa412e655b
Commit 2ae3047787
2 geänderte Dateien mit 48 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -27,6 +27,7 @@ public class PacketIdManager {
public static final byte TABLIST_NAME = 0x02; public static final byte TABLIST_NAME = 0x02;
public static final byte PREPARE_SCHEM = 0x03; public static final byte PREPARE_SCHEM = 0x03;
public static final byte BAUMEMBER_UPDATE = 0x04; public static final byte BAUMEMBER_UPDATE = 0x04;
public static final byte EXECUTE_COMMAND = 0x05;
//0x1(X) Bungee Inventory //0x1(X) Bungee Inventory
public static final byte INVENTORY_PACKET = 0x10; public static final byte INVENTORY_PACKET = 0x10;
public static final byte INVENTORY_CALLBACK_PACKET = 0x11; public static final byte INVENTORY_CALLBACK_PACKET = 0x11;

Datei anzeigen

@ -0,0 +1,47 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2021 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;
import de.steamwar.sql.SteamwarUser;
import org.bukkit.entity.Player;
public class ExecuteCommandPacket extends SpigotPacket {
private final SteamwarUser user;
private final String command;
public ExecuteCommandPacket(Player player, String command) {
this.user = SteamwarUser.get(player.getUniqueId());
this.command = command;
}
@Override
public int getName() {
return PacketIdManager.EXECUTE_COMMAND;
}
@Override
public void writeVars(ByteArrayDataOutput out) {
out.writeInt(user.getId());
out.writeUTF(command);
}
}