IW4M-Admin/SharedLibrary/Helpers/PlayerHistory.cs
RaidMax 8d52d7ddc5 -added back player history graphs (past 12 hours every 15 minutes)
-fixed issue with configurationmanager files and threading
-servers on webfront listed in descending player count
-fixed resolution of tempban times from console feedback
-Added tests plugin to simulate functionality
2017-09-27 15:07:43 -05:00

49 lines
1.1 KiB
C#

using System;
namespace SharedLibrary.Helpers
{
public class PlayerHistory
{
public PlayerHistory(int cNum)
{
DateTime t = DateTime.UtcNow;
When = new DateTime(t.Year, t.Month, t.Day, t.Hour, 5 * (int)Math.Round(t.Minute / 5.0), 0);
PlayerCount = cNum;
}
#if DEBUG
public PlayerHistory(DateTime t, int cNum)
{
When = new DateTime(t.Year, t.Month, t.Day, t.Hour, 15 * (int)Math.Round(t.Minute / 15.0), 0);
PlayerCount = cNum;
}
#endif
private DateTime When;
private int PlayerCount;
/// <summary>
/// Used by CanvasJS as a point on the x axis
/// </summary>
public double x
{
get
{
return (When - DateTime.MinValue).TotalSeconds;
}
}
/// <summary>
/// Used by CanvasJS as a point on the y axis
/// </summary>
public int y
{
get
{
return PlayerCount;
}
}
}
}