Archiviert
1
0

Merge pull request 'Implement execute command handler for lobby' (#290) from executeCommandPacket into master

Reviewed-on: SteamWar/BungeeCore#290
Reviewed-by: YoyoNow <jwsteam@nidido.de>
Dieser Commit ist enthalten in:
Lixfel 2022-01-02 11:54:18 +01:00
Commit 456d0a4ed0
3 geänderte Dateien mit 38 neuen und 0 gelöschten Zeilen

Datei anzeigen

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

Datei anzeigen

@ -58,5 +58,6 @@ public class SpigotReceiver extends BasicListener {
registerHandler(PacketIdManager.PREPARE_SCHEM, new PrepareSchemHandler());
registerHandler(PacketIdManager.I_AM_A_LOBBY, new ImALobbyHandler());
registerHandler(PacketIdManager.FIGHT_INFO, new FightInfoHandler());
registerHandler(PacketIdManager.EXECUTE_COMMAND, new ExecuteCommandHandler());
}
}

Datei anzeigen

@ -0,0 +1,36 @@
/*
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.bungeecore.comms.handlers;
import com.google.common.io.ByteArrayDataInput;
import de.steamwar.bungeecore.comms.SpigotHandler;
import de.steamwar.bungeecore.sql.SteamwarUser;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.config.ServerInfo;
public class ExecuteCommandHandler implements SpigotHandler {
@Override
public void handle(ByteArrayDataInput in, ServerInfo info) {
SteamwarUser target = SteamwarUser.get(in.readInt());
String command = in.readUTF();
ProxyServer.getInstance().getPluginManager().dispatchCommand(ProxyServer.getInstance().getPlayer(target.getUuid()), command);
}
}