Skip to content

Commit c3372a6

Browse files
committed
Revert
1 parent 4b1d9c4 commit c3372a6

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

Common/Models/WebSocket/User/Control.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace OpenShock.Common.Models.WebSocket.User;
66
// ReSharper disable once ClassNeverInstantiated.Global
77
public sealed class Control
88
{
9-
public required Guid ShockerId { get; set; }
9+
public required Guid Id { get; set; }
1010

1111
[EnumDataType(typeof(ControlType))]
1212
public required ControlType Type { get; set; }

Common/Services/ControlSender.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,18 +117,18 @@ private async Task<OneOf<Success, ShockerNotFoundOrNoAccess, ShockerPaused, Shoc
117117
var now = DateTime.UtcNow;
118118

119119
foreach (var (control, shocker) in controls
120-
.Select(c => (Control: c, Shocker: allowedShockers.FirstOrDefault(s => s.ShockerId == c.ShockerId)))
121-
.GroupBy(x => (x.Control.ShockerId, x.Shocker?.ShockerRfId))
120+
.Select(c => (Control: c, Shocker: allowedShockers.FirstOrDefault(s => s.ShockerId == c.Id)))
121+
.GroupBy(x => (ShockerId: x.Control.Id, x.Shocker?.ShockerRfId))
122122
.Select(x => x.Last()))
123123
{
124124
if (shocker is null)
125-
return new ShockerNotFoundOrNoAccess(control.ShockerId);
125+
return new ShockerNotFoundOrNoAccess(control.Id);
126126

127127
if (shocker.Paused)
128-
return new ShockerPaused(control.ShockerId);
128+
return new ShockerPaused(control.Id);
129129

130130
if (!PermissionUtils.IsAllowed(control.Type, false, shocker.PermsAndLimits))
131-
return new ShockerNoPermission(control.ShockerId);
131+
return new ShockerNoPermission(control.Id);
132132

133133
Clamp(control, shocker.PermsAndLimits);
134134

0 commit comments

Comments
 (0)