Skip to content

Commit

Permalink
Implement SF bypass forwarding
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexProgrammerDE committed Nov 30, 2024
1 parent c9253b0 commit 4315dfb
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,11 @@ public void onPacket(SFPacketSendingEvent event) {
getForwardedIp(),
hostname,
settingsSource.get(ForwardingBypassSettings.SECRET))));
case SF_BYPASS -> event.packet(
handshake.withHostname(
createSoulFireBypassAddress(
hostname,
settingsSource.get(ForwardingBypassSettings.SECRET))));
}
}

Expand Down Expand Up @@ -276,6 +281,10 @@ private String createBungeeGuardForwardingAddress(
ImmutableList.<GameProfile.Property>builder().addAll(properties).add(property).build());
}

private String createSoulFireBypassAddress(String initialHostname, String forwardingSecret) {
return initialHostname + LEGACY_FORWARDING_SEPARATOR + "SF_%s".formatted(forwardingSecret);
}

@NoArgsConstructor(access = AccessLevel.PRIVATE)
private static class ForwardingBypassSettings implements SettingsObject {
private static final String NAMESPACE = "forwarding-bypass";
Expand Down Expand Up @@ -303,7 +312,8 @@ enum ForwardingMode {
NONE("None"),
LEGACY("Legacy"),
BUNGEE_GUARD("BungeeGuard"),
MODERN("Modern");
MODERN("Modern"),
SF_BYPASS("SoulFire Bypass");

private final String displayName;

Expand Down

0 comments on commit 4315dfb

Please sign in to comment.