mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Rename HYBRID AuthType back to FLOODGATE
This commit is contained in:
parent
43f23674d6
commit
f2e606c0f3
10 changed files with 17 additions and 17 deletions
|
@ -28,7 +28,7 @@ package org.geysermc.geyser.api.network;
|
|||
public enum AuthType {
|
||||
OFFLINE,
|
||||
ONLINE,
|
||||
HYBRID;
|
||||
FLOODGATE;
|
||||
|
||||
public static final AuthType[] VALUES = values();
|
||||
|
||||
|
|
|
@ -109,13 +109,13 @@ public class GeyserBungeePlugin extends Plugin implements GeyserBootstrap {
|
|||
return;
|
||||
}
|
||||
|
||||
if (geyserConfig.getRemote().getAuthType() == AuthType.HYBRID && getProxy().getPluginManager().getPlugin("floodgate") == null) {
|
||||
if (geyserConfig.getRemote().getAuthType() == AuthType.FLOODGATE && getProxy().getPluginManager().getPlugin("floodgate") == null) {
|
||||
geyserLogger.severe(GeyserLocale.getLocaleStringLog("geyser.bootstrap.floodgate.not_installed") + " " + GeyserLocale.getLocaleStringLog("geyser.bootstrap.floodgate.disabling"));
|
||||
return;
|
||||
} else if (geyserConfig.isAutoconfiguredRemote() && getProxy().getPluginManager().getPlugin("floodgate") != null) {
|
||||
// Floodgate installed means that the user wants Floodgate authentication
|
||||
geyserLogger.debug("Auto-setting to Floodgate authentication.");
|
||||
geyserConfig.getRemote().setAuthType(AuthType.HYBRID);
|
||||
geyserConfig.getRemote().setAuthType(AuthType.FLOODGATE);
|
||||
}
|
||||
|
||||
geyserConfig.loadFloodgate(this);
|
||||
|
|
|
@ -139,14 +139,14 @@ public class GeyserSpigotPlugin extends JavaPlugin implements GeyserBootstrap {
|
|||
return;
|
||||
}
|
||||
|
||||
if (geyserConfig.getRemote().getAuthType() == AuthType.HYBRID && Bukkit.getPluginManager().getPlugin("floodgate") == null) {
|
||||
if (geyserConfig.getRemote().getAuthType() == AuthType.FLOODGATE && Bukkit.getPluginManager().getPlugin("floodgate") == null) {
|
||||
geyserLogger.severe(GeyserLocale.getLocaleStringLog("geyser.bootstrap.floodgate.not_installed") + " " + GeyserLocale.getLocaleStringLog("geyser.bootstrap.floodgate.disabling"));
|
||||
this.getPluginLoader().disablePlugin(this);
|
||||
return;
|
||||
} else if (geyserConfig.isAutoconfiguredRemote() && Bukkit.getPluginManager().getPlugin("floodgate") != null) {
|
||||
// Floodgate installed means that the user wants Floodgate authentication
|
||||
geyserLogger.debug("Auto-setting to Floodgate authentication.");
|
||||
geyserConfig.getRemote().setAuthType(AuthType.HYBRID);
|
||||
geyserConfig.getRemote().setAuthType(AuthType.FLOODGATE);
|
||||
}
|
||||
|
||||
geyserConfig.loadFloodgate(this);
|
||||
|
|
|
@ -128,14 +128,14 @@ public class GeyserVelocityPlugin implements GeyserBootstrap {
|
|||
} catch (ClassNotFoundException ignored) {
|
||||
}
|
||||
|
||||
if (geyserConfig.getRemote().getAuthType() == AuthType.HYBRID && proxyServer.getPluginManager().getPlugin("floodgate").isEmpty()) {
|
||||
if (geyserConfig.getRemote().getAuthType() == AuthType.FLOODGATE && proxyServer.getPluginManager().getPlugin("floodgate").isEmpty()) {
|
||||
geyserLogger.severe(GeyserLocale.getLocaleStringLog("geyser.bootstrap.floodgate.not_installed") + " "
|
||||
+ GeyserLocale.getLocaleStringLog("geyser.bootstrap.floodgate.disabling"));
|
||||
return;
|
||||
} else if (geyserConfig.isAutoconfiguredRemote() && proxyServer.getPluginManager().getPlugin("floodgate").isPresent()) {
|
||||
// Floodgate installed means that the user wants Floodgate authentication
|
||||
geyserLogger.debug("Auto-setting to Floodgate authentication.");
|
||||
geyserConfig.getRemote().setAuthType(AuthType.HYBRID);
|
||||
geyserConfig.getRemote().setAuthType(AuthType.FLOODGATE);
|
||||
}
|
||||
|
||||
geyserConfig.loadFloodgate(this, proxyServer, configFolder.toFile());
|
||||
|
|
|
@ -34,7 +34,7 @@ import java.nio.file.Path;
|
|||
|
||||
public class FloodgateKeyLoader {
|
||||
public static Path getKeyPath(GeyserJacksonConfiguration config, Path floodgateDataFolder, Path geyserDataFolder, GeyserLogger logger) {
|
||||
if (config.getRemote().getAuthType() != AuthType.HYBRID) {
|
||||
if (config.getRemote().getAuthType() != AuthType.FLOODGATE) {
|
||||
return geyserDataFolder.resolve(config.getFloodgateKeyFile());
|
||||
}
|
||||
|
||||
|
|
|
@ -235,7 +235,7 @@ public class GeyserImpl implements GeyserApi {
|
|||
|
||||
if (platformType == PlatformType.STANDALONE) {
|
||||
logger.warning(GeyserLocale.getLocaleStringLog("geyser.core.movement_warn"));
|
||||
} else if (config.getRemote().getAuthType() == AuthType.HYBRID) {
|
||||
} else if (config.getRemote().getAuthType() == AuthType.FLOODGATE) {
|
||||
VersionCheckUtils.checkForOutdatedFloodgate(logger);
|
||||
}
|
||||
}
|
||||
|
@ -293,7 +293,7 @@ public class GeyserImpl implements GeyserApi {
|
|||
// Ensure that PacketLib does not create an event loop for handling packets; we'll do that ourselves
|
||||
TcpSession.USE_EVENT_LOOP_FOR_PACKETS = false;
|
||||
|
||||
if (config.getRemote().getAuthType() == AuthType.HYBRID) {
|
||||
if (config.getRemote().getAuthType() == AuthType.FLOODGATE) {
|
||||
try {
|
||||
Key key = new AesKeyProducer().produceFrom(config.getFloodgateKeyPath());
|
||||
cipher = new AesCipher(new Base64Topping());
|
||||
|
|
|
@ -667,7 +667,7 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
|
|||
// However, this doesn't affect the final username as Floodgate is still in charge of that.
|
||||
// So if you have (for example) replace spaces enabled on Floodgate the spaces will re-appear.
|
||||
String validUsername = username;
|
||||
if (this.remoteServer.authType() == AuthType.HYBRID) {
|
||||
if (this.remoteServer.authType() == AuthType.FLOODGATE) {
|
||||
validUsername = username.replace(' ', '_');
|
||||
}
|
||||
|
||||
|
@ -824,7 +824,7 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
|
|||
* After getting whatever credentials needed, we attempt to join the Java server.
|
||||
*/
|
||||
private void connectDownstream() {
|
||||
boolean floodgate = this.remoteServer.authType() == AuthType.HYBRID;
|
||||
boolean floodgate = this.remoteServer.authType() == AuthType.FLOODGATE;
|
||||
|
||||
// Start ticking
|
||||
tickThread = eventLoop.scheduleAtFixedRate(this::tick, 50, 50, TimeUnit.MILLISECONDS);
|
||||
|
@ -920,7 +920,7 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
|
|||
UUID uuid = protocol.getProfile().getId();
|
||||
if (uuid == null) {
|
||||
// Set what our UUID *probably* is going to be
|
||||
if (remoteServer.authType() == AuthType.HYBRID) {
|
||||
if (remoteServer.authType() == AuthType.FLOODGATE) {
|
||||
uuid = new UUID(0, Long.parseLong(authData.xuid()));
|
||||
} else {
|
||||
uuid = UUID.nameUUIDFromBytes(("OfflinePlayer:" + protocol.getProfile().getName()).getBytes(StandardCharsets.UTF_8));
|
||||
|
@ -950,7 +950,7 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
|
|||
String disconnectMessage;
|
||||
Throwable cause = event.getCause();
|
||||
if (cause instanceof UnexpectedEncryptionException) {
|
||||
if (remoteServer.authType() != AuthType.HYBRID) {
|
||||
if (remoteServer.authType() != AuthType.FLOODGATE) {
|
||||
// Server expects online mode
|
||||
disconnectMessage = GeyserLocale.getPlayerLocaleString("geyser.network.remote.authentication_type_mismatch", locale());
|
||||
// Explain that they may be looking for Floodgate.
|
||||
|
|
|
@ -49,7 +49,7 @@ public class JavaCustomPayloadTranslator extends PacketTranslator<ClientboundCus
|
|||
@Override
|
||||
public void translate(GeyserSession session, ClientboundCustomPayloadPacket packet) {
|
||||
// The only plugin messages it has to listen for are Floodgate plugin messages
|
||||
if (session.remoteServer().authType() != AuthType.HYBRID) {
|
||||
if (session.remoteServer().authType() != AuthType.FLOODGATE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ public class JavaGameProfileTranslator extends PacketTranslator<ClientboundGameP
|
|||
SkinManager.handleBedrockSkin(playerEntity, session.getClientData());
|
||||
}
|
||||
|
||||
if (remoteAuthType == AuthType.HYBRID) {
|
||||
if (remoteAuthType == AuthType.FLOODGATE) {
|
||||
// We'll send the skin upload a bit after the handshake packet (aka this packet),
|
||||
// because otherwise the global server returns the data too fast.
|
||||
// We upload it after we know for sure that the target server
|
||||
|
|
|
@ -102,7 +102,7 @@ public class JavaLoginTranslator extends PacketTranslator<ClientboundLoginPacket
|
|||
session.sendDownstreamPacket(new ServerboundCustomPayloadPacket("minecraft:brand", PluginMessageUtils.getGeyserBrandData()));
|
||||
|
||||
// register the plugin messaging channels used in Floodgate
|
||||
if (session.remoteServer().authType() == AuthType.HYBRID) {
|
||||
if (session.remoteServer().authType() == AuthType.FLOODGATE) {
|
||||
session.sendDownstreamPacket(new ServerboundCustomPayloadPacket("minecraft:register", PluginMessageChannels.getFloodgateRegisterData()));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue