accept matches

TODO: make it a button
This commit is contained in:
2026-04-29 01:20:37 +02:00
parent 1f258ef61c
commit 076c0a9a8d
3 changed files with 19 additions and 5 deletions
+2
View File
@@ -10,6 +10,7 @@
Height="480" Height="480"
Width="700" Width="700"
Background="#0a1a2a" Background="#0a1a2a"
Topmost="True"
> >
<Window.DataContext> <Window.DataContext>
<vm:MainViewModel /> <vm:MainViewModel />
@@ -60,6 +61,7 @@
<MenuItem Header="Start Queueing" Command="{Binding StartQueueingCommand}" /> <MenuItem Header="Start Queueing" Command="{Binding StartQueueingCommand}" />
<Separator /> <Separator />
<MenuItem Header="Topmost" IsCheckable="True" IsChecked="{Binding Topmost, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:MainWindow}}}" /> <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 /> <Separator />
<MenuItem Header="Reload ARAM Balance" Command="{Binding ReloadARAMBalanceCommand}" /> <MenuItem Header="Reload ARAM Balance" Command="{Binding ReloadARAMBalanceCommand}" />
<Separator /> <Separator />
+14 -2
View File
@@ -39,7 +39,8 @@ public partial class MainViewModel : ObservableObject, IDisposable
[ObservableProperty] [ObservableProperty]
public partial string ConnectionStatus { get; private set; } = "Not connected."; public partial string ConnectionStatus { get; private set; } = "Not connected.";
[ObservableProperty]
public partial bool AutoAccept { get; set; } = true;
private Dictionary<int, ChampionData> _allChampions = []; private Dictionary<int, ChampionData> _allChampions = [];
private List<int> _needChampionIds = []; private List<int> _needChampionIds = [];
@@ -93,10 +94,21 @@ public partial class MainViewModel : ObservableObject, IDisposable
{ {
case "/lol-matchmaking/v1/ready-check": case "/lol-matchmaking/v1/ready-check":
LolMatchmakingMatchmakingReadyCheckResource? readyCheck = apiEvent.Data.Deserialize<LolMatchmakingMatchmakingReadyCheckResource>(); LolMatchmakingMatchmakingReadyCheckResource? readyCheck = apiEvent.Data.Deserialize<LolMatchmakingMatchmakingReadyCheckResource>();
if (readyCheck is not null && readyCheck.PlayerResponse == LolMatchmakingMatchmakingReadyCheckResponse.Accepted) if (readyCheck is not null)
{
if (readyCheck.PlayerResponse != LolMatchmakingMatchmakingReadyCheckResponse.Accepted)
{
if (AutoAccept)
{
await Task.Delay(TimeSpan.FromMilliseconds(Random.Shared.Next(100, 1500)));
await _client.MatchmakingAcceptAsync();
}
}
else
{ {
await UpdateNeedChampionIdsAsync(); await UpdateNeedChampionIdsAsync();
} }
}
break; break;
case "/lol-champ-select/v1/session": case "/lol-champ-select/v1/session":
ChampSelectSession? session = apiEvent.Data.Deserialize<ChampSelectSession>(); ChampSelectSession? session = apiEvent.Data.Deserialize<ChampSelectSession>();
+1 -1
View File
@@ -49,7 +49,7 @@ public class LcuWebsocket : IDisposable
{ {
ProcessInfo = ProcessFinder.GetProcessInfo(); ProcessInfo = ProcessFinder.GetProcessInfo();
} }
catch (Exception ex) catch
{ {
return; return;
} }