Fix for server exception, #3719

This commit is contained in:
Ylian Saint-Hilaire 2022-02-28 09:37:25 -08:00
parent 794070838e
commit dc3974e2d9
2 changed files with 3 additions and 1 deletions

View File

@ -62,7 +62,7 @@ module.exports.CreateMstscRelay = function (parent, db, ws, req, args, domain) {
if (obj.wsClient != null) { inTraffc += obj.wsClient._socket.bytesRead; outTraffc += obj.wsClient._socket.bytesWritten; }
const sessionSeconds = Math.round((Date.now() - obj.startTime) / 1000);
const user = parent.users[obj.cookie.userid];
const username = (user != null) ? user.name : null;e
const username = (user != null) ? user.name : null;
const event = { etype: 'relay', action: 'relaylog', domain: domain.id, nodeid: obj.nodeid, userid: obj.cookie.userid, username: username, sessionid: obj.sessionid, msgid: 125, msgArgs: [sessionSeconds, obj.sessionid], msg: "Left Web-RDP session \"" + obj.sessionid + "\" after " + sessionSeconds + " second(s).", protocol: PROTOCOL_WEBRDP, bytesin: inTraffc, bytesout: outTraffc };
parent.parent.DispatchEvent(['*', obj.nodeid, obj.cookie.userid, obj.meshid], obj, event);
delete obj.startTime;

View File

@ -259,6 +259,8 @@ var CreateAgentRemoteDesktop = function (canvasid, scrolldiv) {
case 15: // KVM_TOUCH
obj.TouchArray = {};
break;
case 16: // MNG_KVM_KEYSTATE
break;
case 17: // MNG_KVM_MESSAGE
var str = String.fromCharCode.apply(null, view.slice(4));
console.log('Got KVM Message: ' + str);