mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-04-25 08:49:22 -04:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
39 lines
810 B
C#
39 lines
810 B
C#
using System.Text.Json.Serialization;
|
|
|
|
namespace Sandbox.Services;
|
|
|
|
public class PackageUsageStats
|
|
{
|
|
public struct Group
|
|
{
|
|
/// <summary>
|
|
/// Unique Users
|
|
/// </summary>
|
|
public long Users { get; set; }
|
|
|
|
/// <summary>
|
|
/// Total combined user-seconds
|
|
/// </summary>
|
|
public long Seconds { get; set; }
|
|
|
|
/// <summary>
|
|
/// Total sessions
|
|
/// </summary>
|
|
public long Sessions { get; set; }
|
|
|
|
[JsonIgnore]
|
|
public TimeSpan CombinedTime => TimeSpan.FromSeconds( Seconds );
|
|
|
|
[JsonIgnore]
|
|
public TimeSpan AverageTime => TimeSpan.FromSeconds( Seconds / MathF.Max( Users, 1 ) );
|
|
}
|
|
|
|
public Group Total { get; set; }
|
|
public Group Month { get; set; }
|
|
public Group Week { get; set; }
|
|
public Group Day { get; set; }
|
|
|
|
public long UsersNow { get; set; }
|
|
public double Trend { get; set; }
|
|
}
|