improve server clientcount/activity graph on server overview
This commit is contained in:
@ -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; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user