diff --git a/MCGalaxy/Commands/CPE/CmdEnvironment.cs b/MCGalaxy/Commands/CPE/CmdEnvironment.cs index e21be9917..f6f2ac5e5 100644 --- a/MCGalaxy/Commands/CPE/CmdEnvironment.cs +++ b/MCGalaxy/Commands/CPE/CmdEnvironment.cs @@ -28,10 +28,10 @@ namespace MCGalaxy.Commands.CPE { public override LevelPermission defaultRank { get { return LevelPermission.Operator; } } public override void Use(Player p, string message) { - message = message.ToLower(); if (message.CaselessEq("preset")) { SendPresetsMessage(p); return; } + message = message.ToLower(); if (!LevelInfo.ValidateAction(p, p.level, "set env settings of this level")) return; string[] args = message.SplitSpaces(); diff --git a/MCGalaxy/Player/Player.Login.cs b/MCGalaxy/Player/Player.Login.cs index c612a3f04..8fbaa5903 100644 --- a/MCGalaxy/Player/Player.Login.cs +++ b/MCGalaxy/Player/Player.Login.cs @@ -43,12 +43,12 @@ namespace MCGalaxy { OnPlayerStartConnectingEvent.Call(this, mppass); if (cancelconnecting) { cancelconnecting = false; return; } - byte protocolType = buffer[offset + 130]; + hasCpe = buffer[offset + 130] == 0x42 && ServerConfig.EnableCPE; Loading = true; if (disconnected) return; - if (protocolType == 0x42) { hasCpe = true; SendCpeExtensions(); } - if (protocolType != 0x42) CompleteLoginProcess(); + if (hasCpe) { SendCpeExtensions(); } + else { CompleteLoginProcess(); } } void SendCpeExtensions() { diff --git a/MCGalaxy/Server/ServerConfig.cs b/MCGalaxy/Server/ServerConfig.cs index a20993de4..aebb1e143 100644 --- a/MCGalaxy/Server/ServerConfig.cs +++ b/MCGalaxy/Server/ServerConfig.cs @@ -77,6 +77,8 @@ namespace MCGalaxy { [ConfigBool("check-updates", "Update", false)] public static bool CheckForUpdates = true; + [ConfigBool("enable-cpe", "Server", true)] + public static bool EnableCPE = true; [ConfigInt("rplimit", "Other", 500, 0, 50000)] public static int PhysicsRestartLimit = 500;