improve server clientcount/activity graph on server overview

This commit is contained in:
RaidMax
2022-03-29 16:42:53 -05:00
parent 31123d9a33
commit 180a4911bc
21 changed files with 5253 additions and 135 deletions

View File

@ -6,13 +6,19 @@ namespace SharedLibraryCore.Dtos
public class ClientHistoryInfo
{
public long ServerId { get; set; }
public List<ClientCountSnapshot> ClientCounts { get; set; }
public List<ClientCountSnapshot> ClientCounts { get; set; } = new();
}
public class ClientCountSnapshot
{
private const int UpdateInterval = 5;
public DateTime Time { get; set; }
public string TimeString => Time.ToString("yyyy-MM-ddTHH:mm:ssZ");
public string TimeString => new DateTime(Time.Year, Time.Month, Time.Day, Time.Hour,
Math.Min(59, UpdateInterval * (int)Math.Round(Time.Minute / (float)UpdateInterval)), 0)
.ToString("yyyy-MM-ddTHH:mm:ssZ");
public int ClientCount { get; set; }
public bool ConnectionInterrupted { get;set; }
public string Map { get; set; }
public string MapAlias { get; set; }
}
}
}

View File

@ -15,8 +15,7 @@ namespace SharedLibraryCore.Dtos
public int MaxClients { get; set; }
public List<ChatInfo> ChatHistory { get; set; }
public List<PlayerInfo> Players { get; set; }
public PlayerHistory[] PlayerHistory { get; set; }
public List<ClientCountSnapshot> ClientCountHistory { get; set; }
public ClientHistoryInfo ClientHistory { get; set; }
public long ID { get; set; }
public bool Online { get; set; }
public string ConnectProtocolUrl { get; set; }
@ -40,4 +39,4 @@ namespace SharedLibraryCore.Dtos
}
}
}
}
}