Skip to content

Open-source download manager & offline media toolbox for YouTube, music, social media, learning platforms & 1,800+ sites. Built with Tauri 2.0, Rust & Svelte.

feat(league): agrupar premades pelo party id do jogo (#253)

antoniod39dff2218cb
diff --git a/src-tauri/omniget-core/src/models/settings.rs b/src-tauri/omniget-core/src/models/settings.rs
index 7b5f818d..3c1fe48c 100644
--- a/src-tauri/omniget-core/src/models/settings.rs
+++ b/src-tauri/omniget-core/src/models/settings.rs
@@ -52,6 +52,8 @@ pub struct LeagueSettings {
#[serde(default)]
pub auto_accept: bool,
#[serde(default)]
+ pub auto_accept_delay: u8,
+ #[serde(default)]
pub auto_pick: bool,
#[serde(default)]
pub auto_ban: bool,
@@ -84,6 +86,7 @@ impl Default for LeagueSettings {
Self {
enabled: default_league_enabled(),
auto_accept: false,
+ auto_accept_delay: 0,
auto_pick: false,
auto_ban: false,
auto_lock: false,
diff --git a/src-tauri/src/commands/league/mod.rs b/src-tauri/src/commands/league/mod.rs
index 236ea454..483720dc 100644
--- a/src-tauri/src/commands/league/mod.rs
+++ b/src-tauri/src/commands/league/mod.rs
@@ -520,9 +520,21 @@ fn player_identity(entry: &Value, is_ally: bool) -> Value {
"championId": entry.get("championId").and_then(Value::as_i64).unwrap_or(0),
"cellId": entry.get("cellId").and_then(Value::as_i64),
"isAlly": is_ally,
+ "partyId": party_id(entry),
})
}
+/// The gameflow session tags every player with the party it queued in, which is
+/// the server's own grouping — far better than guessing from shared history.
+/// Champ select does not carry it, so it stays null there.
+fn party_id(entry: &Value) -> Value {
+ match entry.get("teamParticipantId") {
+ Some(Value::String(s)) if !s.is_empty() => json!(s),
+ Some(Value::Number(n)) => json!(n.to_string()),
+ _ => Value::Null,
+ }
+}
+
#[tauri::command]
pub async fn league_game_players() -> Result<Value, String> {
ensure_enabled()?;
@@ -1148,18 +1160,29 @@ pub async fn league_match_analysis() -> Result<Value, String> {
let win = stats::team_win_probability(&ally_strengths, &enemy_strengths);
- // Two players who keep appearing in the same games are queueing together.
- let mut pairs: Vec<(usize, usize, u32)> = Vec::new();
- for i in 0..players.len() {
- for j in (i + 1)..players.len() {
- let a: HashSet<i64> = histories[i].iter().copied().collect();
- let shared = histories[j].iter().filter(|id| a.contains(id)).count() as u32;
- if shared > 0 {
- pairs.push((i, j, shared));
+ let party_ids: Vec<Option<String>> = players
+ .iter()
+ .map(|p| p.get("partyId").and_then(Value::as_str).map(str::to_string))
+ .collect();
+ let official = stats::party_groups(&party_ids);
+ let from_party = !official.is_empty();
+ let groups = if from_party {
+ official
+ } else {
+ // Fallback for champ select, where the party id is absent: two players
+ // who keep appearing in the same games are queueing together.
+ let mut pairs: Vec<(usize, usize, u32)> = Vec::new();
+ for i in 0..players.len() {
+ for j in (i + 1)..players.len() {
+ let a: HashSet<i64> = histories[i].iter().copied().collect();
+ let shared = histories[j].iter().filter(|id| a.contains(id)).count() as u32;
+ if shared > 0 {
+ pairs.push((i, j, shared));
+ }
}
}
- }
- let groups = stats::premade_groups(players.len(), &pairs, 3);
+ stats::premade_groups(players.len(), &pairs, 3)
+ };
let premades: Vec<Value> = groups
.iter()
.enumerate()
@@ -1183,6 +1206,7 @@ pub async fn league_match_analysis() -> Result<Value, String> {
"totalPlayers": win.total_players,
"players": detail,
"premades": premades,
+ "premadeSource": if from_party { "party" } else { "history" },
}))
}
diff --git a/src-tauri/src/commands/league/stats.rs b/src-tauri/src/commands/league/stats.rs
index ddd9eeff..8c3b30ed 100644
--- a/src-tauri/src/commands/league/stats.rs
+++ b/src-tauri/src/commands/league/stats.rs
@@ -483,6 +483,24 @@ pub fn impact_score(input: &ImpactInput) -> f64 {
.clamp(0.0, 10.0)
}
+/// Groups players that share a party id, which the gameflow session reports
+/// directly. Solo players carry a unique id, so single-player groups are
+/// dropped just like in the history-based detection.
+pub fn party_groups(party_ids: &[Option<String>]) -> Vec<Vec<usize>> {
+ let mut buckets: std::collections::HashMap<&str, Vec<usize>> = std::collections::HashMap::new();
+ for (index, id) in party_ids.iter().enumerate() {
+ if let Some(id) = id.as_deref().filter(|s| !s.is_empty()) {
+ buckets.entry(id).or_default().push(index);
+ }
+ }
+ let mut groups: Vec<Vec<usize>> = buckets.into_values().filter(|g| g.len() > 1).collect();
+ for group in groups.iter_mut() {
+ group.sort_unstable();
+ }
+ groups.sort_by(|a, b| a[0].cmp(&b[0]));
+ groups
+}
+
/// Disjoint-set forest used to merge overlapping premade pairs.
struct DisjointSet {
parent: Vec<usize>,
@@ -847,6 +865,35 @@ mod tests {
assert_eq!(groups, vec![vec![0, 1], vec![2, 3]]);
}
+ fn ids(values: &[&str]) -> Vec<Option<String>> {
+ values
+ .iter()
+ .map(|v| {
+ if v.is_empty() {
+ None
+ } else {
+ Some(v.to_string())
+ }
+ })
+ .collect()
+ }
+
+ #[test]
+ fn party_ids_group_a_duo_and_a_trio_and_drop_solos() {
+ // Solo queuers each carry their own party id.
+ let groups = party_groups(&ids(&["p1", "p2", "p1", "p3", "p2", "p2"]));
+ assert_eq!(groups, vec![vec![0, 2], vec![1, 4, 5]]);
+ }
+
+ #[test]
+ fn missing_party_ids_are_never_grouped_together() {
+ // Champ select carries no party id: absent must not read as "same party".
+ assert!(party_groups(&ids(&["", "", "", "", ""])).is_empty());
+ assert!(party_groups(&[]).is_empty());
+ let groups = party_groups(&ids(&["", "p9", "", "p9"]));
+ assert_eq!(groups, vec![vec![1, 3]]);
+ }
+
#[test]
fn role_targets_reflect_role_reality() {
let sup = default_targets("UTILITY");
diff --git a/src-tauri/src/commands/league/ws.rs b/src-tauri/src/commands/league/ws.rs
index c4f273dd..74762d9a 100644
--- a/src-tauri/src/commands/league/ws.rs
+++ b/src-tauri/src/commands/league/ws.rs
@@ -13,13 +13,39 @@ static APP: OnceCell<tauri::AppHandle> = OnceCell::new();
static STARTED: AtomicBool = AtomicBool::new(false);
static WS_CONNECTED: AtomicBool = AtomicBool::new(false);
static MESSAGE_SENT: AtomicBool = AtomicBool::new(false);
+static ACCEPT_PENDING: AtomicBool = AtomicBool::new(false);
static TRADES_HANDLED: once_cell::sync::Lazy<tokio::sync::Mutex<std::collections::HashSet<i64>>> =
once_cell::sync::Lazy::new(|| tokio::sync::Mutex::new(std::collections::HashSet::new()));
+/// A queue pops after roughly twelve seconds without an answer, so a longer
+/// delay would simply waste the queue slot.
+const MAX_ACCEPT_DELAY: u8 = 11;
+
pub fn is_connected() -> bool {
WS_CONNECTED.load(Ordering::Relaxed)
}
+fn pending_ready_check(state: &str) -> bool {
+ state == "InProgress"
+}
+
+fn accept_delay_seconds(setting: u8) -> u8 {
+ setting.min(MAX_ACCEPT_DELAY)
+}
+
+/// A ready check is only worth accepting while it is still open and the user has
+/// not answered it: an explicit decline must never be overridden.
+fn should_accept_ready_check(state: &str, player_response: &str) -> bool {
+ pending_ready_check(state) && player_response == "None"
+}
+
+async fn accept_ready_check(client: &LcuClient) {
+ match lcu_post_raw(client, "/lol-matchmaking/v1/ready-check/accept").await {
+ Ok(_) => tracing::info!("[league] ready check accepted"),
+ Err(e) => tracing::warn!("[league] auto-accept failed: {}", e),
+ }
+}
+
fn emit(event: &str, payload: Value) {
if let Some(app) = APP.get() {
let _ = app.emit(event, payload);
@@ -165,13 +191,43 @@ async fn handle_event(client: &LcuClient, value: &Value) {
.and_then(Value::as_str)
.unwrap_or("");
emit("league-ready-check", data.clone());
- if state == "InProgress"
- && response == "None"
+ if !pending_ready_check(state) {
+ ACCEPT_PENDING.store(false, Ordering::SeqCst);
+ }
+ if should_accept_ready_check(state, response)
&& super::AUTO_ACCEPT.load(Ordering::Relaxed)
{
- match lcu_post_raw(client, "/lol-matchmaking/v1/ready-check/accept").await {
- Ok(_) => tracing::info!("[league] ready check accepted"),
- Err(e) => tracing::warn!("[league] auto-accept failed: {}", e),
+ let delay = accept_delay_seconds(league_settings().auto_accept_delay);
+ if delay == 0 {
+ accept_ready_check(client).await;
+ } else if !ACCEPT_PENDING.swap(true, Ordering::SeqCst) {
+ // The client re-emits the ready check every tick, so the
+ // countdown must be started only once.
+ let client = client.clone();
+ tauri::async_runtime::spawn(async move {
+ tokio::time::sleep(std::time::Duration::from_secs(delay as u64)).await;
+ ACCEPT_PENDING.store(false, Ordering::SeqCst);
+ // The user may have declined during the countdown, so
+ // the current state decides, not the event that started it.
+ match lcu_get_raw(&client, "/lol-matchmaking/v1/ready-check").await {
+ Ok(current) => {
+ let state =
+ current.get("state").and_then(Value::as_str).unwrap_or("");
+ let response = current
+ .get("playerResponse")
+ .and_then(Value::as_str)
+ .unwrap_or("");
+ if should_accept_ready_check(state, response) {
+ accept_ready_check(&client).await;
+ } else {
+ tracing::debug!(
+ "[league] auto-accept skipped: no longer pending"
+ );
+ }
+ }
+ Err(e) => tracing::debug!("[league] ready check re-read failed: {}", e),
+ }
+ });
}
}
}
@@ -393,3 +449,34 @@ async fn honor_from_ballot(client: &LcuClient, ballot: &Value) {
Err(e) => tracing::debug!("[league] auto-honor failed: {}", e),
}
}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[test]
+ fn an_open_and_unanswered_ready_check_is_accepted() {
+ assert!(should_accept_ready_check("InProgress", "None"));
+ }
+
+ #[test]
+ fn a_declined_ready_check_is_never_overridden() {
+ assert!(!should_accept_ready_check("InProgress", "Declined"));
+ assert!(!should_accept_ready_check("InProgress", "Accepted"));
+ }
+
+ #[test]
+ fn a_closed_ready_check_is_left_alone() {
+ for state in ["Invalid", "EveryoneReady", "StrangerNotReady", ""] {
+ assert!(!should_accept_ready_check(state, "None"), "state {}", state);
+ assert!(!pending_ready_check(state), "state {}", state);
+ }
+ }
+
+ #[test]
+ fn the_delay_is_capped_below_the_queue_timeout() {
+ assert_eq!(accept_delay_seconds(255), MAX_ACCEPT_DELAY);
+ assert_eq!(accept_delay_seconds(3), 3);
+ assert_eq!(accept_delay_seconds(0), 0);
+ }
+}
diff --git a/src/components/league/AnalysisTab.svelte b/src/components/league/AnalysisTab.svelte
index 5a4a380c..7c310fea 100644
--- a/src/components/league/AnalysisTab.svelte
+++ b/src/components/league/AnalysisTab.svelte
@@ -115,6 +115,11 @@
{#each analysis.premades as group (group.label)}
<span class="scout-tag">{group.label}: {group.puuids.length} {$t("league.players")}</span>
{/each}
+ <span class="premade-source">
+ {analysis.premadeSource === "party"
+ ? $t("league.premade_source_party")
+ : $t("league.premade_source_history")}
+ </span>
</div>
{/if}
</section>
diff --git a/src/components/league/AutomationTab.svelte b/src/components/league/AutomationTab.svelte
index 622aaf40..ea372d3c 100644
--- a/src/components/league/AutomationTab.svelte
+++ b/src/components/league/AutomationTab.svelte
@@ -18,6 +18,13 @@
let pickSearch = $state("");
let banSearch = $state("");
+ let acceptDelay = $derived(settings?.league?.auto_accept_delay ?? 0);
+
+ function changeAcceptDelay(event: Event) {
+ const value = Number((event.currentTarget as HTMLInputElement).value);
+ updateSettings({ league: { auto_accept_delay: value } });
+ }
+
async function toggleAutoAccept() {
const next = !autoAccept;
autoAccept = next;
@@ -85,6 +92,30 @@
<span class="toggle-knob"></span>
</button>
</div>
+ {#if autoAccept}
+ <div class="delay-block">
+ <span class="list-label">
+ {$t("league.accept_delay")}
+ <span class="list-hint">
+ {acceptDelay === 0 ? $t("league.accept_delay_instant") : `${acceptDelay}s`}
+ </span>
+ </span>
+ <div class="slider-row">
+ <span class="slider-edge">0s</span>
+ <input
+ type="range"
+ min="0"
+ max="11"
+ step="1"
+ value={acceptDelay}
+ oninput={changeAcceptDelay}
+ aria-label={$t("league.accept_delay") as string}
+ />
+ <span class="slider-edge">11s</span>
+ </div>
+ <span class="action-hint">{$t("league.accept_delay_desc")}</span>
+ </div>
+ {/if}
<div class="divider"></div>
<div class="action-row">
<div class="action-col">
diff --git a/src/lib/i18n/el.json b/src/lib/i18n/el.json
index f4fa081e..61fb9275 100644
--- a/src/lib/i18n/el.json
+++ b/src/lib/i18n/el.json
@@ -112,6 +112,8 @@
"win_disclaimer": "Το matchmaking φτιάχνει αγώνες με προσδοκία 50%, οπότε οι τίμιες εκτιμήσεις μένουν κοντά στο ισόπαλο. Δες το ως τάση, όχι ετυμηγορία.",
"win_unavailable": "Διαθέσιμο στην επιλογή ηρώων και εντός αγώνα.",
"premades": "Ομάδες (premade)",
+ "premade_source_party": "Από τα δεδομένα του παιχνιδιού",
+ "premade_source_history": "Εκτίμηση από κοινό ιστορικό",
"players": "παίκτες",
"gold_title": "Ζωντανή οικονομία",
"gold_unavailable": "Μπες σε αγώνα για να δεις χρυσό και διαφορές lane.",
@@ -227,6 +229,9 @@
"accept_now": "Αποδοχή αγώνα",
"auto_accept": "Αυτόματη αποδοχή αγώνων",
"auto_accept_desc": "Αποδέχεται τον αγώνα για εσάς μόλις εμφανιστεί.",
+ "accept_delay": "Αναμονή πριν την αποδοχή",
+ "accept_delay_instant": "αμέσως",
+ "accept_delay_desc": "Σου αφήνει χρόνο να αρνηθείς. Η άρνηση κατά την αναμονή ακυρώνει την αυτόματη αποδοχή.",
"ranked_solo": "Κατάταξη Solo/Duo",
"ranked_flex": "Κατάταξη Flex",
"unranked": "Χωρίς κατάταξη",
diff --git a/src/lib/i18n/en.json b/src/lib/i18n/en.json
index 5569ccdf..47a65874 100644
--- a/src/lib/i18n/en.json
+++ b/src/lib/i18n/en.json
@@ -130,6 +130,8 @@
"win_disclaimer": "Matchmaking builds games around a 50% expectation, so honest estimates stay close to even. Treat this as a lean, not a verdict.",
"win_unavailable": "Available during champion select and in game.",
"premades": "Premade groups",
+ "premade_source_party": "Reported by the game",
+ "premade_source_history": "Estimated from shared history",
"players": "players",
"gold_title": "Live economy",
"gold_unavailable": "Open a game to see live gold and lane differences.",
@@ -245,6 +247,9 @@
"accept_now": "Accept match",
"auto_accept": "Auto-accept matches",
"auto_accept_desc": "Accepts the ready check for you the moment a match pops.",
+ "accept_delay": "Wait before accepting",
+ "accept_delay_instant": "immediately",
+ "accept_delay_desc": "Leaves you a moment to decline yourself. Declining during the wait cancels the automatic accept.",
"ranked_solo": "Ranked Solo/Duo",
"ranked_flex": "Ranked Flex",
"unranked": "Unranked",
diff --git a/src/lib/i18n/es.json b/src/lib/i18n/es.json
index be8eb27a..7886535e 100644
--- a/src/lib/i18n/es.json
+++ b/src/lib/i18n/es.json
@@ -112,6 +112,8 @@
"win_disclaimer": "El emparejamiento crea partidas con una expectativa del 50%, así que las estimaciones honestas quedan cerca del empate. Tómalo como una tendencia, no un veredicto.",
"win_unavailable": "Disponible en la selección de campeones y en partida.",
"premades": "Grupos (premades)",
+ "premade_source_party": "Informado por el juego",
+ "premade_source_history": "Estimado por el historial compartido",
"players": "jugadores",
"gold_title": "Economía en vivo",
"gold_unavailable": "Entra en una partida para ver el oro y las diferencias de línea.",
@@ -227,6 +229,9 @@
"accept_now": "Aceptar partida",
"auto_accept": "Aceptar partidas automáticamente",
"auto_accept_desc": "Acepta la partida por ti en cuanto aparezca.",
+ "accept_delay": "Esperar antes de aceptar",
+ "accept_delay_instant": "inmediatamente",
+ "accept_delay_desc": "Te deja un momento para rechazar. Rechazar durante la espera cancela la aceptación automática.",
"ranked_solo": "Clasificatoria Solo/Dúo",
"ranked_flex": "Clasificatoria Flexible",
"unranked": "Sin clasificar",
diff --git a/src/lib/i18n/fr.json b/src/lib/i18n/fr.json
index 2603d7f2..df3d21e1 100644
--- a/src/lib/i18n/fr.json
+++ b/src/lib/i18n/fr.json
@@ -112,6 +112,8 @@
"win_disclaimer": "Le matchmaking crée des parties avec une attente de 50%, donc les estimations honnêtes restent proches de l'égalité. À prendre comme une tendance, pas un verdict.",
"win_unavailable": "Disponible pendant la sélection et en partie.",
"premades": "Groupes (premades)",
+ "premade_source_party": "Indiqué par le jeu",
+ "premade_source_history": "Estimé d'après l'historique commun",
"players": "joueurs",
"gold_title": "Économie en direct",
"gold_unavailable": "Lancez une partie pour voir l'or et les écarts de voie.",
@@ -227,6 +229,9 @@
"accept_now": "Accepter la partie",
"auto_accept": "Accepter les parties automatiquement",
"auto_accept_desc": "Accepte la partie pour vous dès qu'elle apparaît.",
+ "accept_delay": "Attendre avant d'accepter",
+ "accept_delay_instant": "immédiatement",
+ "accept_delay_desc": "Vous laisse un instant pour refuser. Refuser pendant l'attente annule l'acceptation automatique.",
"ranked_solo": "Classée Solo/Duo",
"ranked_flex": "Classée Flexible",
"unranked": "Non classé",
diff --git a/src/lib/i18n/it.json b/src/lib/i18n/it.json
index 06c9ba10..6a2c3f5a 100644
--- a/src/lib/i18n/it.json
+++ b/src/lib/i18n/it.json
@@ -112,6 +112,8 @@
"win_disclaimer": "Il matchmaking crea partite con un'aspettativa del 50%, quindi le stime oneste restano vicine alla parità. Consideralo un'inclinazione, non un verdetto.",
"win_unavailable": "Disponibile durante la selezione e in partita.",
"premades": "Gruppi (premade)",
+ "premade_source_party": "Riportato dal gioco",
+ "premade_source_history": "Stimato dalla cronologia condivisa",
"players": "giocatori",
"gold_title": "Economia in diretta",
"gold_unavailable": "Entra in partita per vedere oro e differenze di corsia.",
@@ -227,6 +229,9 @@
"accept_now": "Accetta partita",
"auto_accept": "Accetta partite automaticamente",
"auto_accept_desc": "Accetta la partita per te appena appare.",
+ "accept_delay": "Attendi prima di accettare",
+ "accept_delay_instant": "immediatamente",
+ "accept_delay_desc": "Ti lascia un momento per rifiutare. Rifiutare durante l'attesa annulla l'accettazione automatica.",
"ranked_solo": "Classificata Solo/Duo",
"ranked_flex": "Classificata Flessibile",
"unranked": "Non classificato",
diff --git a/src/lib/i18n/ja.json b/src/lib/i18n/ja.json
index 012a28fe..d81f5120 100644
--- a/src/lib/i18n/ja.json
+++ b/src/lib/i18n/ja.json
@@ -112,6 +112,8 @@
"win_disclaimer": "マッチメイキングは勝率50%を目標に組まれるため、誠実な推定は互角付近に留まります。傾向として見てください。",
"win_unavailable": "チャンピオン選択中と試合中に利用できます。",
"premades": "パーティー",
+ "premade_source_party": "ゲームからの情報",
+ "premade_source_history": "共通の試合履歴からの推定",
"players": "人",
"gold_title": "ライブ経済",
"gold_unavailable": "試合に入るとゴールドとレーン差が表示されます。",
@@ -227,6 +229,9 @@
"accept_now": "マッチを承認",
"auto_accept": "マッチを自動承認",
"auto_accept_desc": "マッチが見つかった瞬間に自動で承認します。",
+ "accept_delay": "承諾までの待機時間",
+ "accept_delay_instant": "すぐに",
+ "accept_delay_desc": "自分で辞退する余地を残します。待機中に辞退すると自動承諾は取り消されます。",
"ranked_solo": "ランク ソロ/デュオ",
"ranked_flex": "ランク フレックス",
"unranked": "アンランク",
diff --git a/src/lib/i18n/keys.ts b/src/lib/i18n/keys.ts
index 381a1592..09697343 100644
--- a/src/lib/i18n/keys.ts
+++ b/src/lib/i18n/keys.ts
@@ -391,6 +391,9 @@ export type TranslationKeys =
| 'hotmart.unavailable'
| 'hotmart.unknown_error'
+ | 'league.accept_delay'
+ | 'league.accept_delay_desc'
+ | 'league.accept_delay_instant'
| 'league.accept_now'
| 'league.auto_accept'
| 'league.auto_accept_desc'
@@ -497,6 +500,8 @@ export type TranslationKeys =
| 'league.pref_top'
| 'league.pref_top_mid'
| 'league.pref_unknown'
+ | 'league.premade_source_history'
+ | 'league.premade_source_party'
| 'league.premades'
| 'league.ranked_flex'
| 'league.ranked_solo'
diff --git a/src/lib/i18n/pt.json b/src/lib/i18n/pt.json
index 206038f1..c0a38c7d 100644
--- a/src/lib/i18n/pt.json
+++ b/src/lib/i18n/pt.json
@@ -112,6 +112,8 @@
"win_disclaimer": "O emparelhamento monta partidas com expectativa de 50%, então estimativas honestas ficam perto do empate. Trate como uma tendência, não como veredito.",
"win_unavailable": "Disponível na seleção de campeões e em partida.",
"premades": "Grupos (premades)",
+ "premade_source_party": "Informado pelo jogo",
+ "premade_source_history": "Estimado pelo histórico em comum",
"players": "jogadores",
"gold_title": "Economia ao vivo",
"gold_unavailable": "Entre em uma partida para ver ouro e diferenças de lane.",
@@ -227,6 +229,9 @@
"accept_now": "Aceitar partida",
"auto_accept": "Aceitar partidas automaticamente",
"auto_accept_desc": "Aceita a partida por você assim que ela aparecer.",
+ "accept_delay": "Esperar antes de aceitar",
+ "accept_delay_instant": "imediatamente",
+ "accept_delay_desc": "Deixa um instante para você recusar. Recusar durante a espera cancela o aceite automático.",
"ranked_solo": "Ranqueada Solo/Duo",
"ranked_flex": "Ranqueada Flexível",
"unranked": "Sem ranque",
diff --git a/src/lib/i18n/ru.json b/src/lib/i18n/ru.json
index 228ae39d..36784846 100644
--- a/src/lib/i18n/ru.json
+++ b/src/lib/i18n/ru.json
@@ -112,6 +112,8 @@
"win_disclaimer": "Подбор строит матчи с ожиданием 50%, поэтому честные оценки держатся около равенства. Считайте это склонностью, а не приговором.",
"win_unavailable": "Доступно при выборе чемпионов и в игре.",
"premades": "Группы (пати)",
+ "premade_source_party": "По данным игры",
+ "premade_source_history": "Оценка по общей истории матчей",
"players": "игроков",
"gold_title": "Экономика в игре",
"gold_unavailable": "Зайдите в игру, чтобы увидеть золото и разницу на линии.",
@@ -227,6 +229,9 @@
"accept_now": "Принять матч",
"auto_accept": "Автопринятие матчей",
"auto_accept_desc": "Принимает матч за вас, как только он найден.",
+ "accept_delay": "Пауза перед принятием",
+ "accept_delay_instant": "сразу",
+ "accept_delay_desc": "Оставляет время отказаться самому. Отказ во время паузы отменяет автопринятие.",
"ranked_solo": "Ранговая Соло/Дуо",
"ranked_flex": "Ранговая Флекс",
"unranked": "Без ранга",
diff --git a/src/lib/i18n/zh-TW.json b/src/lib/i18n/zh-TW.json
index 4e56a316..5bd83933 100644
--- a/src/lib/i18n/zh-TW.json
+++ b/src/lib/i18n/zh-TW.json
@@ -112,6 +112,8 @@
"win_disclaimer": "配對系統以 50% 勝率組建對戰,因此誠實的估計都接近五五開。請當作傾向參考,而非定論。",
"win_unavailable": "在英雄選擇與對戰中可用。",
"premades": "開黑小隊",
+ "premade_source_party": "遊戲提供的資訊",
+ "premade_source_history": "根據共同戰績推測",
"players": "名玩家",
"gold_title": "即時經濟",
"gold_unavailable": "進入對戰後可查看經濟與對線差距。",
@@ -227,6 +229,9 @@
"accept_now": "接受對戰",
"auto_accept": "自動接受對戰",
"auto_accept_desc": "對戰跳出的瞬間自動幫你接受。",
+ "accept_delay": "接受前等待",
+ "accept_delay_instant": "立即",
+ "accept_delay_desc": "留出時間讓你自己拒絕。等待期間拒絕會取消自動接受。",
"ranked_solo": "單雙積分",
"ranked_flex": "彈性積分",
"unranked": "未定位",
diff --git a/src/lib/i18n/zh.json b/src/lib/i18n/zh.json
index b340f79b..5dc87987 100644
--- a/src/lib/i18n/zh.json
+++ b/src/lib/i18n/zh.json
@@ -112,6 +112,8 @@
"win_disclaimer": "匹配系统按 50% 胜率组建对局,因此诚实的估计都接近五五开。请当作倾向参考,而非定论。",
"win_unavailable": "在英雄选择和对局中可用。",
"premades": "开黑小队",
+ "premade_source_party": "游戏提供的信息",
+ "premade_source_history": "根据共同战绩推测",
"players": "名玩家",
"gold_title": "实时经济",
"gold_unavailable": "进入对局后可查看经济与对线差距。",
@@ -227,6 +229,9 @@
"accept_now": "接受对局",
"auto_accept": "自动接受对局",
"auto_accept_desc": "对局弹出的瞬间自动帮你接受。",
+ "accept_delay": "接受前等待",
+ "accept_delay_instant": "立即",
+ "accept_delay_desc": "留出时间让你自己拒绝。等待期间拒绝会取消自动接受。",
"ranked_solo": "单双排位",
"ranked_flex": "灵活排位",
"unranked": "未定级",
diff --git a/src/lib/stores/settings-store.svelte.ts b/src/lib/stores/settings-store.svelte.ts
index d60a4d6e..3682fad7 100644
--- a/src/lib/stores/settings-store.svelte.ts
+++ b/src/lib/stores/settings-store.svelte.ts
@@ -93,6 +93,7 @@ export type AppSettings = {
league?: {
enabled?: boolean;
auto_accept?: boolean;
+ auto_accept_delay?: number;
auto_pick?: boolean;
auto_ban?: boolean;
auto_lock?: boolean;
diff --git a/src/routes/league/+page.svelte b/src/routes/league/+page.svelte
index f039f229..dbbd6af6 100644
--- a/src/routes/league/+page.svelte
+++ b/src/routes/league/+page.svelte
@@ -820,6 +820,30 @@
color: var(--gray);
}
+ .league-page :global(.delay-block) {
+ display: flex;
+ flex-direction: column;
+ gap: 6px;
+ margin-top: 10px;
+ }
+
+ .league-page :global(.slider-row) {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ }
+
+ .league-page :global(.slider-row input[type="range"]) {
+ flex: 1;
+ accent-color: var(--accent);
+ }
+
+ .league-page :global(.slider-edge) {
+ font-size: 11.5px;
+ color: var(--gray);
+ min-width: 26px;
+ }
+
.league-page :global(.list-hint) {
font-size: 11.5px;
}
@@ -1008,6 +1032,11 @@
margin-top: 10px;
}
+ .league-page :global(.premade-source) {
+ font-size: 0.75rem;
+ color: var(--text-muted);
+ }
+
.league-page :global(.gold-summary) {
display: flex;
align-items: center;