Let players finish a daily quest game started before midnight instead of being sent back to the start
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
c3e494b8a6
commit
4a44306e30
24 changed files with 327 additions and 81 deletions
|
|
@ -106,7 +106,10 @@ export function loadDaily() {
|
|||
return request("/daily");
|
||||
}
|
||||
|
||||
/** Un essai vaut pour le jour affiché : après minuit, le serveur le refuse et la nouvelle partie doit être chargée. */
|
||||
/**
|
||||
* Un essai vaut pour le jour affiché : une partie commencée avant minuit se termine sur son jour ; finie, ou plus
|
||||
* ancienne, le serveur la refuse et la nouvelle partie doit être chargée.
|
||||
*/
|
||||
export function guessDaily(day, cardId) {
|
||||
return request("/daily/guesses", { method: "POST", body: JSON.stringify({ day, cardId }) });
|
||||
}
|
||||
|
|
@ -188,8 +191,8 @@ export function resetMirror() {
|
|||
}
|
||||
|
||||
/** Image mélangée de la partie (ou en ordre, pour le modèle) : chargée en blob, à libérer avec URL.revokeObjectURL. */
|
||||
export async function loadMirrorImage(mode, { model = false, version = 0 } = {}) {
|
||||
const response = await fetch(`/api/cards/mirror/image?mode=${encodeURIComponent(mode)}&v=${version}${model ? "&model=1" : ""}`, { credentials: "same-origin" });
|
||||
export async function loadMirrorImage(mode, { model = false, version = 0, day = "" } = {}) {
|
||||
const response = await fetch(`/api/cards/mirror/image?mode=${encodeURIComponent(mode)}&v=${version}${model ? "&model=1" : ""}${day ? `&day=${encodeURIComponent(day)}` : ""}`, { credentials: "same-origin" });
|
||||
if (!response.ok) throw Object.assign(new Error("L’image du Miroir est indisponible."), { status: response.status });
|
||||
return URL.createObjectURL(await response.blob());
|
||||
}
|
||||
|
|
@ -203,9 +206,12 @@ export function flipDailyHint(day, hint) {
|
|||
return request("/daily/hints", { method: "POST", body: JSON.stringify({ day, hint }) });
|
||||
}
|
||||
|
||||
/** L'illustration du jour n'a pas d'adresse publique : elle est chargée en blob, à libérer avec URL.revokeObjectURL. */
|
||||
export async function loadDailyImage() {
|
||||
const response = await fetch("/api/cards/daily/image", { credentials: "same-origin" });
|
||||
/**
|
||||
* L'illustration du jour n'a pas d'adresse publique : elle est chargée en blob, à libérer avec URL.revokeObjectURL.
|
||||
* `day` : jour de la partie affichée, pour finir après minuit celle de la veille.
|
||||
*/
|
||||
export async function loadDailyImage(day = "") {
|
||||
const response = await fetch(`/api/cards/daily/image${day ? `?day=${encodeURIComponent(day)}` : ""}`, { credentials: "same-origin" });
|
||||
if (!response.ok) throw Object.assign(new Error("L’illustration du jour est indisponible."), { status: response.status });
|
||||
return URL.createObjectURL(await response.blob());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue