@aivin-labs/cli 1.0.46 → 1.0.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.mjs +16 -5
- package/bin/lib/auth.mjs +24 -10
- package/bin/lib/projectEnv.mjs +27 -0
- package/bin/lib/remote/client.mjs +86 -33
- package/bin/lib/remote/constants.mjs +5 -1
- package/bin/lib/remote/desktop/castAuth.mjs +53 -62
- package/bin/lib/remote/desktop/castConsent.mjs +59 -0
- package/bin/lib/remote/desktop/castInput.mjs +30 -9
- package/bin/lib/remote/desktop/desktopCast.mjs +3 -0
- package/bin/lib/remote/desktop/desktopCastSource.mjs +112 -20
- package/bin/lib/remote/desktop/desktopWebRtc.mjs +17 -1
- package/bin/lib/remote/desktop/traySource.mjs +73 -73
- package/bin/lib/remote/localPolicy.mjs +15 -2
- package/bin/lib/remote/mascot/bot.mjs +5 -1
- package/bin/lib/remote/mascot/hostSource.mjs +8 -1
- package/bin/lib/remote/mascot/index.mjs +55 -51
- package/bin/lib/remote/mascot/rigSource.mjs +28 -2
- package/bin/lib/remote/policyCommand.mjs +16 -3
- package/bin/lib/remote/sandbox.mjs +6 -4
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
export const CAST_INPUT_ACTIONS = Object.freeze([
|
|
8
8
|
'move', 'click', 'dblclick', 'rightclick', 'mousedown', 'mouseup', 'scroll', 'type', 'paste', 'clipboard', 'key', 'hotkey',
|
|
9
|
-
'paste_image'
|
|
9
|
+
'paste_image'
|
|
10
10
|
]);
|
|
11
11
|
|
|
12
12
|
export const CastInputRejection = Object.freeze({
|
|
@@ -67,12 +67,6 @@ export function sanitizeCastInput(raw, maxTypeChars = 2000) {
|
|
|
67
67
|
if (raw.click) cmd.click = true;
|
|
68
68
|
return cmd;
|
|
69
69
|
}
|
|
70
|
-
if (action === 'paste_file') {
|
|
71
|
-
if (typeof raw.path !== 'string' || !raw.path) return null;
|
|
72
|
-
cmd.path = raw.path;
|
|
73
|
-
if (raw.click) cmd.click = true;
|
|
74
|
-
return cmd;
|
|
75
|
-
}
|
|
76
70
|
if ((action === 'type' || action === 'paste' || action === 'clipboard') && !cmd.text) return null;
|
|
77
71
|
if (action === 'key' && !cmd.key) return null;
|
|
78
72
|
if (action === 'hotkey' && !cmd.keys) return null;
|
|
@@ -85,6 +79,7 @@ export function sanitizeCastInput(raw, maxTypeChars = 2000) {
|
|
|
85
79
|
*/
|
|
86
80
|
export function createCastInputGate({ isPaused = () => false, isAiBusy = () => false, maxPerSec = 120, now = Date.now, sleep } = {}) {
|
|
87
81
|
let lastHumanAt = null;
|
|
82
|
+
let takeover = null;
|
|
88
83
|
let accepted = 0;
|
|
89
84
|
let window = { start: 0, count: 0 };
|
|
90
85
|
/** Nút chuột người xem đang giữ trên máy: gói nhả của chúng luôn được qua cổng, không thì nút kẹt xuống tới hết phiên. */
|
|
@@ -112,11 +107,37 @@ export function createCastInputGate({ isPaused = () => false, isAiBusy = () => f
|
|
|
112
107
|
return { ok: true, cmd };
|
|
113
108
|
}
|
|
114
109
|
|
|
115
|
-
|
|
110
|
+
/** Người xem bấm "Bạn" lúc AI đang chạy: `{ idleMs, maxWaitMs }` = bắt đầu tạm cầm lái, `null` = trả lại AI. */
|
|
111
|
+
function setHumanTakeover(opts) {
|
|
112
|
+
takeover = opts?.idleMs > 0 ? { idleMs: opts.idleMs, maxWaitMs: opts.maxWaitMs > 0 ? opts.maxWaitMs : opts.idleMs, at: now() } : null;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/** Còn đang tạm cầm lái không — người ngừng thao tác đủ lâu thì quyền tự về AI. */
|
|
116
|
+
function humanTakeoverHeld() {
|
|
117
|
+
if (!takeover) return false;
|
|
118
|
+
if (now() - Math.max(takeover.at, lastHumanAt ?? 0) < takeover.idleMs) return true;
|
|
119
|
+
takeover = null;
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/** Bước GUI kế tiếp có thể phải chờ người tối đa bao lâu (0 = không ai đang cầm lái) — để xin BE lùi hạn của lời gọi. */
|
|
124
|
+
function takeoverWaitMs() { return humanTakeoverHeld() ? takeover.maxWaitMs : 0; }
|
|
125
|
+
|
|
126
|
+
/** `false` = AI chưa được bấm: bị huỷ khi đang chờ, hoặc người vẫn cầm lái tới hết `maxWaitMs` của lần tạm cầm lái. */
|
|
127
|
+
async function waitHumanIdle({ idleMs = 1500, maxWaitMs = 3000, signal } = {}) {
|
|
128
|
+
if (humanTakeoverHeld()) {
|
|
129
|
+
const takeoverDeadline = now() + takeover.maxWaitMs;
|
|
130
|
+
while (humanTakeoverHeld()) {
|
|
131
|
+
if (signal?.aborted || now() >= takeoverDeadline) return false;
|
|
132
|
+
await wait(250);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
if (signal?.aborted) return false;
|
|
116
136
|
const deadline = now() + maxWaitMs;
|
|
117
137
|
while (lastHumanAt !== null && now() - lastHumanAt < idleMs && now() < deadline) {
|
|
118
138
|
await wait(Math.min(250, Math.max(10, idleMs - (now() - lastHumanAt))));
|
|
119
139
|
}
|
|
140
|
+
return !signal?.aborted;
|
|
120
141
|
}
|
|
121
142
|
|
|
122
143
|
/** Số thao tác đã nhận từ lần gọi trước (nhật ký phiên trên máy) — đọc xong đặt lại 0. */
|
|
@@ -125,5 +146,5 @@ export function createCastInputGate({ isPaused = () => false, isAiBusy = () => f
|
|
|
125
146
|
/** Máy vừa nhả hết nút (`release_all`): AI sắp bấm hoặc người xem đã rời. Trả có đang giữ nút nào không để nơi gọi biết cần gửi lệnh nhả. */
|
|
126
147
|
function takeHeldInput() { const had = heldButtons.size > 0; heldButtons.clear(); return had; }
|
|
127
148
|
|
|
128
|
-
return { accept, waitHumanIdle, takeAcceptedCount, takeHeldInput, lastHumanInputAt: () => lastHumanAt };
|
|
149
|
+
return { accept, waitHumanIdle, setHumanTakeover, takeoverWaitMs, takeAcceptedCount, takeHeldInput, lastHumanInputAt: () => lastHumanAt };
|
|
129
150
|
}
|
|
@@ -189,6 +189,7 @@ export function createDesktopCastManager({ dir = CAST_DIR, spawnImpl = spawn } =
|
|
|
189
189
|
});
|
|
190
190
|
|
|
191
191
|
let rl = readline.createInterface({ input: child.stdout });
|
|
192
|
+
let packetSeq = 0;
|
|
192
193
|
|
|
193
194
|
rl.on('line', (line) => {
|
|
194
195
|
let msg;
|
|
@@ -203,6 +204,7 @@ export function createDesktopCastManager({ dir = CAST_DIR, spawnImpl = spawn } =
|
|
|
203
204
|
} else if (msg.t === 'frame') {
|
|
204
205
|
onFrame?.({
|
|
205
206
|
sessionId: session.sessionId,
|
|
207
|
+
seq: ++packetSeq,
|
|
206
208
|
image: msg.image,
|
|
207
209
|
width: msg.width,
|
|
208
210
|
height: msg.height,
|
|
@@ -219,6 +221,7 @@ export function createDesktopCastManager({ dir = CAST_DIR, spawnImpl = spawn } =
|
|
|
219
221
|
} else if (msg.t === 'meta') {
|
|
220
222
|
onMeta?.({
|
|
221
223
|
sessionId: session.sessionId,
|
|
224
|
+
seq: ++packetSeq,
|
|
222
225
|
width: msg.width,
|
|
223
226
|
height: msg.height,
|
|
224
227
|
screenWidth: msg.screenWidth,
|
|
@@ -23,6 +23,8 @@ using System.Drawing.Imaging;
|
|
|
23
23
|
using System.IO;
|
|
24
24
|
using System.IO.Pipes;
|
|
25
25
|
using System.Runtime.InteropServices;
|
|
26
|
+
using System.Security.AccessControl;
|
|
27
|
+
using System.Security.Principal;
|
|
26
28
|
using System.Text;
|
|
27
29
|
using System.Threading;
|
|
28
30
|
using System.Threading.Tasks;
|
|
@@ -37,6 +39,7 @@ namespace AivinDesktopCast {
|
|
|
37
39
|
[DllImport("user32.dll")] public static extern void mouse_event(uint dwFlags, int dx, int dy, int dwData, int dwExtraInfo);
|
|
38
40
|
[DllImport("user32.dll")] public static extern void keybd_event(byte bVk, ushort bScan, uint dwFlags, UIntPtr dwExtraInfo);
|
|
39
41
|
[DllImport("user32.dll")] public static extern short VkKeyScan(char ch);
|
|
42
|
+
[DllImport("user32.dll")] public static extern uint MapVirtualKey(uint code, uint mapType);
|
|
40
43
|
|
|
41
44
|
// Gõ chữ: keybd_event chỉ mang được 1 byte mã quét (BYTE bScan) → chữ ngoài Latin-1 (ư ơ đ ạ ế…) bị cắt thành ký tự rác.
|
|
42
45
|
// SendInput + KEYEVENTF_UNICODE mang đủ 16 bit mỗi đơn vị UTF-16.
|
|
@@ -125,6 +128,7 @@ namespace AivinDesktopCast {
|
|
|
125
128
|
public const uint MOUSEEVENTF_WHEEL = 0x0800;
|
|
126
129
|
public const uint MOUSEEVENTF_HWHEEL = 0x01000;
|
|
127
130
|
|
|
131
|
+
public const uint KEYEVENTF_EXTENDEDKEY = 0x0001;
|
|
128
132
|
public const uint KEYEVENTF_KEYUP = 0x0002;
|
|
129
133
|
public const uint KEYEVENTF_UNICODE = 0x0004;
|
|
130
134
|
}
|
|
@@ -164,11 +168,19 @@ namespace AivinDesktopCast {
|
|
|
164
168
|
static readonly byte[] videoHeader = new byte[12];
|
|
165
169
|
static byte[] audioPacket = new byte[12 + 1920];
|
|
166
170
|
|
|
171
|
+
/** Khung thô là toàn bộ màn hình: chỉ đúng tài khoản đang chạy mới mở được, không nhận kết nối qua mạng. */
|
|
172
|
+
static PipeSecurity OwnerOnly() {
|
|
173
|
+
var security = new PipeSecurity();
|
|
174
|
+
security.AddAccessRule(new PipeAccessRule(WindowsIdentity.GetCurrent().User, PipeAccessRights.FullControl, AccessControlType.Allow));
|
|
175
|
+
security.AddAccessRule(new PipeAccessRule(new SecurityIdentifier(WellKnownSidType.NetworkSid, null), PipeAccessRights.FullControl, AccessControlType.Deny));
|
|
176
|
+
return security;
|
|
177
|
+
}
|
|
178
|
+
|
|
167
179
|
public static void Start(string name) {
|
|
168
180
|
var t = new Thread(() => {
|
|
169
181
|
while (CastHost.Running) {
|
|
170
182
|
try {
|
|
171
|
-
var p = new NamedPipeServerStream(name, PipeDirection.Out, 1, PipeTransmissionMode.Byte, PipeOptions.None, 0, 8 * 1024 * 1024);
|
|
183
|
+
var p = new NamedPipeServerStream(name, PipeDirection.Out, 1, PipeTransmissionMode.Byte, PipeOptions.None, 0, 8 * 1024 * 1024, OwnerOnly());
|
|
172
184
|
p.WaitForConnection();
|
|
173
185
|
lock (gate) { pipe = p; Connected = true; }
|
|
174
186
|
while (CastHost.Running && p.IsConnected) Thread.Sleep(200);
|
|
@@ -233,6 +245,8 @@ namespace AivinDesktopCast {
|
|
|
233
245
|
|
|
234
246
|
public static class CastScreen {
|
|
235
247
|
static byte[] i420Raw;
|
|
248
|
+
static byte[] scaleRaw;
|
|
249
|
+
static byte[] scaleOut;
|
|
236
250
|
static byte[] i420Out;
|
|
237
251
|
static Bitmap cursorBuffer;
|
|
238
252
|
static Bitmap scaleBuffer;
|
|
@@ -377,6 +391,51 @@ namespace AivinDesktopCast {
|
|
|
377
391
|
return cursorBuffer;
|
|
378
392
|
}
|
|
379
393
|
|
|
394
|
+
/** Song tuyến tính chia theo hàng trên nhiều nhân: GDI+ DrawImage chỉ chạy một nhân, đo 14 ms mỗi khung từ 1080p xuống 1280, là khâu đắt nhất của bộ quay. */
|
|
395
|
+
static void ScaleBilinear(Bitmap src, Bitmap dst) {
|
|
396
|
+
int sw = src.Width, sh = src.Height, dw = dst.Width, dh = dst.Height;
|
|
397
|
+
var sd = src.LockBits(new Rectangle(0, 0, sw, sh), ImageLockMode.ReadOnly, PixelFormat.Format32bppRgb);
|
|
398
|
+
try {
|
|
399
|
+
var dd = dst.LockBits(new Rectangle(0, 0, dw, dh), ImageLockMode.WriteOnly, PixelFormat.Format32bppRgb);
|
|
400
|
+
try {
|
|
401
|
+
int sStride = Math.Abs(sd.Stride), dStride = Math.Abs(dd.Stride);
|
|
402
|
+
int sLen = sStride * sh, dLen = dStride * dh;
|
|
403
|
+
if (scaleRaw == null || scaleRaw.Length < sLen) scaleRaw = new byte[sLen];
|
|
404
|
+
if (scaleOut == null || scaleOut.Length < dLen) scaleOut = new byte[dLen];
|
|
405
|
+
byte[] raw = scaleRaw, output = scaleOut;
|
|
406
|
+
Marshal.Copy(sd.Scan0, raw, 0, sLen);
|
|
407
|
+
long xStep = ((long)(sw - 1) << 16) / Math.Max(1, dw - 1);
|
|
408
|
+
long yStep = ((long)(sh - 1) << 16) / Math.Max(1, dh - 1);
|
|
409
|
+
Parallel.For(0, dh, y => {
|
|
410
|
+
long fy = y * yStep;
|
|
411
|
+
int sy = (int)(fy >> 16);
|
|
412
|
+
int wy = (int)((fy >> 8) & 0xFF);
|
|
413
|
+
int row0 = sy * sStride;
|
|
414
|
+
int row1 = (sy + 1 < sh ? sy + 1 : sy) * sStride;
|
|
415
|
+
int o = y * dStride;
|
|
416
|
+
for (int x = 0; x < dw; x++, o += 4) {
|
|
417
|
+
long fx = x * xStep;
|
|
418
|
+
int sx = (int)(fx >> 16);
|
|
419
|
+
int wx = (int)((fx >> 8) & 0xFF);
|
|
420
|
+
int a = sx * 4;
|
|
421
|
+
int b = (sx + 1 < sw ? sx + 1 : sx) * 4;
|
|
422
|
+
for (int c = 0; c < 3; c++) {
|
|
423
|
+
int top = raw[row0 + a + c] * (256 - wx) + raw[row0 + b + c] * wx;
|
|
424
|
+
int bottom = raw[row1 + a + c] * (256 - wx) + raw[row1 + b + c] * wx;
|
|
425
|
+
output[o + c] = (byte)((top * (256 - wy) + bottom * wy) >> 16);
|
|
426
|
+
}
|
|
427
|
+
output[o + 3] = 255;
|
|
428
|
+
}
|
|
429
|
+
});
|
|
430
|
+
Marshal.Copy(output, 0, dd.Scan0, dLen);
|
|
431
|
+
} finally {
|
|
432
|
+
dst.UnlockBits(dd);
|
|
433
|
+
}
|
|
434
|
+
} finally {
|
|
435
|
+
src.UnlockBits(sd);
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
|
|
380
439
|
public static Bitmap Scale(Bitmap src, int maxWidth) {
|
|
381
440
|
if (src.Width <= maxWidth) return src;
|
|
382
441
|
int h = (int)Math.Round(src.Height * (double)maxWidth / src.Width);
|
|
@@ -384,11 +443,7 @@ namespace AivinDesktopCast {
|
|
|
384
443
|
if (scaleBuffer != null) scaleBuffer.Dispose();
|
|
385
444
|
scaleBuffer = new Bitmap(maxWidth, h, PixelFormat.Format32bppRgb);
|
|
386
445
|
}
|
|
387
|
-
|
|
388
|
-
g.CompositingMode = System.Drawing.Drawing2D.CompositingMode.SourceCopy;
|
|
389
|
-
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.Bilinear;
|
|
390
|
-
g.DrawImage(src, 0, 0, maxWidth, h);
|
|
391
|
-
}
|
|
446
|
+
ScaleBilinear(src, scaleBuffer);
|
|
392
447
|
return scaleBuffer;
|
|
393
448
|
}
|
|
394
449
|
|
|
@@ -464,8 +519,10 @@ namespace AivinDesktopCast {
|
|
|
464
519
|
}
|
|
465
520
|
|
|
466
521
|
public static class CastHost {
|
|
467
|
-
const long JPEG_SMALL_CHANGE_INTERVAL_MS =
|
|
522
|
+
const long JPEG_SMALL_CHANGE_INTERVAL_MS = 200;
|
|
468
523
|
const double JPEG_BIG_CHANGE_DIFF = 4.5;
|
|
524
|
+
const long JPEG_IDLE_REFRESH_MS = 8000;
|
|
525
|
+
const long SCREENS_REFRESH_MS = 2000;
|
|
469
526
|
const int RATIO_SCALE = 65535;
|
|
470
527
|
static volatile bool running = true;
|
|
471
528
|
public static bool Running { get { return running; } }
|
|
@@ -481,6 +538,7 @@ namespace AivinDesktopCast {
|
|
|
481
538
|
static volatile int targetMaxWidth = 1366;
|
|
482
539
|
static volatile int targetQuality = 65;
|
|
483
540
|
static bool lastSecureDesktop = false;
|
|
541
|
+
static long lastScreensMs = -SCREENS_REFRESH_MS;
|
|
484
542
|
|
|
485
543
|
public static void Run(string argsJson) {
|
|
486
544
|
Native.SetProcessDPIAware();
|
|
@@ -522,6 +580,8 @@ namespace AivinDesktopCast {
|
|
|
522
580
|
bool changePending = false;
|
|
523
581
|
int lastCursorSeq = -1;
|
|
524
582
|
long lastSendMs = 0;
|
|
583
|
+
long lastJpegMs = 0;
|
|
584
|
+
bool jpegSettled = false;
|
|
525
585
|
long lastAuxCheckMs = 0;
|
|
526
586
|
|
|
527
587
|
while (running) {
|
|
@@ -550,7 +610,10 @@ namespace AivinDesktopCast {
|
|
|
550
610
|
long nowMs = clock.ElapsedMilliseconds;
|
|
551
611
|
bool forceKeepAlive = (nowMs - lastSendMs) >= 1000;
|
|
552
612
|
bool refresh = refreshRequested;
|
|
553
|
-
if (refresh)
|
|
613
|
+
if (refresh) {
|
|
614
|
+
refreshRequested = false;
|
|
615
|
+
lastScreensMs = -SCREENS_REFRESH_MS;
|
|
616
|
+
}
|
|
554
617
|
|
|
555
618
|
bool jpegMode = jpegEnabled || !rawEnabled;
|
|
556
619
|
bool sendChange = changePending;
|
|
@@ -562,9 +625,16 @@ namespace AivinDesktopCast {
|
|
|
562
625
|
changePending = false;
|
|
563
626
|
lastSendMs = nowMs;
|
|
564
627
|
lastCursorSeq = cursorSeq;
|
|
565
|
-
|
|
628
|
+
// Mỗi ảnh JPEG là nguyên màn hình đi qua máy chủ. Màn hình đứng yên chỉ gửi gói giữ nhịp không ảnh; sau lần đổi cuối gửi lại một ảnh phòng ảnh trước bị rơi (đường này không gửi lại), rồi thưa hẳn.
|
|
629
|
+
bool changed = sendChange || refresh;
|
|
630
|
+
bool withJpeg = jpegMode && (changed || !jpegSettled || nowMs - lastJpegMs >= JPEG_IDLE_REFRESH_MS);
|
|
631
|
+
jpegSettled = !changed;
|
|
632
|
+
if (withJpeg) {
|
|
633
|
+
lastJpegMs = nowMs;
|
|
634
|
+
lastJpegThumb = CastScreen.Thumb(source.Frame);
|
|
635
|
+
}
|
|
566
636
|
long sendStartMs = clock.ElapsedMilliseconds;
|
|
567
|
-
SendFrame(source.Frame, cursorInFrame,
|
|
637
|
+
SendFrame(source.Frame, cursorInFrame, withJpeg, nowMs, hostStats);
|
|
568
638
|
hostStats.AddLoad(clock.ElapsedMilliseconds - sendStartMs);
|
|
569
639
|
}
|
|
570
640
|
} catch (Exception ex) {
|
|
@@ -607,7 +677,11 @@ namespace AivinDesktopCast {
|
|
|
607
677
|
frameMsg["screenX"] = currentBounds.X;
|
|
608
678
|
frameMsg["screenY"] = currentBounds.Y;
|
|
609
679
|
frameMsg["monitor"] = currentMonitor;
|
|
610
|
-
|
|
680
|
+
// Danh sách màn hình ít khi đổi: không gửi và không tra lại ở mọi khung.
|
|
681
|
+
if (nowMs - lastScreensMs >= SCREENS_REFRESH_MS) {
|
|
682
|
+
lastScreensMs = nowMs;
|
|
683
|
+
frameMsg["screens"] = CastScreen.GetScreens();
|
|
684
|
+
}
|
|
611
685
|
frameMsg["ts"] = nowMs;
|
|
612
686
|
frameMsg["stats"] = hostStats.Snapshot(nowMs);
|
|
613
687
|
if (lastSecureDesktop) frameMsg["secureDesktop"] = true;
|
|
@@ -745,6 +819,20 @@ namespace AivinDesktopCast {
|
|
|
745
819
|
}
|
|
746
820
|
}
|
|
747
821
|
|
|
822
|
+
/**
|
|
823
|
+
* Phím thuộc cụm mở rộng phải gắn cờ extended. Thiếu cờ, Windows hiểu mũi tên / Home / End... là phím số bên phải:
|
|
824
|
+
* NumLock đang bật thì Shift bị huỷ để phím đó vẫn là di chuyển, nên Shift + mũi tên chỉ di chuyển, không bôi đen.
|
|
825
|
+
*/
|
|
826
|
+
static bool IsExtendedKey(byte vk) {
|
|
827
|
+
return (vk >= 0x21 && vk <= 0x28) || vk == 0x2C || vk == 0x2D || vk == 0x2E
|
|
828
|
+
|| vk == 0x5B || vk == 0x5C || vk == 0x5D || vk == 0x90 || vk == 0xA3 || vk == 0xA5;
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
static void SendKey(byte vk, bool up) {
|
|
832
|
+
uint flags = (IsExtendedKey(vk) ? Native.KEYEVENTF_EXTENDEDKEY : 0) | (up ? Native.KEYEVENTF_KEYUP : 0);
|
|
833
|
+
Native.keybd_event(vk, (byte)Native.MapVirtualKey(vk, 0), flags, UIntPtr.Zero);
|
|
834
|
+
}
|
|
835
|
+
|
|
748
836
|
static List<byte> ExtractModifiers(Dictionary<string, object> cmd) {
|
|
749
837
|
var list = new List<byte>();
|
|
750
838
|
if (!cmd.ContainsKey("modifiers") || cmd["modifiers"] == null) return list;
|
|
@@ -760,14 +848,14 @@ namespace AivinDesktopCast {
|
|
|
760
848
|
|
|
761
849
|
static void PressModifiers(List<byte> mods) {
|
|
762
850
|
for (int i = 0; i < mods.Count; i++) {
|
|
763
|
-
|
|
851
|
+
SendKey(mods[i], false);
|
|
764
852
|
}
|
|
765
853
|
if (mods.Count > 0) Thread.Sleep(8);
|
|
766
854
|
}
|
|
767
855
|
|
|
768
856
|
static void ReleaseModifiers(List<byte> mods) {
|
|
769
857
|
for (int i = mods.Count - 1; i >= 0; i--) {
|
|
770
|
-
|
|
858
|
+
SendKey(mods[i], true);
|
|
771
859
|
}
|
|
772
860
|
}
|
|
773
861
|
|
|
@@ -1066,14 +1154,18 @@ namespace AivinDesktopCast {
|
|
|
1066
1154
|
byte vk = KeyNameToVk(Convert.ToString(keys[i]));
|
|
1067
1155
|
if (vk != 0) vks.Add(vk);
|
|
1068
1156
|
}
|
|
1157
|
+
// Giữ tổ hợp thì trình duyệt lặp ~30 lần/giây: chậm hơn nhịp đó là lệnh dồn lại, nhả tay rồi vùng chọn vẫn chạy tiếp. Tổ hợp có Win giữ nhịp chậm vì shell xử lý chậm.
|
|
1158
|
+
bool withWin = vks.Contains(0x5B) || vks.Contains(0x5C);
|
|
1159
|
+
int stepMs = withWin ? 10 : 2;
|
|
1160
|
+
int holdMs = withWin ? 40 : 12;
|
|
1069
1161
|
for (int i = 0; i < vks.Count; i++) {
|
|
1070
|
-
|
|
1071
|
-
Thread.Sleep(
|
|
1162
|
+
SendKey(vks[i], false);
|
|
1163
|
+
Thread.Sleep(stepMs);
|
|
1072
1164
|
}
|
|
1073
|
-
Thread.Sleep(
|
|
1165
|
+
Thread.Sleep(holdMs);
|
|
1074
1166
|
for (int i = vks.Count - 1; i >= 0; i--) {
|
|
1075
|
-
|
|
1076
|
-
Thread.Sleep(
|
|
1167
|
+
SendKey(vks[i], true);
|
|
1168
|
+
Thread.Sleep(stepMs);
|
|
1077
1169
|
}
|
|
1078
1170
|
}
|
|
1079
1171
|
}
|
|
@@ -1157,9 +1249,9 @@ namespace AivinDesktopCast {
|
|
|
1157
1249
|
static void HandleSpecialKey(string key) {
|
|
1158
1250
|
byte vk = KeyNameToVk(key);
|
|
1159
1251
|
if (vk != 0) {
|
|
1160
|
-
|
|
1252
|
+
SendKey(vk, false);
|
|
1161
1253
|
Thread.Sleep(15);
|
|
1162
|
-
|
|
1254
|
+
SendKey(vk, true);
|
|
1163
1255
|
}
|
|
1164
1256
|
}
|
|
1165
1257
|
}
|
|
@@ -12,6 +12,9 @@ const MAX_INPUT_MESSAGE_BYTES = 25 * 1024 * 1024;
|
|
|
12
12
|
/** Kênh tệp người xem kéo thả / dán vào màn hình (castFileDrop.mjs): tin cậy + đúng thứ tự, tách khỏi kênh thao tác để tệp lớn không làm trễ chuột. */
|
|
13
13
|
export const FILE_CHANNEL = 'aivin-desktop-files';
|
|
14
14
|
const MAX_FILE_CHUNK_BYTES = 256 * 1024;
|
|
15
|
+
/** Kênh riêng cho vị trí chuột: không gửi lại, không giữ thứ tự — mất một gói thì gói sau đè lên, không bắt các thao tác sau xếp hàng chờ như kênh tin cậy. */
|
|
16
|
+
export const POINTER_CHANNEL = 'aivin-desktop-pointer';
|
|
17
|
+
const MAX_POINTER_MESSAGE_BYTES = 512;
|
|
15
18
|
|
|
16
19
|
const MAX_CURSOR_SHAPES = 64;
|
|
17
20
|
/** Thử nối lại khi peer hỏng hẳn (`failed`): dựng peer mới, cùng người xem; hết lượt thì ở lại JPEG. Peer nối được thì đặt lại. */
|
|
@@ -107,6 +110,7 @@ export function createDesktopWebRtc({ emitSignal = () => {}, emitStatus = () =>
|
|
|
107
110
|
const channel = pc.createDataChannel('aivin-desktop-frames', { ordered: false, maxRetransmits: 0 });
|
|
108
111
|
const inputChannel = pc.createDataChannel(INPUT_CHANNEL, { ordered: true });
|
|
109
112
|
const fileChannel = pc.createDataChannel(FILE_CHANNEL, { ordered: true });
|
|
113
|
+
const pointerChannel = pc.createDataChannel(POINTER_CHANNEL, { ordered: false, maxRetransmits: 0 });
|
|
110
114
|
const VideoSource = wrtc?.nonstandard?.RTCVideoSource || wrtc?.default?.nonstandard?.RTCVideoSource;
|
|
111
115
|
const AudioSource = wrtc?.nonstandard?.RTCAudioSource || wrtc?.default?.nonstandard?.RTCAudioSource;
|
|
112
116
|
const MediaStream = wrtc?.MediaStream || wrtc?.default?.MediaStream;
|
|
@@ -118,7 +122,7 @@ export function createDesktopWebRtc({ emitSignal = () => {}, emitStatus = () =>
|
|
|
118
122
|
if (track) stream ? pc.addTrack(track, stream) : pc.addTrack(track);
|
|
119
123
|
if (audioTrack) stream ? pc.addTrack(audioTrack, stream) : pc.addTrack(audioTrack);
|
|
120
124
|
const peer = {
|
|
121
|
-
pc, channel, inputChannel, fileChannel,
|
|
125
|
+
pc, channel, inputChannel, fileChannel, pointerChannel, pointerSeq: 0,
|
|
122
126
|
track, video: !!track,
|
|
123
127
|
audioTrack, audio: !!audioTrack, audioEnabled: audio !== false,
|
|
124
128
|
sessionId, viewerId, iceServers, videoBitrate, attempt, retryTimer: null, open: false, dropped: 0,
|
|
@@ -162,6 +166,17 @@ export function createDesktopWebRtc({ emitSignal = () => {}, emitStatus = () =>
|
|
|
162
166
|
// Mã phiên lấy từ peer (đã gắn lúc BE mời), không tin mã trong gói.
|
|
163
167
|
onInput({ ...msg, session_id: peer.sessionId }, viewerId);
|
|
164
168
|
};
|
|
169
|
+
pointerChannel.onmessage = ({ data }) => {
|
|
170
|
+
const text = typeof data === 'string' ? data : Buffer.from(data).toString('utf8');
|
|
171
|
+
if (text.length > MAX_POINTER_MESSAGE_BYTES) return;
|
|
172
|
+
let msg;
|
|
173
|
+
try { msg = JSON.parse(text); } catch { return; }
|
|
174
|
+
// Chỉ nhận di chuột: nhấn, nhả, phím phải đi kênh tin cậy. Gói đến muộn hơn gói mới nhất thì bỏ.
|
|
175
|
+
if (msg?.action !== 'move' || !(msg.n > peer.pointerSeq)) return;
|
|
176
|
+
peer.pointerSeq = msg.n;
|
|
177
|
+
const { n: _n, ...cmd } = msg;
|
|
178
|
+
onInput({ ...cmd, session_id: peer.sessionId }, viewerId);
|
|
179
|
+
};
|
|
165
180
|
peers.set(viewerId, peer);
|
|
166
181
|
channel.binaryType = 'arraybuffer';
|
|
167
182
|
const markConnected = () => {
|
|
@@ -352,6 +367,7 @@ export function createDesktopWebRtc({ emitSignal = () => {}, emitStatus = () =>
|
|
|
352
367
|
try { peer.channel.close(); } catch { /* already closed */ }
|
|
353
368
|
try { peer.inputChannel?.close(); } catch { /* already closed */ }
|
|
354
369
|
try { peer.fileChannel?.close(); } catch { /* already closed */ }
|
|
370
|
+
try { peer.pointerChannel?.close(); } catch { /* already closed */ }
|
|
355
371
|
try { peer.track?.stop(); } catch { /* already stopped */ }
|
|
356
372
|
try { peer.audioTrack?.stop(); } catch { /* already stopped */ }
|
|
357
373
|
try { peer.pc.close(); } catch { /* already closed */ }
|
|
@@ -240,8 +240,8 @@ namespace AivinDesktop {
|
|
|
240
240
|
}
|
|
241
241
|
}
|
|
242
242
|
|
|
243
|
-
protected override void OnRenderItemCheck(ToolStripItemImageRenderEventArgs e) { }
|
|
244
|
-
|
|
243
|
+
protected override void OnRenderItemCheck(ToolStripItemImageRenderEventArgs e) { }
|
|
244
|
+
|
|
245
245
|
protected override void OnRenderMenuItemBackground(ToolStripItemRenderEventArgs e) {
|
|
246
246
|
if (e.Item.Selected && e.Item.Enabled) {
|
|
247
247
|
int width = Math.Min(e.Item.Width, e.ToolStrip.ClientSize.Width - e.Item.Bounds.Left);
|
|
@@ -353,8 +353,8 @@ namespace AivinDesktop {
|
|
|
353
353
|
static readonly string CfgFile = Path.Combine(Program.Home, "desktop", "launch.cfg");
|
|
354
354
|
static readonly string LogoFile = Path.Combine(Program.Home, "desktop", "logo.png");
|
|
355
355
|
static readonly string StateFile = Path.Combine(Program.Home, "desktop", "tray-state.txt");
|
|
356
|
-
static readonly string LogFile = Path.Combine(Program.Home, "remote-service.log");
|
|
357
|
-
static readonly string CastSessionFile = Path.Combine(Program.Home, "desktop-cast-session.json");
|
|
356
|
+
static readonly string LogFile = Path.Combine(Program.Home, "remote-service.log");
|
|
357
|
+
static readonly string CastSessionFile = Path.Combine(Program.Home, "desktop-cast-session.json");
|
|
358
358
|
static readonly string CastActionFile = Path.Combine(Program.Home, "desktop-cast-action.json");
|
|
359
359
|
static readonly object logLock = new object();
|
|
360
360
|
|
|
@@ -378,7 +378,7 @@ namespace AivinDesktop {
|
|
|
378
378
|
NotifyIcon tray;
|
|
379
379
|
Icon colorIcon, greyIcon, shownIcon;
|
|
380
380
|
ToolStripMenuItem status, updateItem, open, connectCodeItem, quickChat, quickVoice, pause, startup, mascot, terminal, quit, serverMenu, serverCloud, serverVn, serverLocal;
|
|
381
|
-
ToolStripSeparator quickSeparator, stopCastSeparator;
|
|
381
|
+
ToolStripSeparator quickSeparator, stopCastSeparator;
|
|
382
382
|
ToolStripMenuItem stopCastItem;
|
|
383
383
|
System.Windows.Forms.Timer timer;
|
|
384
384
|
Control invoker;
|
|
@@ -429,11 +429,11 @@ namespace AivinDesktop {
|
|
|
429
429
|
serverCloud = Item(cfg.T("serverCloud"), delegate { ChangeServer("https://api.aivin.cloud"); });
|
|
430
430
|
serverVn = Item(cfg.T("serverVn"), delegate { ChangeServer("https://api.aivin.vn"); });
|
|
431
431
|
serverLocal = Item(cfg.T("serverLocal"), delegate { ChangeServer("http://localhost:3001"); });
|
|
432
|
-
serverMenu.DropDownItems.AddRange(new ToolStripItem[] { serverCloud, serverVn, serverLocal });
|
|
433
|
-
ToolStripDropDownMenu serverDrop = serverMenu.DropDown as ToolStripDropDownMenu; if (serverDrop != null) { serverDrop.ShowImageMargin = false; }
|
|
434
|
-
if (serverDrop != null) { serverDrop.ShowCheckMargin = false; }
|
|
435
|
-
serverMenu.DropDown.BackColor = Color.White;
|
|
436
|
-
serverMenu.DropDown.Font = new Font("Segoe UI", 9.5f, FontStyle.Regular);
|
|
432
|
+
serverMenu.DropDownItems.AddRange(new ToolStripItem[] { serverCloud, serverVn, serverLocal });
|
|
433
|
+
ToolStripDropDownMenu serverDrop = serverMenu.DropDown as ToolStripDropDownMenu; if (serverDrop != null) { serverDrop.ShowImageMargin = false; }
|
|
434
|
+
if (serverDrop != null) { serverDrop.ShowCheckMargin = false; }
|
|
435
|
+
serverMenu.DropDown.BackColor = Color.White;
|
|
436
|
+
serverMenu.DropDown.Font = new Font("Segoe UI", 9.5f, FontStyle.Regular);
|
|
437
437
|
serverMenu.DropDown.Padding = new Padding(2, 6, 2, 6);
|
|
438
438
|
startup = Item(cfg.T("startup"), delegate { SetStartup(!StartupEnabled()); Refresh(); });
|
|
439
439
|
updateItem = Item("", delegate { CheckOrApplyUpdate(); });
|
|
@@ -443,11 +443,11 @@ namespace AivinDesktop {
|
|
|
443
443
|
status.Padding = new Padding(16, 4, 24, 4);
|
|
444
444
|
status.Font = new Font("Segoe UI", 8.5f, FontStyle.Regular);
|
|
445
445
|
|
|
446
|
-
quit = Item(cfg.T("quit"), delegate { Quit(); });
|
|
447
|
-
stopCastItem = Item("", delegate { DisconnectAndBlockCast(); });
|
|
448
|
-
stopCastItem.ForeColor = Color.FromArgb(210, 45, 45);
|
|
449
|
-
stopCastItem.Visible = false;
|
|
450
|
-
stopCastSeparator = new ToolStripSeparator();
|
|
446
|
+
quit = Item(cfg.T("quit"), delegate { Quit(); });
|
|
447
|
+
stopCastItem = Item("", delegate { DisconnectAndBlockCast(); });
|
|
448
|
+
stopCastItem.ForeColor = Color.FromArgb(210, 45, 45);
|
|
449
|
+
stopCastItem.Visible = false;
|
|
450
|
+
stopCastSeparator = new ToolStripSeparator();
|
|
451
451
|
stopCastSeparator.Visible = false;
|
|
452
452
|
|
|
453
453
|
menu.Items.AddRange(new ToolStripItem[] {
|
|
@@ -463,8 +463,8 @@ namespace AivinDesktop {
|
|
|
463
463
|
new ToolStripSeparator(),
|
|
464
464
|
startup,
|
|
465
465
|
updateItem,
|
|
466
|
-
status,
|
|
467
|
-
stopCastSeparator,
|
|
466
|
+
status,
|
|
467
|
+
stopCastSeparator,
|
|
468
468
|
stopCastItem,
|
|
469
469
|
new ToolStripSeparator(),
|
|
470
470
|
quit
|
|
@@ -767,11 +767,11 @@ namespace AivinDesktop {
|
|
|
767
767
|
}
|
|
768
768
|
string selectedServer = CurrentServerUrl();
|
|
769
769
|
serverMenu.Text = cfg.T("server") + ": " + ServerName(selectedServer);
|
|
770
|
-
bool isCloud = selectedServer == "https://api.aivin.cloud";
|
|
771
|
-
bool isVn = selectedServer == "https://api.aivin.vn";
|
|
772
|
-
bool isLocal = selectedServer == "http://localhost:3001";
|
|
773
|
-
serverCloud.Text = (isCloud ? "✓ " : " ") + cfg.T("serverCloud");
|
|
774
|
-
serverVn.Text = (isVn ? "✓ " : " ") + cfg.T("serverVn");
|
|
770
|
+
bool isCloud = selectedServer == "https://api.aivin.cloud";
|
|
771
|
+
bool isVn = selectedServer == "https://api.aivin.vn";
|
|
772
|
+
bool isLocal = selectedServer == "http://localhost:3001";
|
|
773
|
+
serverCloud.Text = (isCloud ? "✓ " : " ") + cfg.T("serverCloud");
|
|
774
|
+
serverVn.Text = (isVn ? "✓ " : " ") + cfg.T("serverVn");
|
|
775
775
|
serverLocal.Text = (isLocal ? "✓ " : " ") + cfg.T("serverLocal");
|
|
776
776
|
open.Text = cfg.T(paired ? "open" : "connect");
|
|
777
777
|
connectCodeItem.Visible = !paired;
|
|
@@ -789,57 +789,57 @@ namespace AivinDesktop {
|
|
|
789
789
|
quickChat.ShortcutKeyDisplayString = HotkeyLabel(hotkeys, "chat");
|
|
790
790
|
quickVoice.ShortcutKeyDisplayString = HotkeyLabel(hotkeys, "voice");
|
|
791
791
|
// WinForms không tính đủ chỗ cho cột phím tắt khi menu tự vẽ chữ: tự giữ bề rộng tối thiểu để phím không bị cắt / đè lên tên mục.
|
|
792
|
-
quickChat.Owner.MinimumSize = new Size(Math.Max(ShortcutRowWidth(quickChat), ShortcutRowWidth(quickVoice)), 0);
|
|
793
|
-
|
|
794
|
-
// Kiểm tra có thiết bị đang cast màn hình không
|
|
795
|
-
string castDevice = null;
|
|
796
|
-
try {
|
|
797
|
-
if (File.Exists(CastSessionFile)) {
|
|
798
|
-
string castTxt = File.ReadAllText(CastSessionFile);
|
|
799
|
-
if (Regex.IsMatch(castTxt, "\"active\"\\s*:\\s*true")) {
|
|
800
|
-
Match mDev = Regex.Match(castTxt, "\"viewer_device\"\\s*:\\s*\"([^\"]+)\"");
|
|
801
|
-
if (mDev.Success && !string.IsNullOrEmpty(mDev.Groups[1].Value)) {
|
|
802
|
-
castDevice = mDev.Groups[1].Value;
|
|
803
|
-
} else {
|
|
804
|
-
Match mId = Regex.Match(castTxt, "\"viewer_id\"\\s*:\\s*\"([^\"]+)\"");
|
|
805
|
-
castDevice = mId.Success ? mId.Groups[1].Value : "Remote device";
|
|
806
|
-
}
|
|
807
|
-
}
|
|
808
|
-
}
|
|
809
|
-
} catch { }
|
|
810
|
-
|
|
811
|
-
if (!string.IsNullOrEmpty(castDevice)) {
|
|
812
|
-
string tpl = cfg.T("stopCast");
|
|
813
|
-
if (string.IsNullOrEmpty(tpl)) tpl = "Disconnect cast ({device})";
|
|
814
|
-
stopCastItem.Text = "⏹ " + tpl.Replace("{device}", castDevice);
|
|
815
|
-
stopCastItem.Visible = true;
|
|
816
|
-
stopCastSeparator.Visible = true;
|
|
817
|
-
} else {
|
|
818
|
-
stopCastItem.Visible = false;
|
|
819
|
-
stopCastSeparator.Visible = false;
|
|
820
|
-
}
|
|
821
|
-
}
|
|
822
|
-
|
|
823
|
-
void DisconnectAndBlockCast() {
|
|
824
|
-
try {
|
|
825
|
-
string castTxt = File.Exists(CastSessionFile) ? File.ReadAllText(CastSessionFile) : "";
|
|
826
|
-
string viewerId = "";
|
|
827
|
-
string viewerDevice = "";
|
|
828
|
-
Match mId = Regex.Match(castTxt, "\"viewer_id\"\\s*:\\s*\"([^\"]+)\"");
|
|
829
|
-
if (mId.Success) viewerId = mId.Groups[1].Value;
|
|
830
|
-
Match mDev = Regex.Match(castTxt, "\"viewer_device\"\\s*:\\s*\"([^\"]+)\"");
|
|
831
|
-
if (mDev.Success) viewerDevice = mDev.Groups[1].Value;
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
File.WriteAllText(CastActionFile,
|
|
835
|
-
|
|
836
|
-
stopCastItem.Visible = false;
|
|
837
|
-
stopCastSeparator.Visible = false;
|
|
838
|
-
|
|
839
|
-
string devName = !string.IsNullOrEmpty(viewerDevice) ? viewerDevice : viewerId;
|
|
840
|
-
string msg = cfg.T("castDisconnected");
|
|
841
|
-
if (string.IsNullOrEmpty(msg)) msg = "Disconnected cast from {device}.";
|
|
842
|
-
Balloon(msg.Replace("{device}", devName), ToolTipIcon.Info);
|
|
792
|
+
quickChat.Owner.MinimumSize = new Size(Math.Max(ShortcutRowWidth(quickChat), ShortcutRowWidth(quickVoice)), 0);
|
|
793
|
+
|
|
794
|
+
// Kiểm tra có thiết bị đang cast màn hình không
|
|
795
|
+
string castDevice = null;
|
|
796
|
+
try {
|
|
797
|
+
if (File.Exists(CastSessionFile)) {
|
|
798
|
+
string castTxt = File.ReadAllText(CastSessionFile);
|
|
799
|
+
if (Regex.IsMatch(castTxt, "\"active\"\\s*:\\s*true")) {
|
|
800
|
+
Match mDev = Regex.Match(castTxt, "\"viewer_device\"\\s*:\\s*\"([^\"]+)\"");
|
|
801
|
+
if (mDev.Success && !string.IsNullOrEmpty(mDev.Groups[1].Value)) {
|
|
802
|
+
castDevice = mDev.Groups[1].Value;
|
|
803
|
+
} else {
|
|
804
|
+
Match mId = Regex.Match(castTxt, "\"viewer_id\"\\s*:\\s*\"([^\"]+)\"");
|
|
805
|
+
castDevice = mId.Success ? mId.Groups[1].Value : "Remote device";
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
} catch { }
|
|
810
|
+
|
|
811
|
+
if (!string.IsNullOrEmpty(castDevice)) {
|
|
812
|
+
string tpl = cfg.T("stopCast");
|
|
813
|
+
if (string.IsNullOrEmpty(tpl)) tpl = "Disconnect cast ({device})";
|
|
814
|
+
stopCastItem.Text = "⏹ " + tpl.Replace("{device}", castDevice);
|
|
815
|
+
stopCastItem.Visible = true;
|
|
816
|
+
stopCastSeparator.Visible = true;
|
|
817
|
+
} else {
|
|
818
|
+
stopCastItem.Visible = false;
|
|
819
|
+
stopCastSeparator.Visible = false;
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
void DisconnectAndBlockCast() {
|
|
824
|
+
try {
|
|
825
|
+
string castTxt = File.Exists(CastSessionFile) ? File.ReadAllText(CastSessionFile) : "";
|
|
826
|
+
string viewerId = "";
|
|
827
|
+
string viewerDevice = "";
|
|
828
|
+
Match mId = Regex.Match(castTxt, "\"viewer_id\"\\s*:\\s*\"([^\"]+)\"");
|
|
829
|
+
if (mId.Success) viewerId = mId.Groups[1].Value;
|
|
830
|
+
Match mDev = Regex.Match(castTxt, "\"viewer_device\"\\s*:\\s*\"([^\"]+)\"");
|
|
831
|
+
if (mDev.Success) viewerDevice = mDev.Groups[1].Value;
|
|
832
|
+
|
|
833
|
+
// Tên thiết bị do trình duyệt khai, không được ghép vào chuỗi JSON: dấu ngoặc kép trong tên làm hỏng tệp và nút ngắt mất tác dụng.
|
|
834
|
+
File.WriteAllText(CastActionFile, "{\"action\":\"stop_and_block\"}\r\n", new UTF8Encoding(false));
|
|
835
|
+
|
|
836
|
+
stopCastItem.Visible = false;
|
|
837
|
+
stopCastSeparator.Visible = false;
|
|
838
|
+
|
|
839
|
+
string devName = !string.IsNullOrEmpty(viewerDevice) ? viewerDevice : viewerId;
|
|
840
|
+
string msg = cfg.T("castDisconnected");
|
|
841
|
+
if (string.IsNullOrEmpty(msg)) msg = "Disconnected cast from {device}.";
|
|
842
|
+
Balloon(msg.Replace("{device}", devName), ToolTipIcon.Info);
|
|
843
843
|
} catch { }
|
|
844
844
|
}
|
|
845
845
|
|