(1.3.1) Fix java players on MC 1.13+ kicked by EaglerXBungee
This commit is contained in:
parent
12b8177f5e
commit
daf4cec182
|
@ -44,6 +44,7 @@ The settings.yml file is primarily used for configuring the built-in skin and ca
|
|||
- **`disable_fnaw_skins_everywhere:`** Boolean, default value is `false`, can be used to globally disable FNAW skins if your players bitch about them a lot and are too lazy to just disable the FNAW skins locally on their clients.
|
||||
- **`disable_fnaw_skins_on_servers:`** List of strings, default value is nothing (`[]`), contains a list of names of registered servers on your BungeeCord proxy that the FNAW skins should be disabled on. Good for explicitly disabling them for PVP but allowing them everywhere else.
|
||||
- **`enable_backend_rpc_api:`** Boolean, default value is `false`, if support for servers running the EaglerXBukkitAPI plugin should be enabled or not.
|
||||
- **use_modernized_channel_names:`** Boolean, default value is `false`, if "modernized" plugin channel names compatible with Minecraft 1.13+ should be used for EaglerXBukkitAPI plugin message packets
|
||||
|
||||
### `listeners.yml`
|
||||
|
||||
|
|
Binary file not shown.
|
@ -151,6 +151,8 @@ public class EaglerXBungee extends Plugin {
|
|||
}
|
||||
getProxy().registerChannel(EaglerBackendRPCProtocol.CHANNEL_NAME);
|
||||
getProxy().registerChannel(EaglerBackendRPCProtocol.CHANNEL_NAME_READY);
|
||||
getProxy().registerChannel(EaglerBackendRPCProtocol.CHANNEL_NAME_MODERN);
|
||||
getProxy().registerChannel(EaglerBackendRPCProtocol.CHANNEL_NAME_READY_MODERN);
|
||||
getProxy().registerChannel(EaglerPacketEventListener.GET_DOMAIN_CHANNEL);
|
||||
startListeners();
|
||||
if(closeInactiveConnections != null) {
|
||||
|
@ -242,6 +244,7 @@ public class EaglerXBungee extends Plugin {
|
|||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
stopListeners();
|
||||
PluginManager mgr = getProxy().getPluginManager();
|
||||
mgr.unregisterListeners(this);
|
||||
mgr.unregisterCommands(this);
|
||||
|
@ -250,8 +253,9 @@ public class EaglerXBungee extends Plugin {
|
|||
}
|
||||
getProxy().unregisterChannel(EaglerBackendRPCProtocol.CHANNEL_NAME);
|
||||
getProxy().unregisterChannel(EaglerBackendRPCProtocol.CHANNEL_NAME_READY);
|
||||
getProxy().unregisterChannel(EaglerBackendRPCProtocol.CHANNEL_NAME_MODERN);
|
||||
getProxy().unregisterChannel(EaglerBackendRPCProtocol.CHANNEL_NAME_READY_MODERN);
|
||||
getProxy().unregisterChannel(EaglerPacketEventListener.GET_DOMAIN_CHANNEL);
|
||||
stopListeners();
|
||||
if(closeInactiveConnections != null) {
|
||||
closeInactiveConnections.cancel();
|
||||
closeInactiveConnections = null;
|
||||
|
@ -264,10 +268,14 @@ public class EaglerXBungee extends Plugin {
|
|||
updateServiceTasks.cancel();
|
||||
updateServiceTasks = null;
|
||||
}
|
||||
skinService.shutdown();
|
||||
skinService = null;
|
||||
capeService.shutdown();
|
||||
capeService = null;
|
||||
if(skinService != null) {
|
||||
skinService.shutdown();
|
||||
skinService = null;
|
||||
}
|
||||
if(capeService != null) {
|
||||
capeService.shutdown();
|
||||
capeService = null;
|
||||
}
|
||||
if(defaultAuthSystem != null) {
|
||||
defaultAuthSystem.destroy();
|
||||
defaultAuthSystem = null;
|
||||
|
|
|
@ -190,6 +190,7 @@ public class EaglerBungeeConfig {
|
|||
boolean disableFNAWSkinsEverywhere = configYml.getBoolean("disable_fnaw_skins_everywhere", false);
|
||||
Set<String> disableFNAWSkinsOnServers = new HashSet<>((Collection<String>)configYml.getList("disable_fnaw_skins_on_servers"));
|
||||
boolean enableBackendRPCAPI = configYml.getBoolean("enable_backend_rpc_api", false);
|
||||
boolean useModernizedChannelNames = configYml.getBoolean("use_modernized_channel_names", false);
|
||||
|
||||
final EaglerBungeeConfig ret = new EaglerBungeeConfig(serverName, serverUUID, websocketKeepAliveTimeout,
|
||||
websocketHandshakeTimeout, builtinHttpServerTimeout, websocketCompressionLevel, serverListeners,
|
||||
|
@ -197,7 +198,8 @@ public class EaglerBungeeConfig {
|
|||
skinRateLimitPlayer, skinRateLimitGlobal, skinCacheURI, keepObjectsDays, keepProfilesDays, maxObjects,
|
||||
maxProfiles, antagonistsRateLimit, sqliteDriverClass, sqliteDriverPath, eaglerPlayersVanillaSkin,
|
||||
enableIsEaglerPlayerProperty, authConfig, updatesConfig, iceServers, voiceChat, disableVoiceOnServers,
|
||||
disableFNAWSkinsEverywhere, disableFNAWSkinsOnServers, enableBackendRPCAPI, pauseMenuConfig);
|
||||
disableFNAWSkinsEverywhere, disableFNAWSkinsOnServers, enableBackendRPCAPI, useModernizedChannelNames,
|
||||
pauseMenuConfig);
|
||||
|
||||
if(eaglerPlayersVanillaSkin != null) {
|
||||
VanillaDefaultSkinProfileLoader.lookupVanillaSkinUser(ret);
|
||||
|
@ -333,6 +335,7 @@ public class EaglerBungeeConfig {
|
|||
private final boolean disableFNAWSkinsEverywhere;
|
||||
private final Set<String> disableFNAWSkinsOnServers;
|
||||
private final boolean enableBackendRPCAPI;
|
||||
private final boolean useModernizedChannelNames;
|
||||
private final EaglerPauseMenuConfig pauseMenuConf;
|
||||
private boolean isCrackedFlag;
|
||||
Property[] eaglerPlayersVanillaSkinCached = new Property[] { isEaglerProperty };
|
||||
|
@ -504,6 +507,10 @@ public class EaglerBungeeConfig {
|
|||
return enableBackendRPCAPI;
|
||||
}
|
||||
|
||||
public boolean getUseModernizedChannelNames() {
|
||||
return useModernizedChannelNames;
|
||||
}
|
||||
|
||||
public EaglerPauseMenuConfig getPauseMenuConf() {
|
||||
return pauseMenuConf;
|
||||
}
|
||||
|
@ -518,7 +525,7 @@ public class EaglerBungeeConfig {
|
|||
boolean enableIsEaglerPlayerProperty, EaglerAuthConfig authConfig, EaglerUpdateConfig updateConfig,
|
||||
Collection<String> iceServers, boolean enableVoiceChat, Set<String> disableVoiceOnServers,
|
||||
boolean disableFNAWSkinsEverywhere, Set<String> disableFNAWSkinsOnServers,
|
||||
boolean enableBackendRPCAPI, EaglerPauseMenuConfig pauseMenuConf) {
|
||||
boolean enableBackendRPCAPI, boolean useModernizedChannelNames, EaglerPauseMenuConfig pauseMenuConf) {
|
||||
this.serverName = serverName;
|
||||
this.serverUUID = serverUUID;
|
||||
this.serverListeners = serverListeners;
|
||||
|
@ -551,6 +558,7 @@ public class EaglerBungeeConfig {
|
|||
this.disableFNAWSkinsEverywhere = disableFNAWSkinsEverywhere;
|
||||
this.disableFNAWSkinsOnServers = disableFNAWSkinsOnServers;
|
||||
this.enableBackendRPCAPI = enableBackendRPCAPI;
|
||||
this.useModernizedChannelNames = useModernizedChannelNames;
|
||||
this.pauseMenuConf = pauseMenuConf;
|
||||
}
|
||||
|
||||
|
|
|
@ -81,12 +81,12 @@ public class EaglerPacketEventListener implements Listener {
|
|||
}
|
||||
}
|
||||
}
|
||||
if(tag.equals(EaglerBackendRPCProtocol.CHANNEL_NAME)) {
|
||||
if(tag.equals(EaglerBackendRPCProtocol.CHANNEL_NAME) || tag.equals(EaglerBackendRPCProtocol.CHANNEL_NAME_MODERN)) {
|
||||
event.getSender().disconnect(new TextComponent("Nope!"));
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
if(tag.equals(EaglerBackendRPCProtocol.CHANNEL_NAME_READY)) {
|
||||
if(tag.equals(EaglerBackendRPCProtocol.CHANNEL_NAME_READY) || tag.equals(EaglerBackendRPCProtocol.CHANNEL_NAME_READY_MODERN)) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ public class EaglerPacketEventListener implements Listener {
|
|||
String tag = event.getTag();
|
||||
if(player.getPendingConnection() instanceof EaglerInitialHandler) {
|
||||
EaglerInitialHandler initialHandler = (EaglerInitialHandler)player.getPendingConnection();
|
||||
if(EaglerBackendRPCProtocol.CHANNEL_NAME.equals(tag)) {
|
||||
if(EaglerBackendRPCProtocol.CHANNEL_NAME.equals(tag) || tag.equals(EaglerBackendRPCProtocol.CHANNEL_NAME_MODERN)) {
|
||||
event.setCancelled(true);
|
||||
try {
|
||||
initialHandler.handleBackendRPCPacket((Server)event.getSender(), event.getData());
|
||||
|
@ -113,7 +113,7 @@ public class EaglerPacketEventListener implements Listener {
|
|||
}
|
||||
}
|
||||
}else {
|
||||
if(EaglerBackendRPCProtocol.CHANNEL_NAME.equals(tag)) {
|
||||
if(EaglerBackendRPCProtocol.CHANNEL_NAME.equals(tag) || tag.equals(EaglerBackendRPCProtocol.CHANNEL_NAME_MODERN)) {
|
||||
event.setCancelled(true);
|
||||
try {
|
||||
BackendRPCSessionHandler.handlePacketOnVanilla((Server) event.getSender(),
|
||||
|
|
|
@ -37,6 +37,7 @@ import net.lax1dude.eaglercraft.v1_8.plugin.gateway_bungeecord.api.EaglerXBungee
|
|||
import net.lax1dude.eaglercraft.v1_8.plugin.gateway_bungeecord.config.EaglerBungeeConfig;
|
||||
import net.lax1dude.eaglercraft.v1_8.plugin.gateway_bungeecord.config.EaglerListenerConfig;
|
||||
import net.lax1dude.eaglercraft.v1_8.plugin.gateway_bungeecord.server.EaglerInitialHandler.ClientCertificateHolder;
|
||||
import net.lax1dude.eaglercraft.v1_8.plugin.gateway_bungeecord.server.backend_rpc_protocol.BackendRPCSessionHandler;
|
||||
import net.lax1dude.eaglercraft.v1_8.plugin.gateway_bungeecord.server.web.HttpWebServer;
|
||||
import net.lax1dude.eaglercraft.v1_8.socket.protocol.pkt.GameMessagePacket;
|
||||
import net.lax1dude.eaglercraft.v1_8.socket.protocol.pkt.server.SPacketEnableFNAWSkinsEAG;
|
||||
|
@ -295,7 +296,7 @@ public class EaglerPipeline {
|
|||
private static void handleServerConnectionReady(UserConnection userConnection) {
|
||||
try {
|
||||
ServerConnection server = userConnection.getServer();
|
||||
server.sendData(EaglerBackendRPCProtocol.CHANNEL_NAME_READY, ArrayUtils.EMPTY_BYTE_ARRAY);
|
||||
server.sendData(BackendRPCSessionHandler.getReadyChNameFor(server), ArrayUtils.EMPTY_BYTE_ARRAY);
|
||||
if(userConnection.getPendingConnection() instanceof EaglerInitialHandler) {
|
||||
EaglerInitialHandler handler = (EaglerInitialHandler) userConnection.getPendingConnection();
|
||||
ServerInfo sv = server.getInfo();
|
||||
|
|
|
@ -27,6 +27,7 @@ import net.lax1dude.eaglercraft.v1_8.plugin.gateway_bungeecord.server.EaglerInit
|
|||
import net.lax1dude.eaglercraft.v1_8.plugin.gateway_bungeecord.voice.VoiceService;
|
||||
import net.lax1dude.eaglercraft.v1_8.socket.protocol.util.ReusableByteArrayInputStream;
|
||||
import net.lax1dude.eaglercraft.v1_8.socket.protocol.util.ReusableByteArrayOutputStream;
|
||||
import net.md_5.bungee.ServerConnection;
|
||||
import net.md_5.bungee.UserConnection;
|
||||
import net.md_5.bungee.api.config.ServerInfo;
|
||||
import net.md_5.bungee.api.connection.Server;
|
||||
|
@ -54,6 +55,7 @@ public class BackendRPCSessionHandler {
|
|||
|
||||
protected final EaglerInitialHandler eaglerHandler;
|
||||
private Server currentServer = null;
|
||||
private String channelName = null;
|
||||
private EaglerBackendRPCProtocol currentProtocol = null;
|
||||
private EaglerBackendRPCHandler currentHandler = null;
|
||||
private int subscribedEvents = 0;
|
||||
|
@ -150,7 +152,7 @@ public class BackendRPCSessionHandler {
|
|||
+ packet.getClass().getSimpleName() + " was the wrong length for user \""
|
||||
+ eaglerHandler.getName() + "\" after serialization: " + ret.length + " != " + len);
|
||||
}
|
||||
server.sendData(EaglerBackendRPCProtocol.CHANNEL_NAME, ret);
|
||||
server.sendData(channelName, ret);
|
||||
}
|
||||
|
||||
public void handleConnectionLost(ServerInfo server) {
|
||||
|
@ -161,6 +163,7 @@ public class BackendRPCSessionHandler {
|
|||
|
||||
private void handleDestroyContext() {
|
||||
currentServer = null;
|
||||
channelName = null;
|
||||
currentProtocol = null;
|
||||
currentHandler = null;
|
||||
subscribedEvents = 0;
|
||||
|
@ -178,6 +181,7 @@ public class BackendRPCSessionHandler {
|
|||
if(!(packet instanceof CPacketRPCEnabled)) {
|
||||
throw new WrongRPCPacketException();
|
||||
}
|
||||
channelName = getChNameFor((ServerConnection)server);
|
||||
if(!ArrayUtils.contains(((CPacketRPCEnabled)packet).supportedProtocols, EaglerBackendRPCProtocol.V1.vers)) {
|
||||
EaglerXBungee.logger().severe("[" + eaglerHandler.getSocketAddress()
|
||||
+ "]: Unsupported backend RPC protocol version for user \"" + eaglerHandler.getName() + "\"");
|
||||
|
@ -217,7 +221,7 @@ public class BackendRPCSessionHandler {
|
|||
EaglerXBungee.logger().severe("(Note: this player is not using Eaglercraft!)");
|
||||
return;
|
||||
}
|
||||
server.sendData(EaglerBackendRPCProtocol.CHANNEL_NAME, bao.toByteArray());
|
||||
server.sendData(getChNameFor((ServerConnection)server), bao.toByteArray());
|
||||
return;
|
||||
}
|
||||
EaglerXBungee.logger().warning("[" + player.getSocketAddress()
|
||||
|
@ -232,7 +236,7 @@ public class BackendRPCSessionHandler {
|
|||
+ "]: Failed to write backend RPC protocol version for user \"" + player.getName() + "\"", ex);
|
||||
return;
|
||||
}
|
||||
server.sendData(EaglerBackendRPCProtocol.CHANNEL_NAME, bao.toByteArray());
|
||||
server.sendData(getChNameFor((ServerConnection)server), bao.toByteArray());
|
||||
}
|
||||
|
||||
public void setSubscribedEvents(int eventsToEnable) {
|
||||
|
@ -292,4 +296,24 @@ public class BackendRPCSessionHandler {
|
|||
}
|
||||
}
|
||||
|
||||
private static int getVerSafe(ServerConnection server) {
|
||||
try {
|
||||
return server.getCh().getEncodeVersion();
|
||||
}catch(Throwable t) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
public static String getChNameFor(ServerConnection server) {
|
||||
return (EaglerXBungee.getEagler().getConfig().getUseModernizedChannelNames() || getVerSafe(server) >= 393)
|
||||
? EaglerBackendRPCProtocol.CHANNEL_NAME_MODERN
|
||||
: EaglerBackendRPCProtocol.CHANNEL_NAME;
|
||||
}
|
||||
|
||||
public static String getReadyChNameFor(ServerConnection server) {
|
||||
return (EaglerXBungee.getEagler().getConfig().getUseModernizedChannelNames() || getVerSafe(server) >= 393)
|
||||
? EaglerBackendRPCProtocol.CHANNEL_NAME_READY_MODERN
|
||||
: EaglerBackendRPCProtocol.CHANNEL_NAME_READY;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -25,3 +25,4 @@ disable_voice_chat_on_servers: []
|
|||
disable_fnaw_skins_everywhere: false
|
||||
disable_fnaw_skins_on_servers: []
|
||||
enable_backend_rpc_api: false
|
||||
use_modernized_channel_names: false
|
|
@ -1,5 +1,5 @@
|
|||
name: EaglercraftXBungee
|
||||
main: net.lax1dude.eaglercraft.v1_8.plugin.gateway_bungeecord.EaglerXBungee
|
||||
version: 1.3.0
|
||||
version: 1.3.1
|
||||
description: Plugin to allow EaglercraftX 1.8 players to join your network, or allow EaglercraftX 1.8 players to use your network as a proxy to join other networks
|
||||
author: lax1dude
|
|
@ -1 +1 @@
|
|||
1.3.0
|
||||
1.3.1
|
Loading…
Reference in New Issue
Block a user