-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
API side of space-wizards/RobustToolbox#5446
- Loading branch information
Showing
8 changed files
with
2,165 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel.DataAnnotations; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace SS14.Auth.Shared.Data; | ||
|
||
/// <summary> | ||
/// A single HWID known to the authorization database. | ||
/// </summary> | ||
public sealed class Hwid | ||
{ | ||
/// <summary> | ||
/// Type code for <see cref="TypeCode"/>. | ||
/// </summary> | ||
public const int Type1 = 1; | ||
|
||
public long Id { get; set; } | ||
|
||
/// <summary> | ||
/// Intended to be used for administration of the database. | ||
/// </summary> | ||
public int TypeCode { get; set; } | ||
|
||
/// <summary> | ||
/// Data returned by client. | ||
/// </summary> | ||
[Required] public byte[] ClientData { get; set; } | ||
|
||
/// <summary> | ||
/// ID value given to servers. | ||
/// </summary> | ||
[Required] public byte[] Value { get; set; } | ||
|
||
/// <summary> | ||
/// Users that have been "spotted" using this HWID. | ||
/// </summary> | ||
[JsonIgnore] | ||
public List<HwidUser> Users { get; set; } = default!; | ||
} | ||
|
||
/// <summary> | ||
/// A hit of a user ever having used an HWID. | ||
/// </summary> | ||
public sealed class HwidUser | ||
{ | ||
public long Id { get; set; } | ||
|
||
/// <summary> | ||
/// ID of the <see cref="Hwid"/> that this user was seen to be using. | ||
/// </summary> | ||
public long HwidId { get; set; } | ||
public Guid SpaceUserId { get; set; } | ||
|
||
/// <summary> | ||
/// When the user was first seen using this HWID. | ||
/// </summary> | ||
public DateTime FirstSeen { get; set; } | ||
|
||
public Hwid Hwid { get; set; } = null!; | ||
|
||
[JsonIgnore] | ||
public SpaceUser SpaceUser { get; set; } = null!; | ||
} |
Oops, something went wrong.