3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-11-16 04:50:07 +01:00

Re-added a way to send Floodgate data over the wire (for e.g. standalone)

Dieser Commit ist enthalten in:
Tim203 2023-10-13 16:47:55 +02:00
Ursprung dab61ac41a
Commit 4a673b6879
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
2 geänderte Dateien mit 21 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -67,6 +67,7 @@ import org.geysermc.geyser.extension.GeyserExtensionManager;
import org.geysermc.geyser.floodgate.FloodgateProvider;
import org.geysermc.geyser.floodgate.IntegratedFloodgateProvider;
import org.geysermc.geyser.floodgate.NoFloodgateProvider;
import org.geysermc.geyser.floodgate.ProxyFloodgateProvider;
import org.geysermc.geyser.level.WorldManager;
import org.geysermc.geyser.network.netty.GeyserServer;
import org.geysermc.geyser.registry.BlockRegistries;
@ -168,7 +169,11 @@ public class GeyserImpl implements GeyserApi {
this.floodgateProvider = new IntegratedFloodgateProvider(floodgatePlatform);
// this.floodgateProvider = new ProxyFloodgateProvider(floodgatePlatform);
} else {
this.floodgateProvider = new NoFloodgateProvider();
if (bootstrap.getGeyserConfig().getRemote().authType() == AuthType.FLOODGATE) {
this.floodgateProvider = new ProxyFloodgateProvider(bootstrap.getConfigFolder());
} else {
this.floodgateProvider = new NoFloodgateProvider();
}
Geyser.set(this);
}

Datei anzeigen

@ -26,8 +26,14 @@
package org.geysermc.geyser.floodgate;
import java.nio.charset.StandardCharsets;
import java.nio.file.Path;
import lombok.SneakyThrows;
import org.geysermc.floodgate.core.FloodgatePlatform;
import org.geysermc.floodgate.core.connection.standalone.codec.FloodgateConnectionCodec;
import org.geysermc.floodgate.core.crypto.DataCodecType;
import org.geysermc.floodgate.core.crypto.FloodgateDataCodec;
import org.geysermc.floodgate.core.crypto.FloodgateFormatCodec;
import org.geysermc.floodgate.core.crypto.topping.Base64Topping;
import org.geysermc.geyser.session.GeyserSession;
//todo Floodgate should be responsible for forwarding its messages
@ -38,6 +44,15 @@ public final class ProxyFloodgateProvider implements FloodgateProvider {
dataCodec = platform.getBean(FloodgateDataCodec.class);
}
@SneakyThrows
public ProxyFloodgateProvider(Path dataDirectory) {
//todo use what the platform provides without enabling Floodgate
dataCodec = new FloodgateDataCodec(
new FloodgateFormatCodec(DataCodecType.AES, new Base64Topping(), dataDirectory),
new FloodgateConnectionCodec()
);
}
@Override
public void onSkinUpload(GeyserSession session, String value, String signature) {
byte[] bytes = (value + '\0' + signature)