Client: clear the game cache on Play, remember the friend's server login

- clear_game_cache removes Cache/WDB/<locale>/*.wdb before every Play (own server and
  friend's), on by default, switch in the client card; nothing else in Cache or Data.
- The connection profile keeps the listed realm it was joined through; Play fills that
  realm's saved account into GlueConfig.json every time. A host typed by hand drops it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ДмитрийandClaude Opus 5.5 committed 2026-11-15 20:51:40 +05:00
1 parent 260d10b729
commit d64fdb51be
16 files changed
+149

No files matched your search

+8
View File
@@ -9,6 +9,12 @@ export function ClientGraphics({ serverId }: { serverId: string }) {
const [busy, setBusy] = useState(false);
const [error, setError] = useState<string | null>(null);
useEffect(() => { void api.clientGraphics(serverId).then(setState).catch(e => setError(asUiError(e).technical)); }, [serverId]);
const [clearCache, setClearCache] = useState<boolean | null>(null);
useEffect(() => { void api.clearGameCacheOnPlay().then(setClearCache).catch(() => setClearCache(true)); }, []);
async function changeClearCache(on: boolean) {
setClearCache(on);
try { await api.setClearGameCacheOnPlay(on); } catch (e) { setClearCache(!on); setError(asUiError(e).technical); }
}
async function change(name: string, disabled: boolean) {
setBusy(true); setError(null);
try { setState(await api.clientSetGraphics(serverId, name, disabled)); await checkClient(serverId); }
@@ -19,6 +25,8 @@ export function ClientGraphics({ serverId }: { serverId: string }) {
<label className="flex items-center gap-2 text-sm"><input type="checkbox" checked={state?.dxvk_disabled ?? false} disabled={!state || busy} onChange={e => void change("d3d9.dll", e.target.checked)} />{t("client.graphics.dxvk")}</label>
<label className="flex items-center gap-2 text-sm"><input type="checkbox" checked={state?.enhancements_disabled ?? false} disabled={!state || busy} onChange={e => void change("dxgi.dll", e.target.checked)} />{t("client.graphics.enhancements")}</label>
<p className="text-xs text-muted">{t("client.graphics.hint")}</p>
<label className="flex items-center gap-2 text-sm"><input type="checkbox" checked={clearCache ?? true} disabled={clearCache === null} onChange={e => void changeClearCache(e.target.checked)} />{t("client.clearCache")}</label>
<p className="text-xs text-muted">{t("client.clearCacheHint")}</p>
{error && <p className="text-sm text-bad" role="alert">{error}</p>}
</div>;
}