Player.players should be a field to avoid breaking backwards compatibility. (Thanks tommyz)

This commit is contained in:
UnknownShadow200 2016-02-15 09:52:27 +11:00
parent 4ddf7f438d
commit 1f86415dfc
3 changed files with 8 additions and 6 deletions

View File

@ -2414,16 +2414,16 @@ catch { }*/
#endregion #endregion
#region == OTHER == #region == OTHER ==
[Obsolete] [Obsolete("Use PlayerInfo.players")]
public static List<Player> players { get { return PlayerInfo.players; } } public static List<Player> players;
[Obsolete] [Obsolete("Use PlayerInfo.Find(name)")]
public static Player Find(string name) { return PlayerInfo.Find(name); } public static Player Find(string name) { return PlayerInfo.Find(name); }
[Obsolete] [Obsolete("Use PlayerInfo.FindExact(name)")]
public static Player FindExact(string name) { return PlayerInfo.FindExact(name); } public static Player FindExact(string name) { return PlayerInfo.FindExact(name); }
[Obsolete] [Obsolete("Use PlayerInfo.FindNick(name)")]
public static Player FindNick(string name) { return PlayerInfo.FindNick(name); } public static Player FindNick(string name) { return PlayerInfo.FindNick(name); }
static byte FreeId() { static byte FreeId() {

View File

@ -22,7 +22,7 @@ namespace MCGalaxy {
public static class PlayerInfo { public static class PlayerInfo {
/// <summary> List of all server players. </summary> /// <summary> List of all server players. </summary>
public static List<Player> players = new List<Player>(); public static List<Player> players;
public static List<Player> GetPlayers() { return new List<Player>(PlayerInfo.players); } public static List<Player> GetPlayers() { return new List<Player>(PlayerInfo.players); }

View File

@ -408,6 +408,8 @@ namespace MCGalaxy
} }
public void Start() { public void Start() {
PlayerInfo.players = new List<Player>();
Player.players = PlayerInfo.players;
StartTime = DateTime.UtcNow; StartTime = DateTime.UtcNow;
StartTimeLocal = StartTime.ToLocalTime(); StartTimeLocal = StartTime.ToLocalTime();
shuttingDown = false; shuttingDown = false;