Add max concurrent players over 24 hours badge to home

This commit is contained in:
RaidMax
2021-08-26 17:35:05 -05:00
parent 19a49504b8
commit a815bcbff5
34 changed files with 4904 additions and 47 deletions

View File

@ -8,6 +8,7 @@ namespace SharedLibraryCore.Dtos
public int RecentClientCount { get; set; }
public int TotalOccupiedClientSlots { get; set; }
public int TotalAvailableClientSlots { get; set; }
public int MaxConcurrentClients { get; set; }
/// <summary>
/// specifies the game name filter

View File

@ -0,0 +1,17 @@
using System;
using System.Threading;
using System.Threading.Tasks;
namespace SharedLibraryCore.Interfaces
{
public interface IServerDataCollector
{
/// <summary>
/// Begins to collection on servers for analytical purposes
/// </summary>
/// <param name="period">interval at which to collect data</param>
/// <param name="cancellationToken">Token</param>
/// <returns>Task</returns>
Task BeginCollectionAsync(TimeSpan? period = null, CancellationToken cancellationToken = default);
}
}

View File

@ -0,0 +1,29 @@
using System;
using System.Threading;
using System.Threading.Tasks;
namespace SharedLibraryCore.Interfaces
{
/// <summary>
/// Exposes methods to get analytical data about server(s)
/// </summary>
public interface IServerDataViewer
{
/// <summary>
/// Retrieves the max concurrent clients over a give time period for all servers or given server id
/// </summary>
/// <param name="serverId">ServerId to query on</param>
/// <param name="overPeriod">how far in the past to search</param>
/// <param name="token">CancellationToken</param>
/// <returns></returns>
Task<int> MaxConcurrentClientsAsync(long? serverId = null, TimeSpan? overPeriod = null, CancellationToken token = default);
/// <summary>
/// Gets the total number of clients connected and total clients connected in the given time frame
/// </summary>
/// <param name="overPeriod">how far in the past to search</param>
/// <param name="token"></param>
/// <returns></returns>
Task<(int, int)> ClientCountsAsync(TimeSpan? overPeriod = null, CancellationToken token = default);
}
}

View File

@ -284,6 +284,8 @@ namespace SharedLibraryCore
}
}
public abstract Task<long> GetIdForServer(Server server = null);
// Objects
public IManager Manager { get; protected set; }
[Obsolete]

View File

@ -4,7 +4,7 @@
<OutputType>Library</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<PackageId>RaidMax.IW4MAdmin.SharedLibraryCore</PackageId>
<Version>2021.6.29.1</Version>
<Version>2021.8.26.1</Version>
<Authors>RaidMax</Authors>
<Company>Forever None</Company>
<Configurations>Debug;Release;Prerelease</Configurations>
@ -19,7 +19,7 @@
<IsPackable>true</IsPackable>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Description>Shared Library for IW4MAdmin</Description>
<PackageVersion>2021.6.29.1</PackageVersion>
<PackageVersion>2021.8.26.1</PackageVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Prerelease|AnyCPU'">
@ -44,7 +44,7 @@
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="3.1.10" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="3.1.10" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="RaidMax.IW4MAdmin.Data" Version="1.0.4" />
<PackageReference Include="RaidMax.IW4MAdmin.Data" Version="1.0.5" />
<PackageReference Include="Serilog.AspNetCore" Version="3.4.0" />
<PackageReference Include="SimpleCrypto.NetCore" Version="1.0.0" />
</ItemGroup>