mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-09 15:40:18 +00:00
Fixed usernames that include a dot (.)
This commit is contained in:
parent
5949c7456c
commit
81ccbae15c
16 changed files with 139 additions and 91 deletions
|
@ -272,6 +272,7 @@ var CreateAgentRemoteDesktop = function (canvasid, scrolldiv) {
|
|||
}
|
||||
|
||||
obj.SendKeyMsgKC = function (action, kc) {
|
||||
console.log('SendKeyMsgKC', action, kc);
|
||||
if (obj.State != 3) return;
|
||||
if (typeof action == 'object') { for (var i in action) { obj.SendKeyMsgKC(action[i][0], action[i][1]); } }
|
||||
else { obj.send(String.fromCharCode(0x00, obj.InputType.KEY, 0x00, 0x06, (action - 1), kc)); }
|
||||
|
|
|
@ -79,11 +79,7 @@ function hex2rstr(d) {
|
|||
function char2hex(i) { return (i + 0x100).toString(16).substr(-2).toUpperCase(); }
|
||||
|
||||
// Convert a raw string to a hex string
|
||||
function rstr2hex(input) {
|
||||
var r = '', i;
|
||||
for (i = 0; i < input.length; i++) { r += char2hex(input.charCodeAt(i)); }
|
||||
return r;
|
||||
}
|
||||
function rstr2hex(input) { var r = '', i; for (i = 0; i < input.length; i++) { r += char2hex(input.charCodeAt(i)); } return r; }
|
||||
|
||||
// UTF-8 encoding & decoding functions
|
||||
function encode_utf8(s) { return unescape(encodeURIComponent(s)); }
|
||||
|
|
|
@ -8,6 +8,7 @@ var MeshServerCreateControl = function (domain) {
|
|||
var obj = {};
|
||||
obj.State = 0;
|
||||
obj.connectstate = 0;
|
||||
obj.pingTimer = null;
|
||||
|
||||
obj.xxStateChange = function (newstate) {
|
||||
if (obj.State == newstate) return;
|
||||
|
@ -22,11 +23,14 @@ var MeshServerCreateControl = function (domain) {
|
|||
obj.socket.onmessage = obj.xxOnMessage;
|
||||
obj.socket.onclose = function () { obj.Stop(); }
|
||||
obj.xxStateChange(1);
|
||||
if (obj.pingTimer != null) { clearInterval(obj.pingTimer); }
|
||||
obj.pingTimer = setInterval(function () { obj.send({ action: 'ping' }); }, 29000); // Ping the server every 29 seconds, stops corporate proxies from disconnecting.
|
||||
}
|
||||
|
||||
obj.Stop = function () {
|
||||
obj.connectstate = 0;
|
||||
if (obj.socket) { obj.socket.close(); delete obj.socket; }
|
||||
if (obj.pingTimer != null) { clearInterval(obj.pingTimer); obj.pingTimer = null; }
|
||||
obj.xxStateChange(0);
|
||||
}
|
||||
|
||||
|
@ -34,6 +38,7 @@ var MeshServerCreateControl = function (domain) {
|
|||
// console.log('xxOnMessage', e.data);
|
||||
var message;
|
||||
try { message = JSON.parse(e.data); } catch (e) { return; }
|
||||
if (message.action == 'pong') { return; }
|
||||
if (obj.onMessage) obj.onMessage(obj, message);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue