file uploader

This commit is contained in:
2023-10-05 10:27:52 -06:00
parent 6e582e11dc
commit 5779cd9efc
17 changed files with 847 additions and 37 deletions

View File

@@ -1,7 +1,7 @@
import { Sockpuppet } from "puppet/client";
import { acceptEULA, checkEULA } from "../util/EULA.ts";
import { Loader } from "../types/mcgrizzconf.ts";
import { updateConfFile } from "../util/confFile.ts";
import { getConfFile, updateConfFile } from "../util/confFile.ts";
import { IS_BROWSER } from "$fresh/runtime.ts";
type MCServerEvent = 'message';
@@ -16,7 +16,7 @@ class ServerState {
private command!: Deno.Command;
private process!: Deno.ChildProcess;
private _eulaAccepted: boolean;
private _eulaAccepted = false;
private sockpuppet!: Sockpuppet;
private _channelId = "blanaba";
@@ -30,15 +30,29 @@ class ServerState {
private _serverType: Loader = 'unset';
public get serverType(): Loader {
return this.serverType;
return this._serverType;
}
public set serverType(loader: Loader) {
updateConfFile({loader});
this._serverType = loader;
}
private _serverVersion: string;
public get serverVersion(): string {
return this._serverVersion;
}
public set serverVersion(version: string) {
updateConfFile({version});
this._serverVersion = version;
}
constructor() {
this._eulaAccepted = checkEULA();
const conf = getConfFile();
this._serverType = conf.loader;
this._serverVersion = conf.version;
// if (this.serverType !== 'unset') this._eulaAccepted = checkEULA();
this.sockpuppet = new Sockpuppet(
"ws://sockpuppet.cyborggrizzly.com",
() => {