ext use base64

This commit is contained in:
Olivier Gagnon 2021-12-22 19:54:59 -05:00
parent 795f8b4d2b
commit 88151efa61
4 changed files with 31 additions and 26 deletions

46
dist/vendor.bundle.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -21,6 +21,7 @@ import { SpecialServers } from "./Server/data/SpecialServers";
import { Server } from "./Server/Server"; import { Server } from "./Server/Server";
import { Router } from "./ui/GameRoot"; import { Router } from "./ui/GameRoot";
import { Page } from "./ui/Router"; import { Page } from "./ui/Router";
import { removeLeadingSlash } from "./Terminal/DirectoryHelpers";
interface Achievement { interface Achievement {
ID: string; ID: string;
@ -420,6 +421,10 @@ export function initElectron(): void {
function initWebserver(): void { function initWebserver(): void {
(document as any).saveFile = function (filename: string, code: string): string { (document as any).saveFile = function (filename: string, code: string): string {
filename = removeLeadingSlash(filename);
console.log(code);
code = Buffer.from(code, "base64").toString();
console.log(code);
const home = GetServer("home"); const home = GetServer("home");
if (home === null) return "'home' server not found."; if (home === null) return "'home' server not found.";
if (home === null) return "Server should not be null but it is."; if (home === null) return "Server should not be null but it is.";