mirror of
https://github.com/immense/Remotely.git
synced 2025-10-26 11:27:15 +00:00
Bug fixes. Capturer tweaks.
This commit is contained in:
parent
fd131601c0
commit
9df5d0c54f
1
.gitignore
vendored
1
.gitignore
vendored
@ -263,7 +263,6 @@ __pycache__/
|
||||
/Remotely_Server/wwwroot/Downloads/*.exe
|
||||
/Remotely_Server/wwwroot/Downloads/*.zip
|
||||
/Remotely_Server/wwwroot/Downloads/*.appimage
|
||||
*.pubxml
|
||||
/z_Old_SwitchWatch
|
||||
/z_Old_RC
|
||||
/Remotely_Server/Server.db
|
||||
|
||||
@ -46,7 +46,7 @@ namespace Remotely_Agent.Services
|
||||
if (string.IsNullOrWhiteSpace(ConnectionInfo.ServerVerificationToken))
|
||||
{
|
||||
IsServerVerified = true;
|
||||
ConnectionInfo.ServerVerificationToken = Guid.NewGuid().ToString();
|
||||
ConnectionInfo.ServerVerificationToken = Guid.NewGuid().ToString().Replace("-","");
|
||||
await HubConnection.InvokeAsync("SetServerVerificationToken", ConnectionInfo.ServerVerificationToken);
|
||||
Utilities.SaveConnectionInfo(ConnectionInfo);
|
||||
if (!Program.IsDebug)
|
||||
|
||||
@ -9,7 +9,7 @@ namespace Remotely_Library.Models
|
||||
public class CommandContext
|
||||
{
|
||||
[Key]
|
||||
public string ID { get; set; } = Guid.NewGuid().ToString();
|
||||
public string ID { get; set; } = Guid.NewGuid().ToString().Replace("-", "");
|
||||
public string CommandMode { get; set; }
|
||||
public string CommandText { get; set; }
|
||||
public string SenderUserID { get; set; }
|
||||
|
||||
@ -6,7 +6,7 @@ namespace Remotely_Library.Models
|
||||
{
|
||||
public class ConnectionInfo
|
||||
{
|
||||
public string DeviceID { get; set; } = Guid.NewGuid().ToString();
|
||||
public string DeviceID { get; set; } = Guid.NewGuid().ToString().Replace("-", "");
|
||||
private string host;
|
||||
public string Host
|
||||
{
|
||||
|
||||
@ -9,7 +9,7 @@ namespace Remotely_Library.Models
|
||||
public class Drive
|
||||
{
|
||||
[Key]
|
||||
public string ID { get; set; } = Guid.NewGuid().ToString();
|
||||
public string ID { get; set; } = Guid.NewGuid().ToString().Replace("-", "");
|
||||
public DriveType DriveType { get; set; }
|
||||
public string RootDirectory { get; internal set; }
|
||||
public string Name { get; internal set; }
|
||||
|
||||
@ -9,7 +9,7 @@ namespace Remotely_Library.Models
|
||||
public class EventLog
|
||||
{
|
||||
[Key]
|
||||
public string ID { get; set; } = Guid.NewGuid().ToString();
|
||||
public string ID { get; set; } = Guid.NewGuid().ToString().Replace("-", "");
|
||||
public EventTypes EventType { get; set; }
|
||||
public string Message { get; set; }
|
||||
public string Source { get; set; }
|
||||
|
||||
@ -8,7 +8,7 @@ namespace Remotely_Library.Models
|
||||
public class InviteLink
|
||||
{
|
||||
[Key]
|
||||
public string ID { get; set; } = Guid.NewGuid().ToString();
|
||||
public string ID { get; set; } = Guid.NewGuid().ToString().Replace("-", "");
|
||||
public string InvitedUser { get; set; }
|
||||
public bool IsAdmin { get; set; }
|
||||
public DateTime DateSent { get; set; }
|
||||
|
||||
@ -9,7 +9,7 @@ namespace Remotely_Library.Models
|
||||
public class PermissionGroup
|
||||
{
|
||||
[Key]
|
||||
public string ID { get; set; } = Guid.NewGuid().ToString();
|
||||
public string ID { get; set; } = Guid.NewGuid().ToString().Replace("-", "");
|
||||
[StringLength(100)]
|
||||
public string Name { get; set; }
|
||||
public virtual Organization Organization { get; set; }
|
||||
|
||||
@ -7,7 +7,7 @@ namespace Remotely_Library.Models
|
||||
public class RemotelyUserOptions
|
||||
{
|
||||
[Key]
|
||||
public string ID { get; set; } = Guid.NewGuid().ToString();
|
||||
public string ID { get; set; } = Guid.NewGuid().ToString().Replace("-", "");
|
||||
[Display(Name ="Console Prompt")]
|
||||
[StringLength(5)]
|
||||
public string ConsolePrompt { get; set; } = "~>";
|
||||
|
||||
@ -8,7 +8,7 @@ namespace Remotely_Library.Models
|
||||
public class SharedFile
|
||||
{
|
||||
[Key]
|
||||
public string ID { get; set; } = Guid.NewGuid().ToString();
|
||||
public string ID { get; set; } = Guid.NewGuid().ToString().Replace("-", "");
|
||||
public string FileName { get; set; }
|
||||
public string ContentType { get; set; }
|
||||
public byte[] FileContents { get; set; }
|
||||
|
||||
@ -27,6 +27,11 @@ namespace Remotely_ScreenCast.Capture
|
||||
|
||||
public static Bitmap GetImageDiff(Bitmap currentFrame, Bitmap previousFrame, bool captureFullscreen)
|
||||
{
|
||||
if (captureFullscreen)
|
||||
{
|
||||
return (Bitmap)currentFrame.Clone();
|
||||
}
|
||||
|
||||
if (currentFrame.Height != previousFrame.Height || currentFrame.Width != previousFrame.Width)
|
||||
{
|
||||
throw new Exception("Bitmaps are not of equal dimensions.");
|
||||
@ -61,14 +66,6 @@ namespace Remotely_ScreenCast.Capture
|
||||
Marshal.Copy(ptr1, rgbValues1, 0, arraySize);
|
||||
Marshal.Copy(ptr2, rgbValues2, 0, arraySize);
|
||||
|
||||
if (captureFullscreen)
|
||||
{
|
||||
previousFrame.UnlockBits(bd1);
|
||||
currentFrame.UnlockBits(bd2);
|
||||
mergedFrame.UnlockBits(bd3);
|
||||
return currentFrame;
|
||||
}
|
||||
|
||||
// Check RGBA value for each pixel.
|
||||
for (int counter = 0; counter < rgbValues2.Length - 4; counter += 4)
|
||||
{
|
||||
@ -95,33 +92,21 @@ namespace Remotely_ScreenCast.Capture
|
||||
return mergedFrame;
|
||||
}
|
||||
|
||||
public static byte[] EncodeBitmap(Bitmap bitmap, Viewer viewer)
|
||||
public static byte[] EncodeBitmapAndResize(Bitmap bitmap)
|
||||
{
|
||||
using (var ms = new MemoryStream())
|
||||
{
|
||||
bitmap.Save(ms, CodecInfo, EncoderParams);
|
||||
var bytes = ms.ToArray();
|
||||
if (bytes.Length > 300000)
|
||||
{
|
||||
viewer.Capturer.CaptureFullscreen = true;
|
||||
var reducedBitmap = (Bitmap)bitmap.Clone();
|
||||
var reductionRatio = (double)300000 / (double)bytes.Length;
|
||||
|
||||
using (var ms2 = new MemoryStream())
|
||||
{
|
||||
reducedBitmap = new Bitmap(reducedBitmap, (int)(reducedBitmap.Width * reductionRatio), (int)(reducedBitmap.Height * reductionRatio));
|
||||
using (var graphics = Graphics.FromImage(bitmap))
|
||||
{
|
||||
graphics.DrawImage(reducedBitmap, 0, 0, bitmap.Width, bitmap.Height);
|
||||
}
|
||||
reducedBitmap.Save(ms2, CodecInfo, EncoderParams);
|
||||
bytes = ms2.ToArray();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return bytes;
|
||||
return ms.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
public static byte[] EncodeBitmap(Bitmap bitmap)
|
||||
{
|
||||
using (var ms = new MemoryStream())
|
||||
{
|
||||
bitmap.Save(ms, CodecInfo, EncoderParams);
|
||||
return ms.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -23,7 +23,12 @@ namespace Remotely_ScreenCast.Capture
|
||||
|
||||
try
|
||||
{
|
||||
if (Program.Viewers.Count == 0)
|
||||
if (Program.CurrentDesktopName.ToLower() == "winlogon")
|
||||
{
|
||||
capturer = new BitBltCapture();
|
||||
captureMode = CaptureMode.BitBtl;
|
||||
}
|
||||
else if (Program.Viewers.Count == 0)
|
||||
{
|
||||
capturer = new DXCapture();
|
||||
captureMode = CaptureMode.DirectX;
|
||||
@ -41,12 +46,11 @@ namespace Remotely_ScreenCast.Capture
|
||||
captureMode = CaptureMode.BitBtl;
|
||||
}
|
||||
|
||||
Logger.Write($"Starting screen cast. Requester: {requesterName}. Viewer ID: {viewerID}. Capture Mode: {captureMode.ToString()}. App Mode: {Program.Mode} Desktop: {Win32Interop.GetCurrentDesktop()}");
|
||||
Logger.Write($"Starting screen cast. Requester: {requesterName}. Viewer ID: {viewerID}. Capture Mode: {captureMode.ToString()}. App Mode: {Program.Mode} Desktop: {Program.CurrentDesktopName}");
|
||||
|
||||
var viewer = new Models.Viewer()
|
||||
{
|
||||
Capturer = capturer,
|
||||
CurrentScreenIndex = capturer.SelectedScreen,
|
||||
DisconnectRequested = false,
|
||||
Name = requesterName,
|
||||
ViewerConnectionID = viewerID,
|
||||
@ -60,7 +64,7 @@ namespace Remotely_ScreenCast.Capture
|
||||
}
|
||||
|
||||
await outgoingMessages.SendScreenCount(
|
||||
viewer.CurrentScreenIndex,
|
||||
capturer.SelectedScreen,
|
||||
Screen.AllScreens.Length,
|
||||
viewerID);
|
||||
|
||||
@ -100,11 +104,12 @@ namespace Remotely_ScreenCast.Capture
|
||||
capturer.Capture();
|
||||
|
||||
var newImage = ImageDiff.GetImageDiff(capturer.CurrentFrame, capturer.PreviousFrame, capturer.CaptureFullscreen);
|
||||
var img = ImageDiff.EncodeBitmap(newImage, viewer);
|
||||
if (capturer.CaptureFullscreen)
|
||||
{
|
||||
capturer.CaptureFullscreen = false;
|
||||
}
|
||||
var img = ImageDiff.EncodeBitmapAndResize(newImage);
|
||||
|
||||
if (img?.Length > 0)
|
||||
{
|
||||
await outgoingMessages.SendScreenCapture(img, viewerID, DateTime.Now);
|
||||
|
||||
@ -12,9 +12,7 @@ namespace Remotely_ScreenCast.Models
|
||||
public string ViewerConnectionID { get; set; }
|
||||
public string Name { get; set; }
|
||||
public ICapturer Capturer { get; set; }
|
||||
public int CurrentScreenIndex { get; set; }
|
||||
public bool DisconnectRequested { get; set; }
|
||||
public bool HasControl { get; set; }
|
||||
public double NextCaptureDelay { get; internal set; }
|
||||
}
|
||||
}
|
||||
|
||||
@ -29,8 +29,8 @@ namespace Remotely_ScreenCast
|
||||
public static string Host { get; private set; }
|
||||
public static HubConnection Connection { get; private set; }
|
||||
public static OutgoingMessages OutgoingMessages { get; private set; }
|
||||
public static string CurrentDesktopName { get; set; }
|
||||
public static ConcurrentDictionary<string, Viewer> Viewers { get; } = new ConcurrentDictionary<string, Viewer>();
|
||||
private static string CurrentDesktopName { get; set; }
|
||||
|
||||
static void Main(string[] args)
|
||||
{
|
||||
|
||||
@ -169,11 +169,12 @@ namespace Remotely_ScreenCast.Sockets
|
||||
}
|
||||
await hubConnection.InvokeAsync("ViewerDisconnected", viewerID);
|
||||
});
|
||||
hubConnection.On("FrameSkip", (double delayTime, string viewerID) =>
|
||||
hubConnection.On("LatencyUpdate", (double latency, double payloadSize, string viewerID) =>
|
||||
{
|
||||
if (Program.Viewers.TryGetValue(viewerID, out var viewer))
|
||||
{
|
||||
viewer.NextCaptureDelay = delayTime;
|
||||
// TODO.
|
||||
//viewer.Capturer.NextCaptureDelay = delayTime;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -80,7 +80,6 @@ namespace Remotely_Server.API
|
||||
return File(Encoding.UTF8.GetBytes(content), "application/octet-stream", "CommandResults." + fileExt.ToLower());
|
||||
}
|
||||
|
||||
// GET api/<controller>/5
|
||||
[HttpGet("PSCoreResult/{commandID}/{deviceID}")]
|
||||
[Authorize]
|
||||
public PSCoreCommandResult PSCoreResult(string commandID, string deviceID)
|
||||
@ -88,7 +87,13 @@ namespace Remotely_Server.API
|
||||
return DataService.GetCommandContext(commandID, User.Identity.Name).PSCoreResults.Find(x => x.DeviceID == deviceID);
|
||||
}
|
||||
|
||||
// POST api/<controller>
|
||||
[HttpGet("GenericResult/{commandID}/{deviceID}")]
|
||||
[Authorize]
|
||||
public GenericCommandResult GenericResult(string commandID, string deviceID)
|
||||
{
|
||||
return DataService.GetCommandContext(commandID, User.Identity.Name).CommandResults.Find(x => x.DeviceID == deviceID);
|
||||
}
|
||||
|
||||
[HttpPost("{resultType}")]
|
||||
public void Post(string resultType)
|
||||
{
|
||||
|
||||
@ -44,6 +44,11 @@ namespace Remotely_Server.API
|
||||
var tempFile = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
|
||||
zipArchive.GetEntry("Remotely_Agent.dll").ExtractToFile(tempFile, true);
|
||||
var version = FileVersionInfo.GetVersionInfo(tempFile);
|
||||
try
|
||||
{
|
||||
System.IO.File.Delete(tempFile);
|
||||
}
|
||||
catch { }
|
||||
return version.FileVersion.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,7 +14,7 @@ namespace Remotely_Server.Data
|
||||
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
|
||||
: base(options)
|
||||
{
|
||||
//this.Database.Migrate();
|
||||
this.Database.Migrate();
|
||||
}
|
||||
public DbSet<CommandContext> CommandContexts { get; set; }
|
||||
|
||||
|
||||
@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
|
||||
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<WebPublishMethod>MSDeploy</WebPublishMethod>
|
||||
<ResourceId>/subscriptions/6c9cd8a3-be3e-43d9-bce0-4732d0a65c51/resourceGroups/doremotely/providers/Microsoft.Web/sites/doremotely</ResourceId>
|
||||
<ResourceGroup>doremotely</ResourceGroup>
|
||||
<PublishProvider>AzureWebSite</PublishProvider>
|
||||
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
||||
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
||||
<SiteUrlToLaunchAfterPublish>http://doremotely.azurewebsites.net</SiteUrlToLaunchAfterPublish>
|
||||
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
|
||||
<ExcludeApp_Data>False</ExcludeApp_Data>
|
||||
<ProjectGuid>3e835099-c417-4d82-8d5c-13dc09af48ac</ProjectGuid>
|
||||
<MSDeployServiceURL>doremotely.scm.azurewebsites.net:443</MSDeployServiceURL>
|
||||
<DeployIisAppPath>doremotely</DeployIisAppPath>
|
||||
<RemoteSitePhysicalPath />
|
||||
<SkipExtraFilesOnServer>True</SkipExtraFilesOnServer>
|
||||
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
|
||||
<EnableMSDeployBackup>True</EnableMSDeployBackup>
|
||||
<UserName>$doremotely</UserName>
|
||||
<_SavePWD>True</_SavePWD>
|
||||
<_DestinationType>AzureWebSite</_DestinationType>
|
||||
<InstallAspNetCoreSiteExtension>False</InstallAspNetCoreSiteExtension>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@ -159,9 +159,9 @@ namespace Remotely_Server.Services
|
||||
await RCDeviceHub.Clients.Client(screenCasterID).SendAsync("GetScreenCast", Context.ConnectionId, requesterName);
|
||||
}
|
||||
|
||||
public async Task SendFrameSkip(double delayTime)
|
||||
public async Task SendLatencyUpdate(double latency, double payloadSize)
|
||||
{
|
||||
await RCDeviceHub.Clients.Client(ScreenCasterID).SendAsync("FrameSkip", delayTime, Context.ConnectionId);
|
||||
await RCDeviceHub.Clients.Client(ScreenCasterID).SendAsync("LatencyUpdate", latency, payloadSize, Context.ConnectionId);
|
||||
}
|
||||
public async Task SendSharedFileIDs(List<string> fileIDs)
|
||||
{
|
||||
|
||||
@ -31,7 +31,7 @@ export function Connect() {
|
||||
;
|
||||
function applyMessageHandlers(hubConnection) {
|
||||
hubConnection.on("UserOptions", (options) => {
|
||||
Main.UserSettings.CommandModeShortcuts.Remotely = options.CommandModeShortcutRemotely;
|
||||
Main.UserSettings.CommandModeShortcuts.Web = options.CommandModeShortcutWeb;
|
||||
Main.UserSettings.CommandModeShortcuts.PSCore = options.CommandModeShortcutPSCore;
|
||||
Main.UserSettings.CommandModeShortcuts.WinPS = options.CommandModeShortcutWinPS;
|
||||
Main.UserSettings.CommandModeShortcuts.Bash = options.CommandModeShortcutBash;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -41,7 +41,7 @@ export function Connect() {
|
||||
|
||||
function applyMessageHandlers(hubConnection) {
|
||||
hubConnection.on("UserOptions", (options: UserOptions) => {
|
||||
Main.UserSettings.CommandModeShortcuts.Remotely = options.CommandModeShortcutRemotely;
|
||||
Main.UserSettings.CommandModeShortcuts.Web = options.CommandModeShortcutWeb;
|
||||
Main.UserSettings.CommandModeShortcuts.PSCore = options.CommandModeShortcutPSCore;
|
||||
Main.UserSettings.CommandModeShortcuts.WinPS = options.CommandModeShortcutWinPS;
|
||||
Main.UserSettings.CommandModeShortcuts.Bash = options.CommandModeShortcutBash;
|
||||
|
||||
@ -87,7 +87,7 @@ export function GetCommandCompletions(commandText) {
|
||||
/** Checks the given string for a matching shortcut. */
|
||||
export function GetCommandModeShortcut() {
|
||||
switch (UI.ConsoleTextArea.value.toLowerCase()) {
|
||||
case UserSettings.CommandModeShortcuts.Remotely:
|
||||
case UserSettings.CommandModeShortcuts.Web:
|
||||
return "Remotely";
|
||||
case UserSettings.CommandModeShortcuts.CMD:
|
||||
return "CMD";
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -92,7 +92,7 @@ export function GetCommandCompletions(commandText:string): ConsoleCommand[] {
|
||||
/** Checks the given string for a matching shortcut. */
|
||||
export function GetCommandModeShortcut() {
|
||||
switch (UI.ConsoleTextArea.value.toLowerCase()) {
|
||||
case UserSettings.CommandModeShortcuts.Remotely:
|
||||
case UserSettings.CommandModeShortcuts.Web:
|
||||
return "Remotely";
|
||||
case UserSettings.CommandModeShortcuts.CMD:
|
||||
return "CMD";
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
export interface UserOptions {
|
||||
ID: string;
|
||||
ConsolePrompt: string;
|
||||
CommandModeShortcutRemotely: string;
|
||||
CommandModeShortcutWeb: string;
|
||||
CommandModeShortcutPSCore: string;
|
||||
CommandModeShortcutWinPS: string;
|
||||
CommandModeShortcutCMD: string;
|
||||
|
||||
@ -2,7 +2,7 @@ import * as UI from "./UI.js";
|
||||
import { RemoteControl } from "./RemoteControl.js";
|
||||
import { GetCursor } from "./CursorMap.js";
|
||||
var signalR = window["signalR"];
|
||||
var lastFrameDelay = Date.now();
|
||||
var lastLatency = Date.now();
|
||||
export class RCBrowserSockets {
|
||||
Connect() {
|
||||
this.Connection = new signalR.HubConnectionBuilder()
|
||||
@ -32,8 +32,9 @@ export class RCBrowserSockets {
|
||||
SendScreenCastRequestToDevice() {
|
||||
return this.Connection.invoke("SendScreenCastRequestToDevice", RemoteControl.ClientID, RemoteControl.RequesterName, RemoteControl.Mode);
|
||||
}
|
||||
SendFrameSkip(delayTime) {
|
||||
this.Connection.invoke("SendFrameSkip", delayTime);
|
||||
SendLatencyUpdate(latency, payloadSize) {
|
||||
this.Connection.invoke("SendLatencyUpdate", latency, payloadSize);
|
||||
console.log(`Sending latency update. Latency:${latency}. Size: ${payloadSize}`);
|
||||
}
|
||||
SendSelectScreen(index) {
|
||||
return this.Connection.invoke("SelectScreen", index);
|
||||
@ -106,11 +107,11 @@ export class RCBrowserSockets {
|
||||
UI.Screen2DContext.clearRect(0, 0, width, height);
|
||||
});
|
||||
hubConnection.on("ScreenCapture", (buffer, captureTime) => {
|
||||
//var frameDelay = Date.now() - new Date(captureTime).getTime();
|
||||
//if (frameDelay > 3000 && Date.now() - lastFrameDelay > 3000) {
|
||||
// this.SendFrameSkip(frameDelay * .25);
|
||||
// lastFrameDelay = Date.now();
|
||||
//}
|
||||
var latency = Date.now() - new Date(captureTime).getTime();
|
||||
if (latency > 3000 && Date.now() - lastLatency > 3000) {
|
||||
this.SendLatencyUpdate(latency, buffer.length);
|
||||
lastLatency = Date.now();
|
||||
}
|
||||
var url = window.URL.createObjectURL(new Blob([buffer]));
|
||||
var img = document.createElement("img");
|
||||
img.onload = () => {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -5,7 +5,7 @@ import { RemoteControl } from "./RemoteControl.js";
|
||||
import { GetCursor } from "./CursorMap.js";
|
||||
|
||||
var signalR = window["signalR"];
|
||||
var lastFrameDelay = Date.now();
|
||||
var lastLatency = Date.now();
|
||||
|
||||
export class RCBrowserSockets {
|
||||
Connection: any;
|
||||
@ -39,8 +39,9 @@ export class RCBrowserSockets {
|
||||
SendScreenCastRequestToDevice() {
|
||||
return this.Connection.invoke("SendScreenCastRequestToDevice", RemoteControl.ClientID, RemoteControl.RequesterName, RemoteControl.Mode);
|
||||
}
|
||||
SendFrameSkip(delayTime: number) {
|
||||
this.Connection.invoke("SendFrameSkip", delayTime);
|
||||
SendLatencyUpdate(latency: number, payloadSize: number) {
|
||||
this.Connection.invoke("SendLatencyUpdate", latency, payloadSize);
|
||||
console.log(`Sending latency update. Latency:${latency}. Size: ${payloadSize}`)
|
||||
}
|
||||
SendSelectScreen(index: number) {
|
||||
return this.Connection.invoke("SelectScreen", index);
|
||||
@ -114,11 +115,11 @@ export class RCBrowserSockets {
|
||||
UI.Screen2DContext.clearRect(0, 0, width, height);
|
||||
});
|
||||
hubConnection.on("ScreenCapture", (buffer: Uint8Array, captureTime: Date) => {
|
||||
//var frameDelay = Date.now() - new Date(captureTime).getTime();
|
||||
//if (frameDelay > 3000 && Date.now() - lastFrameDelay > 3000) {
|
||||
// this.SendFrameSkip(frameDelay * .25);
|
||||
// lastFrameDelay = Date.now();
|
||||
//}
|
||||
var latency = Date.now() - new Date(captureTime).getTime();
|
||||
if (latency > 3000 && Date.now() - lastLatency > 3000) {
|
||||
this.SendLatencyUpdate(latency, buffer.length);
|
||||
lastLatency = Date.now();
|
||||
}
|
||||
var url = window.URL.createObjectURL(new Blob([buffer]));
|
||||
var img = document.createElement("img");
|
||||
img.onload = () => {
|
||||
|
||||
@ -51,7 +51,7 @@ export function AddCommandResultsHarness(result) {
|
||||
var deviceName = DataGrid.DataSource.find(x => x.ID == result.DeviceID).DeviceName;
|
||||
var resultsWrapper = document.getElementById(result.CommandContextID + "-results");
|
||||
var totalDevices = parseInt(document.getElementById(result.CommandContextID + "-totaldevices").innerText);
|
||||
var collapseClass = totalDevices > 1 ? "collapse" : "collapse in";
|
||||
var collapseClass = totalDevices > 1 ? "collapse" : "collapse show";
|
||||
var resultDiv = document.createElement("div");
|
||||
resultDiv.innerHTML = `
|
||||
<div class="result-header">
|
||||
|
||||
@ -1 +1 @@
|
||||
{"version":3,"file":"ResultsParser.js","sourceRoot":"","sources":["ResultsParser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAE1C,OAAO,EA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,CAAC,aAAa,CAAC,CAAC;KAC/C;IACD,cAAc,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IACtC,iBAAiB,CAAC,SAAS,GAAG,iBAAiB,CAAC,YAAY,CAAC;AACjE,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,gBAAuB;IACtD,IAAI,YAAY,GAAG,QAAQ,CAAC,QAAQ,CAAC,cAAc,CAAC,gBAAgB,GAAG,eAAe,CAAC,CAAC,SAAS,CAAC,CAAC;IACnG,IAAI,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,cAAc,CAAC,gBAAgB,GAAG,UAAU,CAAC,CAAC,QAAQ,CAAC,MAAM,GAAG,YAAY,GAAG,GAAG,CAAC,CAAC;IAC9H,QAAQ,CAAC,cAAc,CAAC,gBAAgB,GAAG,YAAY,CAAC,CAAC,SAAS,GAAG,MAAM,CAAC,eAAe,CAAC,GAAG,GAAG,CAAC;AACvG,CAAC"}
|
||||
@ -57,7 +57,7 @@ export function AddCommandResultsHarness(result: GenericCommandResult) {
|
||||
var deviceName = DataGrid.DataSource.find(x => x.ID == result.DeviceID).DeviceName;
|
||||
var resultsWrapper = document.getElementById(result.CommandContextID + "-results");
|
||||
var totalDevices = parseInt(document.getElementById(result.CommandContextID + "-totaldevices").innerText);
|
||||
var collapseClass = totalDevices > 1 ? "collapse" : "collapse in";
|
||||
var collapseClass = totalDevices > 1 ? "collapse" : "collapse show";
|
||||
|
||||
var resultDiv = document.createElement("div");
|
||||
resultDiv.innerHTML = `
|
||||
|
||||
@ -2,7 +2,7 @@ export const UserSettings = new class {
|
||||
constructor() {
|
||||
this.PromptString = "~>";
|
||||
this.CommandModeShortcuts = {
|
||||
"Remotely": "/remotely",
|
||||
"Web": "/web",
|
||||
"PSCore": "/pscore",
|
||||
"WinPS": "/winps",
|
||||
"CMD": "/cmd",
|
||||
|
||||
@ -1 +1 @@
|
||||
{"version":3,"file":"UserSettings.js","sourceRoot":"","sources":["UserSettings.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI;IAAA;QAC5B,iBAAY,GAAG,IAAI,CAAC;QAEpB,yBAAoB,GAAG;YACnB,UAAU,EAAE,WAAW;YACvB,QAAQ,EAAE,SAAS;YACnB,OAAO,EAAE,QAAQ;YACjB,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,OAAO;SAClB,CAAA;IACL,CAAC;CAAA,CAAA"}
|
||||
{"version":3,"file":"UserSettings.js","sourceRoot":"","sources":["UserSettings.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI;IAAA;QAC5B,iBAAY,GAAG,IAAI,CAAC;QAEpB,yBAAoB,GAAG;YACnB,KAAK,EAAE,MAAM;YACb,QAAQ,EAAE,SAAS;YACnB,OAAO,EAAE,QAAQ;YACjB,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,OAAO;SAClB,CAAA;IACL,CAAC;CAAA,CAAA"}
|
||||
@ -2,7 +2,7 @@
|
||||
PromptString = "~>";
|
||||
|
||||
CommandModeShortcuts = {
|
||||
"Remotely": "/remotely",
|
||||
"Web": "/web",
|
||||
"PSCore": "/pscore",
|
||||
"WinPS": "/winps",
|
||||
"CMD": "/cmd",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user