Skip to content

Commit

Permalink
Fix 256 max players not working in GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
UnknownShadow200 committed Feb 16, 2022
1 parent f8805bb commit 9d82d5e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions GUI/PropertyWindow/PropertyWindow.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions GUI/PropertyWindow/PropertyWindow.General.cs
Expand Up @@ -53,8 +53,8 @@ public partial class PropertyWindow : Form {
Server.Config.OwnerName = srv_txtOwner.Text;
Server.Config.Public = srv_chkPublic.Checked;

Server.Config.MaxPlayers = (byte)srv_numPlayers.Value;
Server.Config.MaxGuests = (byte)srv_numGuests.Value;
Server.Config.MaxPlayers = (int)srv_numPlayers.Value;
Server.Config.MaxGuests = (int)srv_numGuests.Value;
Server.Config.AgreeToRulesOnEntry = srv_cbMustAgree.Checked;

Server.Config.MainLevel = lvl_txtMain.Text;
Expand Down
1 change: 1 addition & 0 deletions MCGalaxy/Server/Server.Fields.cs
Expand Up @@ -77,6 +77,7 @@ public sealed partial class Server {

public static int YesVotes, NoVotes;
public static bool voting;
public const int MAX_PLAYERS = 256;

public static Scheduler MainScheduler = new Scheduler("MCG_MainScheduler");
public static Scheduler Background = new Scheduler("MCG_BackgroundScheduler");
Expand Down
4 changes: 2 additions & 2 deletions MCGalaxy/Server/ServerConfig.cs
Expand Up @@ -28,9 +28,9 @@ public sealed class ServerConfig : EnvConfig {
public string Name = "[MCGalaxy] Default";
[ConfigString("motd", "Server", "Welcome", false)]
public string MOTD = "Welcome!";
[ConfigInt("max-players", "Server", 12, 1, 256)]
[ConfigInt("max-players", "Server", 12, 1, Server.MAX_PLAYERS)]
public int MaxPlayers = 12;
[ConfigInt("max-guests", "Server", 10, 1, 256)]
[ConfigInt("max-guests", "Server", 10, 1, Server.MAX_PLAYERS)]
public int MaxGuests = 10;
[ConfigString("listen-ip", "Server", "0.0.0.0")]
public string ListenIP = "0.0.0.0";
Expand Down

0 comments on commit 9d82d5e

Please sign in to comment.