Skip to content

Commit

Permalink
Make listen-ip server option harder to find by moving it from Server …
Browse files Browse the repository at this point in the history
…to Other group

Multiple occasions where this option has been changed by users to e.g. server's IP, even though this is usually unnecessary because 0.0.0.0 already specifies to listen on all network interfaces - although this wasn't explained to the end user
  • Loading branch information
UnknownShadow200 committed Jul 16, 2022
1 parent c75a9a9 commit 0f2c0c0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion MCGalaxy/Commands/Information/CmdServerInfo.cs
Expand Up @@ -138,7 +138,7 @@ unsafe static CPUTime MeasureAllCPUTime()
}

[DllImport("kernel32.dll")]
internal static extern int GetSystemTimes(out ulong idleTime, out ulong kernelTime, out ulong userTime);
static extern int GetSystemTimes(out ulong idleTime, out ulong kernelTime, out ulong userTime);


// https://stackoverflow.com/questions/20471920/how-to-get-total-cpu-idle-time-in-objective-c-c-on-os-x
Expand Down
20 changes: 11 additions & 9 deletions MCGalaxy/Server/ServerConfig.cs
Expand Up @@ -31,8 +31,6 @@ public sealed class ServerConfig : EnvConfig {
public int MaxPlayers = 16;
[ConfigInt("max-guests", "Server", 14, 1, Server.MAX_PLAYERS)]
public int MaxGuests = 14;
[ConfigString("listen-ip", "Server", "0.0.0.0")]
public string ListenIP = "0.0.0.0";
[ConfigInt("port", "Server", 25565, 0, 65535)]
public int Port = 25565;
[ConfigBool("public", "Server", false)]
Expand All @@ -43,7 +41,9 @@ public sealed class ServerConfig : EnvConfig {
public bool WebClient = true;
[ConfigString("default-rank", "Server", "guest")]
public string DefaultRankName = "guest";

[ConfigString("server-owner", "Server", "the owner")]
public string OwnerName = "the owner";

[ConfigBool("autoload", "Level", true)]
public bool AutoLoadMaps = true;
/// <summary> true if maps sees server-wide chat, false if maps have level-only/isolated chat </summary>
Expand Down Expand Up @@ -89,7 +89,7 @@ public sealed class ServerConfig : EnvConfig {
public bool PhysicsRestart = true;
[ConfigInt("physics-undo-max", "Other", 50000)]
public int PhysicsUndo = 50000;

[ConfigTimespan("backup-time", "Backup", 300, false)]
public TimeSpan BackupInterval = TimeSpan.FromSeconds(300);
[ConfigTimespan("blockdb-backup-time", "Backup", 60, false)]
Expand All @@ -111,9 +111,7 @@ public sealed class ServerConfig : EnvConfig {
[ConfigTimespan("announcement-interval", "Other", 5, true)]
public TimeSpan AnnouncementInterval = TimeSpan.FromMinutes(5);
[ConfigString("money-name", "Other", "moneys")]
public string Currency = "moneys";
[ConfigString("server-owner", "Other", "the owner")]
public string OwnerName = "the owner";
public string Currency = "moneys";

[ConfigBool("guest-limit-notify", "Other", false)]
public bool GuestLimitNotify = false;
Expand All @@ -140,7 +138,11 @@ public sealed class ServerConfig : EnvConfig {
public LevelPermission OSPerbuildDefault = LevelPermission.Owner;
[ConfigBool("protect-staff-ips", "Other", true)]
public bool ProtectStaffIPs = true;

// technically a Server option, but it's a common mistake to think
// this option needs changing to server's IP (0.0.0.0 = listen on all network interfaces)
[ConfigString("listen-ip", "Other", "0.0.0.0")]
public string ListenIP = "0.0.0.0";

[ConfigBool("irc", "IRC bot", false)]
public bool UseIRC = false;
[ConfigInt("irc-port", "IRC bot", 6697, 0, 65535)]
Expand Down Expand Up @@ -223,7 +225,7 @@ public sealed class ServerConfig : EnvConfig {
[ConfigColor("warning-error-color", "Colors", "&c")]
public string WarningErrorColor = "&c";

[ConfigBool("cheapmessage", "Other", true)]
[ConfigBool("cheapmessage", "Messages", true)]
public bool ShowInvincibleMessage = true;
[ConfigString("cheap-message-given", "Messages", " is now invincible")]
public string InvincibleMessage = " is now invincible";
Expand Down

0 comments on commit 0f2c0c0

Please sign in to comment.