1
0
mirror of https://github.com/GeyserMC/Floodgate.git synced 2025-12-30 12:19:22 +00:00

More 2.0 changes. Most important change is the switch from RSA to AES

Changing the encryption from RSA to AES will definitely break every 1.0 installation, but it had to be changed. Floodgate on a proxy like Velocity has to be able to change the Floodgate data, for example if the player is linked (and maybe later for skins as well).
This commit is contained in:
Tim203
2020-09-12 15:22:28 +02:00
parent f440fb76b0
commit 974a6d96c5
48 changed files with 903 additions and 619 deletions

View File

@@ -75,7 +75,6 @@ public interface FloodgateApi {
/**
* Returns the Floodgate API instance.
* This method is equal to running {@link InstanceHolder#getInstance()}
*/
static FloodgateApi getInstance() {
return InstanceHolder.getInstance();

View File

@@ -27,6 +27,7 @@
package org.geysermc.floodgate.api;
import lombok.Getter;
import org.geysermc.floodgate.api.inject.PlatformInjector;
import org.geysermc.floodgate.api.link.PlayerLink;
import java.util.UUID;
@@ -34,9 +35,11 @@ import java.util.UUID;
public final class InstanceHolder {
@Getter private static FloodgateApi instance;
@Getter private static PlayerLink playerLink;
@Getter private static PlatformInjector injector;
private static UUID key;
public static boolean setInstance(FloodgateApi floodgateApi, PlayerLink link, UUID key) {
public static boolean setInstance(FloodgateApi floodgateApi, PlayerLink link,
PlatformInjector platformInjector, UUID key) {
if (instance == null) {
InstanceHolder.key = key;
} else if (!InstanceHolder.key.equals(key)) {
@@ -44,6 +47,7 @@ public final class InstanceHolder {
}
instance = floodgateApi;
playerLink = link;
injector = platformInjector;
return true;
}

View File

@@ -77,4 +77,16 @@ public interface FloodgateLogger {
* @param args the arguments to fill the missing spots in the message
*/
void trace(String message, Object... args);
/**
* Enables debug mode for the Floodgate logger.
*/
void enableDebug();
/**
* Disables debug mode for the Floodgate logger.
* Debug messages can still be sent after running this method,
* but they will be hidden from the console.
*/
void disableDebug();
}

View File

@@ -42,7 +42,8 @@ public interface FloodgatePlayer {
/**
* Returns the real username of the Bedrock client.
* No prefix nor shortened nor replaced spaces.
* This username doesn't have a prefix, spaces aren't replaced and the username hasn't been
* shortened.
*/
String getUsername();
@@ -52,7 +53,7 @@ public interface FloodgatePlayer {
String getXuid();
/**
* Returns the Operation System of the Bedrock client
* Returns the Operating System of the Bedrock client
*/
DeviceOs getDeviceOs();