make personal floppies writable, add success message to myfloppy

This commit is contained in:
Elijah R 2024-06-23 21:39:16 -04:00
parent 459a315143
commit 9c2e2e1f9a

View file

@ -194,9 +194,11 @@ class HelperBot extends CollabVMClient {
else this.QemuChangeDevice("vm.cd", source, opts);
}
QemuChangeFloppy(source: string) {
QemuChangeFloppy(source: string, readOnly: boolean = true) {
let opts = "raw";
if (readOnly) opts += " read-only";
if (this._hasFloppy)
this.QemuChangeDevice("vm.floppy", source, "raw read-only");
this.QemuChangeDevice("vm.floppy", source, opts);
}
OnChat(username: string, message: string) {
@ -538,7 +540,8 @@ class HelperBot extends CollabVMClient {
if (!fs.existsSync(flppath)) {
fs.writeFileSync(flppath, blankflp);
}
this.QemuChangeFloppy(flppath);
this.QemuChangeFloppy(flppath, false);
this.Chat("Tried to put media into specified device.");
break;
}
default: