Fix for server exception, #3719

Ylian Saint-Hilaire committed Feb 28, 2022 at 09:37 UTC dc3974e2d9605ac7cc364498f82fb552e4f3c760
2 files changed +3 -1
apprelays.js
+1 -1
@@ -62,7 +62,7 @@ module.exports.CreateMstscRelay = function (parent, db, ws, req, args, domain) {
62 if (obj.wsClient != null) { inTraffc += obj.wsClient._socket.bytesRead; outTraffc += obj.wsClient._socket.bytesWritten; }
63 const sessionSeconds = Math.round((Date.now() - obj.startTime) / 1000);
64 const user = parent.users[obj.cookie.userid];
65 - const username = (user != null) ? user.name : null;e
65 + const username = (user != null) ? user.name : null;
66 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 };
67 parent.parent.DispatchEvent(['*', obj.nodeid, obj.cookie.userid, obj.meshid], obj, event);
68 delete obj.startTime;
public/scripts/agent-desktop-0.0.2.js
+2
@@ -259,6 +259,8 @@ var CreateAgentRemoteDesktop = function (canvasid, scrolldiv) {
259 case 15: // KVM_TOUCH
260 obj.TouchArray = {};
261 break;
262 + case 16: // MNG_KVM_KEYSTATE
263 + break;
264 case 17: // MNG_KVM_MESSAGE
265 var str = String.fromCharCode.apply(null, view.slice(4));
266 console.log('Got KVM Message: ' + str);