accept matches
TODO: make it a button
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
Height="480"
|
||||
Width="700"
|
||||
Background="#0a1a2a"
|
||||
Topmost="True"
|
||||
>
|
||||
<Window.DataContext>
|
||||
<vm:MainViewModel />
|
||||
@@ -60,6 +61,7 @@
|
||||
<MenuItem Header="Start Queueing" Command="{Binding StartQueueingCommand}" />
|
||||
<Separator />
|
||||
<MenuItem Header="Topmost" IsCheckable="True" IsChecked="{Binding Topmost, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:MainWindow}}}" />
|
||||
<MenuItem Header="Auto Accept" IsCheckable="True" IsChecked="{Binding AutoAccept}" />
|
||||
<Separator />
|
||||
<MenuItem Header="Reload ARAM Balance" Command="{Binding ReloadARAMBalanceCommand}" />
|
||||
<Separator />
|
||||
|
||||
@@ -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