mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-09 15:40:18 +00:00
WebRTC is now used by default and fully automatic.
This commit is contained in:
parent
c210b926bc
commit
143d4cb647
20 changed files with 61 additions and 40 deletions
|
@ -173,12 +173,18 @@ var CreateAgentRemoteDesktop = function (canvasid, scrolldiv) {
|
|||
}
|
||||
|
||||
obj.ProcessData = function (str) {
|
||||
var ptr = 0;
|
||||
while (ptr < str.length) { ptr += obj.ProcessDataEx(str.substring(ptr)); }
|
||||
}
|
||||
|
||||
obj.ProcessDataEx = function (str) {
|
||||
if (str.length < 4) return;
|
||||
var cmdmsg = null, X = 0, Y = 0, command = ReadShort(str, 0), cmdsize = ReadShort(str, 2);
|
||||
if ((cmdsize != str.length) && (obj.debugmode == 1)) { console.log(cmdsize, str.length, cmdsize == str.length); }
|
||||
if (command >= 18) { console.error("Invalid KVM command " + command + " of size " + cmdsize); console.log("Invalid KVM data", str.length, str, rstr2hex(str)); return; }
|
||||
if (cmdsize > str.length) { console.error("KVM invalid command size", cmdsize, str.length); return; }
|
||||
//meshOnDebug("KVM Command: " + command + " Len:" + cmdsize);
|
||||
if (obj.debugmode == 1) { console.log("KVM Command: " + command + " Len:" + cmdsize); }
|
||||
//if (obj.debugmode == 1) { console.log("KVM Command: " + command + " Len:" + cmdsize); }
|
||||
|
||||
if (command == 3 || command == 4 || command == 7) {
|
||||
cmdmsg = str.substring(4, cmdsize);
|
||||
|
@ -244,6 +250,7 @@ var CreateAgentRemoteDesktop = function (canvasid, scrolldiv) {
|
|||
if (obj.onMessage != null) obj.onMessage(str.substring(4, cmdsize), obj);
|
||||
break;
|
||||
}
|
||||
return cmdsize;
|
||||
}
|
||||
|
||||
// Keyboard and Mouse I/O.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue