accept matches
TODO: make it a button
This commit is contained in:
@@ -39,8 +39,9 @@ public partial class MainViewModel : ObservableObject, IDisposable
|
||||
[ObservableProperty]
|
||||
public partial string ConnectionStatus { get; private set; } = "Not connected.";
|
||||
|
||||
|
||||
|
||||
[ObservableProperty]
|
||||
public partial bool AutoAccept { get; set; } = true;
|
||||
|
||||
private Dictionary<int, ChampionData> _allChampions = [];
|
||||
private List<int> _needChampionIds = [];
|
||||
private readonly APIClient _client = new();
|
||||
@@ -93,9 +94,20 @@ public partial class MainViewModel : ObservableObject, IDisposable
|
||||
{
|
||||
case "/lol-matchmaking/v1/ready-check":
|
||||
LolMatchmakingMatchmakingReadyCheckResource? readyCheck = apiEvent.Data.Deserialize<LolMatchmakingMatchmakingReadyCheckResource>();
|
||||
if (readyCheck is not null && readyCheck.PlayerResponse == LolMatchmakingMatchmakingReadyCheckResponse.Accepted)
|
||||
if (readyCheck is not null)
|
||||
{
|
||||
await UpdateNeedChampionIdsAsync();
|
||||
if (readyCheck.PlayerResponse != LolMatchmakingMatchmakingReadyCheckResponse.Accepted)
|
||||
{
|
||||
if (AutoAccept)
|
||||
{
|
||||
await Task.Delay(TimeSpan.FromMilliseconds(Random.Shared.Next(100, 1500)));
|
||||
await _client.MatchmakingAcceptAsync();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
await UpdateNeedChampionIdsAsync();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "/lol-champ-select/v1/session":
|
||||
|
||||
Reference in New Issue
Block a user