Skip to content

Commit 35ffe53

Browse files
committed
disabled downloads when no mirrors + official account present, notification for users that they need mirrors to download the game, and name improvement
1 parent 1b4eb3b commit 35ffe53

29 files changed

+254
-177
lines changed

Docs/English/Technical/ServicesReference.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ All services are registered as singletons in `Bootstrapper.cs` and injected via
1616
- **Mods exact targeting:** mod IPC accepts optional `instanceId`; when provided, it has priority over branch/version to prevent collisions between multiple instances with the same version.
1717
- **Mods changelog:** `hyprism:mods:changelog` returns the (best-effort) plaintext changelog for a specific CurseForge mod file (`modId` + `fileId`).
1818
- **Instance operations targeting:** instance delete/saves IPC handlers accept `instanceId` and resolve by GUID first, with branch/version kept only as backward-compatible fallback.
19-
- **Instance import:** `hyprism:instance:import` supports importing from both ZIP archives and PWR patch files. ZIP files are extracted directly; PWR files are applied using Butler to create a new instance with auto-detected version from filename.
2019
- **Instance icon refresh:** `hyprism:instance:getIcon` returns a cache-busted file URL (`?v=<lastWriteTicks>`) so updated logos appear immediately after overwrite.
2120
- **Frontend icon loading rule:** instance list icon requests are executed sequentially (not in parallel) to avoid mixed responses on shared IPC reply channels.
2221
- **Launcher updater IPC:**
@@ -136,4 +135,4 @@ All services are registered as singletons in `Bootstrapper.cs` and injected via
136135
- **Mods storage policy:** profile switching does not redirect `UserData/Mods` to `Profiles/.../Mods`; mods remain instance-local.
137136
- **Profile folder format:** profile folders are stored under `Profiles/{profileId}` (GUID).
138137
- **Legacy migration:** launcher attempts to migrate legacy name-based profile folders in `Profiles/` to ID-based layout at startup (best-effort, non-destructive merge when both folders exist).
139-
- **Official profile auth routing:** switching to an official profile automatically sets auth domain to `sessions.hytale.com`.
138+
- **Official profile auth routing:** switching to an official profile automatically sets auth domain to `sessionserver.hytale.com`.

