-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSmartSwitch.cs
More file actions
37 lines (26 loc) · 1.52 KB
/
Copy pathSmartSwitch.cs
File metadata and controls
37 lines (26 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using RustPlusBot.Abstractions.Connections;
namespace RustPlusBot.Domain.Switches;
/// <summary>A paired Smart Switch the bot manages, surviving restarts. Guild- and server-scoped.</summary>
public sealed class SmartSwitch
{
/// <summary>Surrogate primary key.</summary>
public Guid Id { get; set; } = Guid.NewGuid();
/// <summary>The owning Discord guild snowflake.</summary>
public ulong GuildId { get; set; }
/// <summary>The server this switch belongs to (FK to RustServer, cascade delete).</summary>
public Guid ServerId { get; set; }
/// <summary>The in-game smart-switch entity id.</summary>
public ulong EntityId { get; set; }
/// <summary>User-facing label; defaults to a generated "Switch <EntityId>" (the FCM event carries no name).</summary>
public string Name { get; set; } = string.Empty;
/// <summary>The Discord message id of this switch's embed, or null until first posted.</summary>
public ulong? MessageId { get; set; }
/// <summary>The Discord user who accepted (validated) the pairing.</summary>
public ulong PairedByUserId { get; set; }
/// <summary>The last observed on/off state.</summary>
public bool LastIsActive { get; set; }
/// <summary>When the switch was accepted (UTC).</summary>
public DateTimeOffset CreatedUtc { get; set; }
/// <summary>Per-device reachability; defaults to Reachable. Orthogonal to whole-server connection status.</summary>
public DeviceReachability Reachability { get; set; } = DeviceReachability.Reachable;
}