add xat and fix qemu process bug
This commit is contained in:
parent
16ddf23ff4
commit
126a6f6f56
3 changed files with 8 additions and 5 deletions
|
@ -14,7 +14,7 @@ import { WebSocket } from 'ws';
|
|||
import Queue from 'mnemonist/queue.js';
|
||||
|
||||
// for the maximum socket.io experience
|
||||
const kCanvasJpegQuality = 0.35;
|
||||
const kCanvasJpegQuality = 0.25;
|
||||
|
||||
class VMUser {
|
||||
public connection: WebSocket;
|
||||
|
@ -300,7 +300,7 @@ class VirtualMachine extends EventEmitter {
|
|||
let buffer = canvas.toBuffer('image/jpeg', { quality: kCanvasJpegQuality });
|
||||
|
||||
await self.BroadcastMessage((encoder: Shared.MessageEncoder) => {
|
||||
encoder.Init(buffer.length + 4);
|
||||
encoder.Init(buffer.length + 8);
|
||||
encoder.SetDisplayRectMessage(0, 0, buffer);
|
||||
return encoder.Finish();
|
||||
});
|
||||
|
@ -313,7 +313,7 @@ class VirtualMachine extends EventEmitter {
|
|||
let buffer = canvas.toBuffer('image/jpeg', { quality: kCanvasJpegQuality });
|
||||
|
||||
await this.BroadcastMessage((encoder: Shared.MessageEncoder) => {
|
||||
encoder.Init(buffer.length + 4);
|
||||
encoder.Init(buffer.length + 8);
|
||||
encoder.SetDisplayRectMessage(x, y, buffer);
|
||||
return encoder.Finish();
|
||||
});
|
||||
|
@ -334,7 +334,7 @@ class VirtualMachine extends EventEmitter {
|
|||
});
|
||||
|
||||
await user.SendMessage((encoder: Shared.MessageEncoder) => {
|
||||
encoder.Init(buffer.length + 4);
|
||||
encoder.Init(buffer.length + 8);
|
||||
encoder.SetDisplayRectMessage(0, 0, buffer);
|
||||
return encoder.Finish();
|
||||
});
|
||||
|
|
|
@ -89,7 +89,6 @@ export class QemuVM extends EventEmitter {
|
|||
await this.DisconnectQmp();
|
||||
this.DisconnectDisplay();
|
||||
await this.StopQemu();
|
||||
this.SetState(VMState.Stopped);
|
||||
}
|
||||
|
||||
async Reset() {
|
||||
|
@ -192,6 +191,8 @@ export class QemuVM extends EventEmitter {
|
|||
self.VMLog('QEMU exited with a non-zero exit code. This usually means an error in the command line. Stopping VM.');
|
||||
await self.Stop();
|
||||
}
|
||||
} else {
|
||||
this.SetState(VMState.Stopped);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -27,6 +27,8 @@
|
|||
To avoid misusage, we re-snapshot the computer every 15 minutes! <a href="TBD: Check cngit lol">[Source code]</a>
|
||||
</p>
|
||||
|
||||
<center><iframe src="https://xat.com/embed/chat.php#id=213019806&gn=computernewb" width="650" height="486" frameborder="0" scrolling="no"></iframe><br><small><a target="_BLANK" href="https://xat.com/web_gear/chat/embed.php?id=213019806&GroupName=computernewb">Get computernewb chat group</a> | <a target="_BLANK" href="https://xat.com/computernewb"> Go to computernewb website</a></small><br></center>
|
||||
|
||||
|
||||
<p style="margin-top: 30px; text-align: center; font-size: 11px; color: #666;"><small>Not</small> Powered by <a href="http://socket.io">Socket.IO (Don't use this!!)</a></p>
|
||||
|
||||
|
|
Loading…
Reference in a new issue