Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-11-20 06:50:09 +01:00
Allow srv resolving to be set per remote server (#4076)
* Allow srv resolving to be set per remote server * Remove resolve-srv as a config option
Dieser Commit ist enthalten in:
Ursprung
90c4ea78a7
Commit
48ecde0f19
@ -67,4 +67,11 @@ public interface RemoteServer {
|
|||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
AuthType authType();
|
AuthType authType();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets if we should attempt to resolve the SRV record for this server.
|
||||||
|
*
|
||||||
|
* @return if we should attempt to resolve the SRV record for this server
|
||||||
|
*/
|
||||||
|
boolean resolveSrv();
|
||||||
}
|
}
|
||||||
|
@ -270,6 +270,11 @@ public abstract class GeyserJacksonConfiguration implements GeyserConfiguration
|
|||||||
return authType;
|
return authType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean resolveSrv() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@JsonProperty("allow-password-authentication")
|
@JsonProperty("allow-password-authentication")
|
||||||
private boolean passwordAuthentication = true;
|
private boolean passwordAuthentication = true;
|
||||||
|
@ -935,7 +935,15 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
|
|||||||
} else {
|
} else {
|
||||||
downstream = new TcpClientSession(this.remoteServer.address(), this.remoteServer.port(), this.protocol);
|
downstream = new TcpClientSession(this.remoteServer.address(), this.remoteServer.port(), this.protocol);
|
||||||
this.downstream = new DownstreamSession(downstream);
|
this.downstream = new DownstreamSession(downstream);
|
||||||
disableSrvResolving();
|
|
||||||
|
boolean resolveSrv = false;
|
||||||
|
try {
|
||||||
|
resolveSrv = this.remoteServer.resolveSrv();
|
||||||
|
} catch (AbstractMethodError | NoSuchMethodError ignored) {
|
||||||
|
// Ignore if the method doesn't exist
|
||||||
|
// This will happen with extensions using old APIs
|
||||||
|
}
|
||||||
|
this.downstream.getSession().setFlag(BuiltinFlags.ATTEMPT_SRV_RESOLVE, resolveSrv);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (geyser.getConfig().getRemote().isUseProxyProtocol()) {
|
if (geyser.getConfig().getRemote().isUseProxyProtocol()) {
|
||||||
@ -1419,13 +1427,6 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
|
|||||||
sendDownstreamPacket(swapHandsPacket);
|
sendDownstreamPacket(swapHandsPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Will be overwritten for GeyserConnect.
|
|
||||||
*/
|
|
||||||
protected void disableSrvResolving() {
|
|
||||||
this.downstream.getSession().setFlag(BuiltinFlags.ATTEMPT_SRV_RESOLVE, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String name() {
|
public String name() {
|
||||||
return null;
|
return null;
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren