diff --git a/MCGalaxy/Commands/Information/CmdServerInfo.cs b/MCGalaxy/Commands/Information/CmdServerInfo.cs index ad9b1d5fc..c6df95570 100644 --- a/MCGalaxy/Commands/Information/CmdServerInfo.cs +++ b/MCGalaxy/Commands/Information/CmdServerInfo.cs @@ -40,15 +40,15 @@ namespace MCGalaxy.Commands.Info { int count = Database.CountRows("Players"); p.Message("Server's name: &b{0}%S", Server.Config.Name); p.Message("&a{0} %Splayers total. (&a{1} %Sonline, &8{2} banned%S)", - count, PlayerInfo.Online.Count, Group.BannedRank.Players.Count); + count, PlayerInfo.Online.Count, Group.BannedRank.Players.Count); p.Message("&a{0} %Slevels currently loaded. Currency is &3{1}%S.", - LevelInfo.Loaded.Count, Server.Config.Currency); + LevelInfo.Loaded.Count, Server.Config.Currency); TimeSpan up = DateTime.UtcNow - Server.StartTime; p.Message("Been up for &b{0}%S, running &b{1} &a{2} %S(based on &bMCForge %Sand &bMCLawl%S).", - up.Shorten(true), Server.SoftwareName, Server.VersionString); + up.Shorten(true), Server.SoftwareName, Server.Version); p.Message("Player positions are updated every &b" - + Server.Config.PositionUpdateInterval + " %Smilliseconds."); + + Server.Config.PositionUpdateInterval + " %Smilliseconds."); string owner = Server.Config.OwnerName; if (!owner.CaselessEq("Notch") && !owner.CaselessEq("the owner")) { diff --git a/MCGalaxy/Commands/Scripting/CmdPlugin.cs b/MCGalaxy/Commands/Scripting/CmdPlugin.cs index 5990c802d..8b245f837 100644 --- a/MCGalaxy/Commands/Scripting/CmdPlugin.cs +++ b/MCGalaxy/Commands/Scripting/CmdPlugin.cs @@ -107,7 +107,7 @@ namespace MCGalaxy.Commands.Scripting { p.Message("Creating a plugin example source"); string creator = p.IsSuper ? Server.Config.Name : p.name; string syntax = pluginSrc.Replace(@"\t", "\t"); - syntax = string.Format(syntax, name, creator, Server.VersionString); + syntax = string.Format(syntax, name, creator, Server.Version); File.WriteAllText("plugins/" + name + ".cs", syntax); } diff --git a/MCGalaxy/CorePlugin/CorePlugin.cs b/MCGalaxy/CorePlugin/CorePlugin.cs index a9e5a6403..327f526b6 100644 --- a/MCGalaxy/CorePlugin/CorePlugin.cs +++ b/MCGalaxy/CorePlugin/CorePlugin.cs @@ -27,7 +27,7 @@ namespace MCGalaxy.Core { public sealed class CorePlugin : Plugin_Simple { public override string creator { get { return Server.SoftwareName + " team"; } } - public override string MCGalaxy_Version { get { return Server.VersionString; } } + public override string MCGalaxy_Version { get { return Server.Version; } } public override string name { get { return "CorePlugin"; } } SchedulerTask clearTask; diff --git a/MCGalaxy/CorePlugin/NotesPlugin.cs b/MCGalaxy/CorePlugin/NotesPlugin.cs index 52fcd01a3..b36b96ff6 100644 --- a/MCGalaxy/CorePlugin/NotesPlugin.cs +++ b/MCGalaxy/CorePlugin/NotesPlugin.cs @@ -22,7 +22,7 @@ namespace MCGalaxy.Core { public sealed class NotesPlugin : Plugin_Simple { public override string creator { get { return Server.SoftwareName + " team"; } } - public override string MCGalaxy_Version { get { return Server.VersionString; } } + public override string MCGalaxy_Version { get { return Server.Version; } } public override string name { get { return "Core_NotesPlugin"; } } public override void Load(bool startup) { diff --git a/MCGalaxy/Plugins/PluginManager.cs b/MCGalaxy/Plugins/PluginManager.cs index f64cb7848..3cd2bc3d7 100644 --- a/MCGalaxy/Plugins/PluginManager.cs +++ b/MCGalaxy/Plugins/PluginManager.cs @@ -50,7 +50,7 @@ namespace MCGalaxy { public static bool Load(Plugin p, bool startup) { try { string ver = p.MCGalaxy_Version; - if (!String.IsNullOrEmpty(ver) && new Version(ver) > Server.Version) { + if (!String.IsNullOrEmpty(ver) && new Version(ver) > new Version(Server.Version)) { Logger.Log(LogType.Warning, "Plugin ({0}) requires a more recent version of {1}!", p.name, Server.SoftwareName); return false; } diff --git a/MCGalaxy/Server/Maintenance/Updater.cs b/MCGalaxy/Server/Maintenance/Updater.cs index 274c5c5c7..516d898cf 100644 --- a/MCGalaxy/Server/Maintenance/Updater.cs +++ b/MCGalaxy/Server/Maintenance/Updater.cs @@ -54,7 +54,7 @@ namespace MCGalaxy { try { string latest = client.DownloadString(CurrentVersionFile); - if (new Version(latest) <= Server.Version) { + if (new Version(Server.Version) >= new Version(latest)) { Logger.Log(LogType.SystemActivity, "No update found!"); } else if (NewerVersionDetected != null) { NewerVersionDetected(null, EventArgs.Empty); diff --git a/MCGalaxy/Server/Server.Fields.cs b/MCGalaxy/Server/Server.Fields.cs index bb6981e6b..998d39cf0 100644 --- a/MCGalaxy/Server/Server.Fields.cs +++ b/MCGalaxy/Server/Server.Fields.cs @@ -44,14 +44,13 @@ namespace MCGalaxy { /// *** DO NOT USE THIS! *** Use VersionString, as this field is a constant and is inlined if used. public const string InternalVersion = "1.9.2.1"; - public static Version Version { get { return new Version(InternalVersion); } } - public static string VersionString { get { return InternalVersion; } } + public static string Version { get { return InternalVersion; } } public static string SoftwareName = "MCGalaxy"; static string fullName; public static string SoftwareNameVersioned { // By default, if SoftwareName gets externally changed, that is reflected in SoftwareNameVersioned too - get { return fullName ?? SoftwareName + " " + VersionString; } + get { return fullName ?? SoftwareName + " " + Version; } set { fullName = value; } }