diff --git a/game.v2025-07-31.bundle.js b/game.v2025-07-31.bundle.js index 720aea8..a997cd5 100644 --- a/game.v2025-07-31.bundle.js +++ b/game.v2025-07-31.bundle.js @@ -5539,7 +5539,8 @@ .querySelector("html") .addEventListener("navigationFinished", function (e) { ($("#settings-container select[multiple]").selectpicker(), - E.updateServiceWorkerStatus()); + E.updateServiceWorkerStatus(), + E.populateServerSaves()); }); const e = s.getInstance(), t = n.canCompress(); @@ -5624,7 +5625,7 @@ () => { E.exportSavegamePrivateBin(); }, - )}"> ${e.T("settings-share-save-button", "Export save without file")}\n
\n --\x3e\n \n
\n
Named Save
\n
\n \n
\n \n
\n
\n Save a complete export with a custom name.\n
\n \n `; + )}"> ${e.T("settings-share-save-button", "Export save without file")}\n
\n --\x3e\n \n
\n
Server Saves
\n
\n \n
\n \n
\n
\n Upload a complete export to the server under a custom name.\n
\n \n
\n \n
\n
\n Load a previously saved game from the server. This will overwrite your current progress.\n
\n \n `; } static mapManagementFormView() { const e = s.getInstance(); @@ -5889,6 +5890,36 @@ n.setSetting("completeExports", orig_complete); n.setSetting("compressExports", orig_compress); } + static async populateServerSaves() { + try { + const res = await fetch("https://pu-saves.burrson.de/saves"); + const saves = await res.json(); + const select = $("#server-saves-select"); + if (!select.length) return; + select.empty(); + if (saves.length === 0) { + select.append(''); + } else { + saves.forEach(name => select.append(``)); + } + } catch (e) { + $("#server-saves-select").empty().append(''); + } + } + static async importNamedSave() { + const save_name = $("#server-saves-select").val(); + if (!save_name) return; + try { + const res = await fetch(`https://pu-saves.burrson.de/saves/${encodeURIComponent(save_name)}`); + if (!res.ok) throw "Not found"; + const text = await res.text(); + if (n.hasScript(text)) throw "Script found!"; + const data = JSON.parse(n.decompressJsonFromString(text)); + E.importSaveGame(data); + } catch (e) { + n.showToast("Load failed", "Could not load the save from the server.", "danger"); + } + } static async importSaveGameClipboard() { const e = s.getInstance(), t = {