geforkt von SteamWar/BungeeCore
Implement execute command handler for lobby
Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Ursprung
b330b83ea2
Commit
f75e24787f
@ -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;
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
36
src/de/steamwar/bungeecore/comms/handlers/ExecuteCommandHandler.java
Normale Datei
36
src/de/steamwar/bungeecore/comms/handlers/ExecuteCommandHandler.java
Normale Datei
@ -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);
|
||||
}
|
||||
}
|
In neuem Issue referenzieren
Einen Benutzer sperren