diff --git a/Server/Services/RCBrowserSocketHub.cs b/Server/Services/RCBrowserSocketHub.cs index 502b2e00..69dccf85 100644 --- a/Server/Services/RCBrowserSocketHub.cs +++ b/Server/Services/RCBrowserSocketHub.cs @@ -26,19 +26,11 @@ namespace Remotely.Server.Services this.DeviceHub = deviceHub; RCSessionRecorder = rcSessionRecorder; } - public static ConcurrentDictionary OrganizationConnectionList { get; set; } = new ConcurrentDictionary(); + public static ConcurrentDictionary OrganizationConnectionList { get; } = new ConcurrentDictionary(); private ApplicationConfig AppConfig { get; set; } - private string ScreenCasterID - { - get - { - return Context.Items["ScreenCasterID"] as string; - } - set - { - Context.Items["ScreenCasterID"] = value; - } - } + private DataService DataService { get; } + + private IHubContext DeviceHub { get; } private RemoteControlMode Mode { @@ -52,10 +44,10 @@ namespace Remotely.Server.Services } } - private DataService DataService { get; } - private IHubContext DeviceHub { get; } - private RemoteControlSessionRecorder RCSessionRecorder { get; } private IHubContext RCDeviceHub { get; } + + private RemoteControlSessionRecorder RCSessionRecorder { get; } + private string RequesterName { get @@ -68,6 +60,17 @@ namespace Remotely.Server.Services } } + private string ScreenCasterID + { + get + { + return Context.Items["ScreenCasterID"] as string; + } + set + { + Context.Items["ScreenCasterID"] = value; + } + } public async Task CtrlAltDel(string serviceID) { await DeviceHub.Clients.Client(serviceID).SendAsync("CtrlAltDel"); @@ -145,6 +148,21 @@ namespace Remotely.Server.Services await RCDeviceHub.Clients.Client(ScreenCasterID).SendAsync("SelectScreen", screenIndex, Context.ConnectionId); } + public async Task SendClipboardTransfer(string transferText) + { + await RCDeviceHub.Clients.Client(ScreenCasterID).SendAsync("ClipboardTransfer", transferText, Context.ConnectionId); + } + + public async Task SendLatencyUpdate(double latency) + { + await RCDeviceHub.Clients.Client(ScreenCasterID).SendAsync("LatencyUpdate", latency, Context.ConnectionId); + } + + public async Task SendQualityChange(int qualityLevel) + { + await RCDeviceHub.Clients.Client(ScreenCasterID).SendAsync("QualityChange", qualityLevel, Context.ConnectionId); + } + public async Task SendScreenCastRequestToDevice(string screenCasterID, string requesterName, int remoteControlMode) { if ((RemoteControlMode)remoteControlMode == RemoteControlMode.Normal) @@ -184,27 +202,14 @@ namespace Remotely.Server.Services await RCDeviceHub.Clients.Client(screenCasterID).SendAsync("RequestScreenCast", Context.ConnectionId, requesterName); } } - - public async Task SendLatencyUpdate(double latency) - { - await RCDeviceHub.Clients.Client(ScreenCasterID).SendAsync("LatencyUpdate", latency, Context.ConnectionId); - } public async Task SendSharedFileIDs(List fileIDs) { await RCDeviceHub.Clients.Client(ScreenCasterID).SendAsync("SharedFileIDs", fileIDs); } - public async Task SendQualityChange(int qualityLevel) - { - await RCDeviceHub.Clients.Client(ScreenCasterID).SendAsync("QualityChange", qualityLevel, Context.ConnectionId); - } public async Task SendToggleAudio(bool toggleOn) { await RCDeviceHub.Clients.Client(ScreenCasterID).SendAsync("ToggleAudio", toggleOn, Context.ConnectionId); } - public async Task SendClipboardTransfer(string transferText) - { - await RCDeviceHub.Clients.Client(ScreenCasterID).SendAsync("ClipboardTransfer", transferText, Context.ConnectionId); - } public async Task Tap(double percentX, double percentY) { await RCDeviceHub.Clients.Client(ScreenCasterID).SendAsync("Tap", percentX, percentY, Context.ConnectionId); diff --git a/Shared/Shared.csproj b/Shared/Shared.csproj index 143e355f..36543353 100644 --- a/Shared/Shared.csproj +++ b/Shared/Shared.csproj @@ -10,6 +10,7 @@ +