mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-10-01 09:36:03 -04:00
Server.VersionString --> Server.Version
This commit is contained in:
parent
62786f36aa
commit
3aac7112c9
@ -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")) {
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -44,14 +44,13 @@ namespace MCGalaxy {
|
||||
|
||||
/// <summary> *** DO NOT USE THIS! *** Use VersionString, as this field is a constant and is inlined if used. </summary>
|
||||
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; }
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user