Only allocate a key belonging to the game
This commit is contained in:
parent
b4d3960dad
commit
470228624d
1 changed files with 2 additions and 1 deletions
|
@ -34,7 +34,8 @@ namespace LANCommander.Controllers.Api
|
|||
if (existing != null)
|
||||
await KeyService.Release(existing.Id);
|
||||
|
||||
var availableKey = KeyService.Get(k =>
|
||||
var availableKey = KeyService.Get(k => k.Game.Id == id)
|
||||
.Where(k =>
|
||||
(k.AllocationMethod == Data.Models.KeyAllocationMethod.MacAddress && String.IsNullOrWhiteSpace(k.ClaimedByMacAddress))
|
||||
||
|
||||
(k.AllocationMethod == Data.Models.KeyAllocationMethod.UserAccount && k.ClaimedByUser == null))
|
||||
|
|
Loading…
Add table
Reference in a new issue