forked from TuxCoding/FastLogin
Add packet level checks for Geyser
If AuthType == ONLINE, players will be treated as if they were Java players If AuthType == OFFLINE, name conflicts will be checked the same way it's done with Floodgate Updated config.yml to infrom about the changes.
This commit is contained in:
@ -31,26 +31,34 @@ import com.github.games647.fastlogin.core.shared.FastLoginCore;
|
|||||||
import com.github.games647.fastlogin.core.shared.LoginSource;
|
import com.github.games647.fastlogin.core.shared.LoginSource;
|
||||||
|
|
||||||
import org.geysermc.connector.GeyserConnector;
|
import org.geysermc.connector.GeyserConnector;
|
||||||
|
import org.geysermc.connector.common.AuthType;
|
||||||
import org.geysermc.connector.network.session.GeyserSession;
|
import org.geysermc.connector.network.session.GeyserSession;
|
||||||
|
|
||||||
public class GeyserService extends BedrockService<GeyserSession> {
|
public class GeyserService extends BedrockService<GeyserSession> {
|
||||||
|
|
||||||
private final GeyserConnector geyser;
|
private final GeyserConnector geyser;
|
||||||
private final FastLoginCore<?, ?, ?> core;
|
private final FastLoginCore<?, ?, ?> core;
|
||||||
|
private final AuthType authType;
|
||||||
|
|
||||||
public GeyserService(GeyserConnector geyser, FastLoginCore<?, ?, ?> core) {
|
public GeyserService(GeyserConnector geyser, FastLoginCore<?, ?, ?> core) {
|
||||||
super(core);
|
super(core);
|
||||||
this.geyser = geyser;
|
this.geyser = geyser;
|
||||||
this.core = core;
|
this.core = core;
|
||||||
|
this.authType = geyser.getConfig().getRemote().getAuthType();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean performChecks(String username, LoginSource source) {
|
public boolean performChecks(String username, LoginSource source) {
|
||||||
//TODO: Replace stub with Geyser specific code
|
// AuthType.FLOODGATE will be handled by FloodgateService
|
||||||
if ("false".equals(allowConflict)) {
|
if (authType == AuthType.ONLINE) {
|
||||||
super.checkNameConflict(username, source);
|
// authenticate everyone, as if they were Java players, since they have signed
|
||||||
} else {
|
// in through Mojang
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if ("true".equals(allowConflict)) {
|
||||||
core.getPlugin().getLog().info("Skipping name conflict checking for player {}", username);
|
core.getPlugin().getLog().info("Skipping name conflict checking for player {}", username);
|
||||||
|
} else {
|
||||||
|
super.checkNameConflict(username, source);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -205,8 +205,8 @@ autoLogin: true
|
|||||||
# Enabling this might lead to people gaining unauthorized access to other's accounts!
|
# Enabling this might lead to people gaining unauthorized access to other's accounts!
|
||||||
autoLoginFloodgate: false
|
autoLoginFloodgate: false
|
||||||
|
|
||||||
# This enables Floodgate players to join the server, even if autoRegister is true and there's an existing
|
# This enables Floodgate or Offline Geyser players to join the server, even if they are using the name of an
|
||||||
# Java **PREMIUM** account with the same name
|
# existing Java **PREMIUM** account (so someone has bought Minecraft with that username)
|
||||||
#
|
#
|
||||||
# Java and Bedrock players will get different UUIDs, so their inventories, location, etc. will be different.
|
# Java and Bedrock players will get different UUIDs, so their inventories, location, etc. will be different.
|
||||||
# However, some plugins (such as AuthMe) rely on names instead of UUIDs to identify a player which might cause issues.
|
# However, some plugins (such as AuthMe) rely on names instead of UUIDs to identify a player which might cause issues.
|
||||||
@ -219,12 +219,13 @@ autoLoginFloodgate: false
|
|||||||
# A solution to this is to replace ProtocolLib with ProtocolSupport
|
# A solution to this is to replace ProtocolLib with ProtocolSupport
|
||||||
#
|
#
|
||||||
# Possible values:
|
# Possible values:
|
||||||
# false: Check for Premium Java name conflicts as described in 'autoRegister'
|
# false: Kick Bedrock players, if they are using an existing Premium Java account's name
|
||||||
# Note: Linked players have the same name as their Java profile, so the Bedrock player will always conflict
|
# Note: Linked Floodgate players have the same name as their Java profile, so the Bedrock player will always conflict
|
||||||
# their own Java account's name. Therefore, setting this to false will prevent any linked player from joining.
|
# their own Java account's name. Therefore, setting this to false will prevent any linked player from joining.
|
||||||
# true: Bypass 'autoRegister's name conflict checking
|
# true: Bypass name conflict checking.
|
||||||
# linked: Bedrock accounts linked to a Java account will be allowed to join with conflicting names
|
# linked: Floodgate accounts linked to a Java account will be allowed to join with conflicting names
|
||||||
# !!!!!!!! WARNING: FLOODGATE SUPPORT IS AN EXPERIMENTAL FEATURE !!!!!!!!
|
# For Offline Geyser players, 'linked' works as 'false'
|
||||||
|
# !!!!!!!! WARNING: FLOODGATE/GEYSER SUPPORT IS AN EXPERIMENTAL FEATURE !!!!!!!!
|
||||||
# Enabling this might lead to people gaining unauthorized access to other's accounts!
|
# Enabling this might lead to people gaining unauthorized access to other's accounts!
|
||||||
allowFloodgateNameConflict: false
|
allowFloodgateNameConflict: false
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user