Docs/English/User/Configuration.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ Access settings through the **Settings** page (gear icon in sidebar).
7474
- If official download is unavailable, launcher automatically tests available mirrors and uses the best reachable one.
7575
- Mirror choice is not persisted as a user setting.
7676
- Mirrors are defined by JSON meta files in the `Mirrors/` folder (see [Custom Mirrors](#custom-mirrors) below).
77+
- If no download sources are available, the Dashboard will show a **No Download Sources** warning when you click **Download** or **Play**.
7778

7879
## Custom Mirrors
7980

Docs/Russian/User/Configuration.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ HyPrism хранит свою конфигурацию в файле `config.jso
7272
- Если official-загрузка недоступна, лаунчер автоматически тестирует доступные зеркала и выбирает лучшее.
7373
- Выбор зеркала не сохраняется как пользовательская настройка.
7474
- Зеркала определяются JSON мета-файлами в папке `Mirrors/` (см. [Пользовательские зеркала](#пользовательские-зеркала) ниже).
75+
- Если доступных источников нет, на Dashboard при нажатии **Download** или **Play** будет показано предупреждение **No Download Sources**.
7576

7677
## Пользовательские зеркала
7778

Frontend/src/App.tsx

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,21 @@ const App: React.FC = () => {
204204
const officialServerBlocked = isOfficialServerMode && !isOfficialProfile;
205205

206206
// Download sources state
207-
const [hasDownloadSources, setHasDownloadSources] = useState<boolean>(true);
207+
const [enabledMirrorCount, setEnabledMirrorCount] = useState<number>(0);
208+
const [hasOfficialAccount, setHasOfficialAccount] = useState<boolean>(false);
209+
const hasDownloadSources = enabledMirrorCount > 0 || (hasOfficialAccount && isOfficialProfile);
210+
211+
const refreshDownloadSources = useCallback(async () => {
212+
try {
213+
const sourcesResult = await ipc.settings.hasDownloadSources();
214+
setEnabledMirrorCount(typeof sourcesResult.enabledMirrorCount === 'number' ? sourcesResult.enabledMirrorCount : 0);
215+
setHasOfficialAccount(!!sourcesResult.hasOfficialAccount);
216+
} catch (e) {
217+
console.error('Failed to check download sources:', e);
218+
setEnabledMirrorCount(0);
219+
setHasOfficialAccount(false);
220+
}
221+
}, []);
208222

209223
// Background, news, and accent color settings
210224
// Initialize as null to prevent flash — don't render background until config is loaded
@@ -392,6 +406,8 @@ const App: React.FC = () => {
392406
setAvatarRefreshTrigger(prev => prev + 1);
393407
// Update official profile status
394408
await refreshOfficialStatus();
409+
// Refresh download source availability (mirrors / official)
410+
await refreshDownloadSources();
395411
};
396412

397413
// Refresh official server/profile status for play-button blocking
@@ -499,13 +515,7 @@ const App: React.FC = () => {
499515
}
500516

501517
// Load download sources status
502-
try {
503-
const sourcesResult = await ipc.settings.hasDownloadSources();
504-
setHasDownloadSources(sourcesResult.hasDownloadSources);
505-
} catch (e) {
506-
console.error('Failed to check download sources:', e);
507-
setHasDownloadSources(false);
508-
}
518+
await refreshDownloadSources();
509519
} catch (e) {
510520
console.error('Failed to load settings:', e);
511521
}
@@ -689,6 +699,12 @@ const App: React.FC = () => {
689699
};
690700
}, []);
691701

702+
// Re-check download sources when navigating back from Settings (e.g. mirrors added/removed)
703+
useEffect(() => {
704+
if (currentPage === 'settings') return;
705+
void refreshDownloadSources();
706+
}, [currentPage, refreshDownloadSources]);
707+
692708
const handlePlay = async () => {
693709
// Prevent launching if game is already running or download is in progress
694710
if (isGameRunning) {
@@ -1077,7 +1093,10 @@ const App: React.FC = () => {
10771093
rosettaWarning={rosettaWarning}
10781094
onBackgroundModeChange={(mode) => setBackgroundMode(mode)}
10791095
onInstanceDeleted={handleInstanceDeleted}
1080-
onAuthSettingsChange={refreshOfficialStatus}
1096+
onAuthSettingsChange={async () => {
1097+
await refreshOfficialStatus();
1098+
await refreshDownloadSources();
1099+
}}
10811100
onNavigateToMods={() => {
10821101
setCurrentPage('instances');
10831102
}}

Frontend/src/assets/locales/be-BY.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,11 +492,11 @@
492492
"authError": "Падчас уваходу адбылася памылка. Калі ласка, паспрабуйце яшчэ раз.",
493493
"noHytaleProfile": "Ваш уліковы запіс Hytale яшчэ не мае гульнявых профіляў. Гульнявы профіль будзе створаны пры першым доступе да гульні.",
494494
"nameTitle": "Выберыце мянушку",
495-
"nameDesc": "Выберыце імя для вашага афлайн-профілю (3-13 сімвалаў, англійскія літары, лічбы, - і _)",
495+
"nameDesc": "Выберыце імя для вашага афлайн-профілю (3-16 сімвалаў, англійскія літары, лічбы, - і _)",
496496
"namePlaceholder": "Увядзіце мянушку...",
497497
"characters": "сімвалаў",
498498
"nickRules": "Толькі A-Z, 0-9, - і _",
499-
"nickInvalid": "Мянушка павінна мець 3-13 сімвалаў: англійскія літары, лічбы, дэфіс або падкрэсленне.",
499+
"nickInvalid": "Мянушка павінна мець 3-16 сімвалаў: англійскія літары, лічбы, дэфіс або падкрэсленне.",
500500
"create": "Стварыць профіль",
501501
"createFailed": "Не ўдалося стварыць профіль. Калі ласка, паспрабуйце яшчэ раз.",
502502
"createError": "Падчас стварэння профілю адбылася памылка."

Frontend/src/assets/locales/de-DE.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,11 +492,11 @@
492492
"authError": "Bei der Anmeldung ist ein Fehler aufgetreten. Bitte versuche es erneut.",
493493
"noHytaleProfile": "Dein Hytale-Konto hat noch keine Spielprofile. Ein Spielprofil wird beim ersten Spielzugang erstellt.",
494494
"nameTitle": "Spitznamen wählen",
495-
"nameDesc": "Wähle einen Namen für dein Offline-Profil (3-13 Zeichen, englische Buchstaben, Ziffern, - und _)",
495+
"nameDesc": "Wähle einen Namen für dein Offline-Profil (3-16 Zeichen, englische Buchstaben, Ziffern, - und _)",
496496
"namePlaceholder": "Spitznamen eingeben...",
497497
"characters": "Zeichen",
498498
"nickRules": "Nur A-Z, 0-9, - und _",
499-
"nickInvalid": "Spitzname muss 3-13 Zeichen lang sein: englische Buchstaben, Ziffern, Bindestrich oder Unterstrich.",
499+
"nickInvalid": "Spitzname muss 3-16 Zeichen lang sein: englische Buchstaben, Ziffern, Bindestrich oder Unterstrich.",
500500
"create": "Profil erstellen",
501501
"createFailed": "Profil konnte nicht erstellt werden. Bitte versuche es erneut.",
502502
"createError": "Beim Erstellen des Profils ist ein Fehler aufgetreten."

Frontend/src/assets/locales/en-US.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,11 +511,11 @@
511511
"authError": "An error occurred during sign-in. Please try again.",
512512
"noHytaleProfile": "Your Hytale account has no game profiles yet. A game profile will be created when you first access the game.",
513513
"nameTitle": "Choose a Nickname",
514-
"nameDesc": "Pick a name for your offline profile (3-13 characters, English letters, digits, - and _)",
514+
"nameDesc": "Pick a name for your offline profile (3-16 characters, English letters, digits, - and _)",
515515
"namePlaceholder": "Enter nickname...",
516516
"characters": "characters",
517517
"nickRules": "A-Z, 0-9, - and _ only",
518-
"nickInvalid": "Nickname must be 3-13 characters: English letters, digits, dash or underscore.",
518+
"nickInvalid": "Nickname must be 3-16 characters: English letters, digits, dash or underscore.",
519519
"create": "Create Profile",
520520
"createFailed": "Failed to create profile. Please try again.",
521521
"createError": "An error occurred while creating the profile."

Frontend/src/assets/locales/es-ES.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,11 +492,11 @@
492492
"authError": "Ocurrió un error durante el inicio de sesión. Por favor, inténtalo de nuevo.",
493493
"noHytaleProfile": "Tu cuenta de Hytale aún no tiene perfiles de juego. Se creará un perfil de juego cuando accedas al juego por primera vez.",
494494
"nameTitle": "Elige un Apodo",
495-
"nameDesc": "Elige un nombre para tu perfil sin conexión (3-13 caracteres, letras inglesas, dígitos, - y _)",
495+
"nameDesc": "Elige un nombre para tu perfil sin conexión (3-16 caracteres, letras inglesas, dígitos, - y _)",
496496
"namePlaceholder": "Introduce apodo...",
497497
"characters": "caracteres",
498498
"nickRules": "Solo A-Z, 0-9, - y _",
499-
"nickInvalid": "El apodo debe tener 3-13 caracteres: letras inglesas, dígitos, guion o guion bajo.",
499+
"nickInvalid": "El apodo debe tener 3-16 caracteres: letras inglesas, dígitos, guion o guion bajo.",
500500
"create": "Crear Perfil",
501501
"createFailed": "Error al crear el perfil. Por favor, inténtalo de nuevo.",
502502
"createError": "Ocurrió un error al crear el perfil."

Frontend/src/assets/locales/fr-FR.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,11 +492,11 @@
492492
"authError": "Une erreur s'est produite lors de la connexion. Réessaie.",
493493
"noHytaleProfile": "Ton compte Hytale n'a pas encore de profils de jeu. Un profil de jeu sera créé lorsque tu accéderas au jeu pour la première fois.",
494494
"nameTitle": "Choisis un Pseudo",
495-
"nameDesc": "Choisis un nom pour ton profil hors ligne (3-13 caractères, lettres anglaises, chiffres, - et _)",
495+
"nameDesc": "Choisis un nom pour ton profil hors ligne (3-16 caractères, lettres anglaises, chiffres, - et _)",
496496
"namePlaceholder": "Entre un pseudo...",
497497
"characters": "caractères",
498498
"nickRules": "A-Z, 0-9, - et _ uniquement",
499-
"nickInvalid": "Le pseudo doit contenir 3-13 caractères : lettres anglaises, chiffres, tiret ou underscore.",
499+
"nickInvalid": "Le pseudo doit contenir 3-16 caractères : lettres anglaises, chiffres, tiret ou underscore.",
500500
"create": "Créer le Profil",
501501
"createFailed": "Échec de la création du profil. Réessaie.",
502502
"createError": "Une erreur s'est produite lors de la création du profil."

Frontend/src/assets/locales/it-IT.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,11 +493,11 @@
493493
"authError": "Si è verificato un errore durante l'accesso. Riprova.",
494494
"noHytaleProfile": "Il tuo account Hytale non ha ancora profili di gioco. Un profilo di gioco verrà creato al primo accesso al gioco.",
495495
"nameTitle": "Scegli un nickname",
496-
"nameDesc": "Scegli un nome per il tuo profilo offline (3-13 caratteri, lettere inglesi, numeri, - e _)",
496+
"nameDesc": "Scegli un nome per il tuo profilo offline (3-16 caratteri, lettere inglesi, numeri, - e _)",
497497
"namePlaceholder": "Inserisci il nickname...",
498498
"characters": "caratteri",
499499
"nickRules": "Solo A-Z, 0-9, - e _",
500-
"nickInvalid": "Il nickname deve essere di 3-13 caratteri: lettere inglesi, numeri, trattino o underscore.",
500+
"nickInvalid": "Il nickname deve essere di 3-16 caratteri: lettere inglesi, numeri, trattino o underscore.",
501501
"create": "Crea profilo",
502502
"createFailed": "Impossibile creare il profilo. Riprova.",
503503
"createError": "Si è verificato un errore durante la creazione del profilo."

0 commit comments

Comments
 (0)