diff --git a/js/main-editor.js b/js/main-editor.js index 7ca3e79..f1f64f5 100644 --- a/js/main-editor.js +++ b/js/main-editor.js @@ -2631,7 +2631,7 @@ export class Editor extends PrimaryView { }, 60 * 1000); }); _make_button("Share", ev => { - let data = util.b64encode(c2g.synthesize_level(this.stored_level)); + let data = util.b64encode(fflate.zlibSync(new Uint8Array(c2g.synthesize_level(this.stored_level)))); let url = new URL(location); url.searchParams.delete('level'); url.searchParams.delete('setpath'); diff --git a/js/main.js b/js/main.js index dee3cb8..17f0c0f 100644 --- a/js/main.js +++ b/js/main.js @@ -3263,6 +3263,11 @@ async function main() { else if (b64level) { // TODO all the more important to show errors!! let buf = util.b64decode(b64level); + let u8array = new Uint8Array(buf); + if (u8array[0] === 0x78) { + // zlib compressed + buf = fflate.unzlibSync(u8array).buffer; + } await conductor.parse_and_load_game(buf, null, 'shared.c2m', null, "Shared level"); } }