Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-11-17 05:20:14 +01:00
Improve code style
Dieser Commit ist enthalten in:
Ursprung
f8ad686625
Commit
793477b898
@ -34,7 +34,8 @@ public class VelocityConfiguration extends AnnotatedConfig implements ProxyConfi
|
|||||||
|
|
||||||
@Comment({
|
@Comment({
|
||||||
"What should we display for the maximum number of players? (Velocity does not support a cap",
|
"What should we display for the maximum number of players? (Velocity does not support a cap",
|
||||||
"on the number of players online.)"})
|
"on the number of players online.)"
|
||||||
|
})
|
||||||
@ConfigKey("show-max-players")
|
@ConfigKey("show-max-players")
|
||||||
private int showMaxPlayers = 500;
|
private int showMaxPlayers = 500;
|
||||||
|
|
||||||
@ -50,7 +51,8 @@ public class VelocityConfiguration extends AnnotatedConfig implements ProxyConfi
|
|||||||
"- \"legacy\": Forward player IPs and UUIDs in BungeeCord-compatible fashion. Use this if you run",
|
"- \"legacy\": Forward player IPs and UUIDs in BungeeCord-compatible fashion. Use this if you run",
|
||||||
" servers using Minecraft 1.12 or lower.",
|
" servers using Minecraft 1.12 or lower.",
|
||||||
"- \"modern\": Forward player IPs and UUIDs as part of the login process using Velocity's native",
|
"- \"modern\": Forward player IPs and UUIDs as part of the login process using Velocity's native",
|
||||||
" forwarding. Only applicable for Minecraft 1.13 or higher."})
|
" forwarding. Only applicable for Minecraft 1.13 or higher."
|
||||||
|
})
|
||||||
@ConfigKey("player-info-forwarding-mode")
|
@ConfigKey("player-info-forwarding-mode")
|
||||||
private PlayerInfoForwarding playerInfoForwardingMode = PlayerInfoForwarding.NONE;
|
private PlayerInfoForwarding playerInfoForwardingMode = PlayerInfoForwarding.NONE;
|
||||||
|
|
||||||
@ -77,6 +79,7 @@ public class VelocityConfiguration extends AnnotatedConfig implements ProxyConfi
|
|||||||
|
|
||||||
@Ignore
|
@Ignore
|
||||||
private Component motdAsComponent;
|
private Component motdAsComponent;
|
||||||
|
|
||||||
@Ignore
|
@Ignore
|
||||||
private Favicon favicon;
|
private Favicon favicon;
|
||||||
|
|
||||||
@ -389,7 +392,6 @@ public class VelocityConfiguration extends AnnotatedConfig implements ProxyConfi
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static class Servers {
|
private static class Servers {
|
||||||
|
|
||||||
@IsMap
|
@IsMap
|
||||||
@Comment("Configure your servers here.")
|
@Comment("Configure your servers here.")
|
||||||
private Map<String, String> servers = ImmutableMap.of("lobby", "127.0.0.1:30066", "factions", "127.0.0.1:30067", "minigames", "127.0.0.1:30068");
|
private Map<String, String> servers = ImmutableMap.of("lobby", "127.0.0.1:30066", "factions", "127.0.0.1:30067", "minigames", "127.0.0.1:30068");
|
||||||
@ -398,8 +400,7 @@ public class VelocityConfiguration extends AnnotatedConfig implements ProxyConfi
|
|||||||
@ConfigKey("try")
|
@ConfigKey("try")
|
||||||
private List<String> attemptConnectionOrder = Arrays.asList("lobby");
|
private List<String> attemptConnectionOrder = Arrays.asList("lobby");
|
||||||
|
|
||||||
private Servers() {
|
private Servers() {}
|
||||||
}
|
|
||||||
|
|
||||||
private Servers(Toml toml) {
|
private Servers(Toml toml) {
|
||||||
if (toml != null) {
|
if (toml != null) {
|
||||||
@ -446,7 +447,6 @@ public class VelocityConfiguration extends AnnotatedConfig implements ProxyConfi
|
|||||||
+ ", attemptConnectionOrder=" + attemptConnectionOrder
|
+ ", attemptConnectionOrder=" + attemptConnectionOrder
|
||||||
+ '}';
|
+ '}';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class ForcedHosts {
|
private static class ForcedHosts {
|
||||||
@ -505,32 +505,37 @@ public class VelocityConfiguration extends AnnotatedConfig implements ProxyConfi
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static class Advanced {
|
private static class Advanced {
|
||||||
|
|
||||||
@Comment({
|
@Comment({
|
||||||
"How large a Minecraft packet has to be before we compress it. Setting this to zero will compress all packets, and",
|
"How large a Minecraft packet has to be before we compress it. Setting this to zero will compress all packets, and",
|
||||||
"setting it to -1 will disable compression entirely."})
|
"setting it to -1 will disable compression entirely."
|
||||||
|
})
|
||||||
@ConfigKey("compression-threshold")
|
@ConfigKey("compression-threshold")
|
||||||
private int compressionThreshold = 1024;
|
private int compressionThreshold = 1024;
|
||||||
|
|
||||||
@Comment("How much compression should be done (from 0-9). The default is -1, which uses zlib's default level of 6.")
|
@Comment("How much compression should be done (from 0-9). The default is -1, which uses zlib's default level of 6.")
|
||||||
@ConfigKey("compression-level")
|
@ConfigKey("compression-level")
|
||||||
private int compressionLevel = -1;
|
private int compressionLevel = -1;
|
||||||
|
|
||||||
@Comment({
|
@Comment({
|
||||||
"How fast (in miliseconds) are clients allowed to connect after the last connection? Default: 3000",
|
"How fast (in miliseconds) are clients allowed to connect after the last connection? Default: 3000",
|
||||||
"Disable by setting to 0"})
|
"Disable by setting to 0"
|
||||||
|
})
|
||||||
@ConfigKey("login-ratelimit")
|
@ConfigKey("login-ratelimit")
|
||||||
private int loginRatelimit = 3000;
|
private int loginRatelimit = 3000;
|
||||||
|
|
||||||
@Comment({"Specify a custom timeout for connection timeouts here. The default is five seconds."})
|
@Comment({"Specify a custom timeout for connection timeouts here. The default is five seconds."})
|
||||||
@ConfigKey("connection-timeout")
|
@ConfigKey("connection-timeout")
|
||||||
private int connectionTimeout = 5000;
|
private int connectionTimeout = 5000;
|
||||||
|
|
||||||
@Comment({"Specify a read timeout for connections here. The default is 30 seconds."})
|
@Comment({"Specify a read timeout for connections here. The default is 30 seconds."})
|
||||||
@ConfigKey("read-timeout")
|
@ConfigKey("read-timeout")
|
||||||
private int readTimeout = 30000;
|
private int readTimeout = 30000;
|
||||||
|
|
||||||
@Comment("Enables compatibility with HAProxy.")
|
@Comment("Enables compatibility with HAProxy.")
|
||||||
@ConfigKey("proxy-protocol")
|
@ConfigKey("proxy-protocol")
|
||||||
private boolean proxyProtocol = false;
|
private boolean proxyProtocol = false;
|
||||||
|
|
||||||
private Advanced() {
|
private Advanced() {}
|
||||||
}
|
|
||||||
|
|
||||||
private Advanced(Toml toml) {
|
private Advanced(Toml toml) {
|
||||||
if (toml != null) {
|
if (toml != null) {
|
||||||
@ -581,13 +586,14 @@ public class VelocityConfiguration extends AnnotatedConfig implements ProxyConfi
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static class Query {
|
private static class Query {
|
||||||
|
|
||||||
@Comment("Whether to enable responding to GameSpy 4 query responses or not")
|
@Comment("Whether to enable responding to GameSpy 4 query responses or not")
|
||||||
@ConfigKey("enabled")
|
@ConfigKey("enabled")
|
||||||
private boolean queryEnabled = false;
|
private boolean queryEnabled = false;
|
||||||
|
|
||||||
@Comment("If query responding is enabled, on what port should query response listener listen on?")
|
@Comment("If query responding is enabled, on what port should query response listener listen on?")
|
||||||
@ConfigKey("port")
|
@ConfigKey("port")
|
||||||
private int queryPort = 25577;
|
private int queryPort = 25577;
|
||||||
|
|
||||||
@Comment("This is the map name that is reported to the query services.")
|
@Comment("This is the map name that is reported to the query services.")
|
||||||
@ConfigKey("map")
|
@ConfigKey("map")
|
||||||
private String queryMap = "Velocity";
|
private String queryMap = "Velocity";
|
||||||
@ -596,8 +602,7 @@ public class VelocityConfiguration extends AnnotatedConfig implements ProxyConfi
|
|||||||
@ConfigKey("show-plugins")
|
@ConfigKey("show-plugins")
|
||||||
private boolean showPlugins = false;
|
private boolean showPlugins = false;
|
||||||
|
|
||||||
private Query() {
|
private Query() {}
|
||||||
}
|
|
||||||
|
|
||||||
private Query(boolean queryEnabled, int queryPort) {
|
private Query(boolean queryEnabled, int queryPort) {
|
||||||
this.queryEnabled = queryEnabled;
|
this.queryEnabled = queryEnabled;
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren