mirror of
https://github.com/immense/Remotely.git
synced 2025-10-26 11:27:15 +00:00
WIP on Core 3 upgrade.
This commit is contained in:
parent
6159b26164
commit
a2bff1af5e
@ -126,7 +126,6 @@ namespace Remotely.ScreenCast.Core.Capture
|
||||
// Close if no one is viewing.
|
||||
if (conductor.Viewers.Count == 0 && conductor.Mode == Enums.AppMode.Unattended)
|
||||
{
|
||||
conductor.InvokeScreenCastEnded();
|
||||
Environment.Exit(0);
|
||||
}
|
||||
|
||||
|
||||
@ -18,8 +18,6 @@ namespace Remotely.ScreenCast.Core
|
||||
public class Conductor
|
||||
{
|
||||
|
||||
public event EventHandler ScreenCastEnded;
|
||||
|
||||
public event EventHandler<bool> AudioToggled;
|
||||
|
||||
public event EventHandler<string> ClipboardTransferred;
|
||||
@ -100,11 +98,6 @@ namespace Remotely.ScreenCast.Core
|
||||
ClipboardTransferred?.Invoke(null, transferText);
|
||||
}
|
||||
|
||||
internal void InvokeScreenCastEnded()
|
||||
{
|
||||
ScreenCastEnded?.Invoke(null, null);
|
||||
}
|
||||
|
||||
internal void InvokeScreenCastInitiated(ScreenCastRequest viewerIdAndRequesterName)
|
||||
{
|
||||
ScreenCastInitiated?.Invoke(null, viewerIdAndRequesterName);
|
||||
|
||||
@ -1,28 +0,0 @@
|
||||
using Microsoft.Win32;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Remotely_ScreenCast.Win.Capture
|
||||
{
|
||||
public class WinVisualFx
|
||||
{
|
||||
|
||||
private static object PreviousSetting { get; set; }
|
||||
|
||||
public static void RestoreSetting()
|
||||
{
|
||||
var vfxKey = Registry.CurrentUser.CreateSubKey(@"Software\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects", true);
|
||||
vfxKey?.SetValue("VisualFXSetting", PreviousSetting, RegistryValueKind.DWord);
|
||||
}
|
||||
|
||||
public static void SetHighPerformance()
|
||||
{
|
||||
var vfxKey = Registry.CurrentUser.CreateSubKey(@"Software\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects", true);
|
||||
PreviousSetting = vfxKey?.GetValue("VisualFXSetting");
|
||||
vfxKey?.SetValue("VisualFXSetting", 2, RegistryValueKind.DWord);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -26,7 +26,6 @@ using Remotely.Shared.Services;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
using Microsoft.Win32;
|
||||
using Remotely_ScreenCast.Win.Capture;
|
||||
|
||||
namespace Remotely.ScreenCast.Win
|
||||
{
|
||||
@ -54,7 +53,6 @@ namespace Remotely.ScreenCast.Win
|
||||
Conductor.ScreenCastInitiated += ScreenCastInitiated;
|
||||
Conductor.AudioToggled += AudioToggled;
|
||||
Conductor.ClipboardTransferred += Conductor_ClipboardTransferred;
|
||||
Conductor.ScreenCastEnded += Conductor_ScreenCastEnded;
|
||||
|
||||
Conductor.Connect().ContinueWith(async (task) =>
|
||||
{
|
||||
@ -80,11 +78,6 @@ namespace Remotely.ScreenCast.Win
|
||||
}
|
||||
}
|
||||
|
||||
private static void Conductor_ScreenCastEnded(object sender, EventArgs e)
|
||||
{
|
||||
WinVisualFx.RestoreSetting();
|
||||
}
|
||||
|
||||
private static void AudioToggled(object sender, bool toggledOn)
|
||||
{
|
||||
if (toggledOn)
|
||||
@ -184,7 +177,6 @@ namespace Remotely.ScreenCast.Win
|
||||
capturer = new BitBltCapture();
|
||||
}
|
||||
await Conductor.CasterSocket.SendCursorChange(CursorIconWatcher.GetCurrentCursor(), new List<string>() { screenCastRequest.ViewerID });
|
||||
WinVisualFx.SetHighPerformance();
|
||||
ScreenCaster.BeginScreenCasting(screenCastRequest.ViewerID, screenCastRequest.RequesterName, capturer, Conductor);
|
||||
}
|
||||
}
|
||||
|
||||
@ -250,7 +250,6 @@
|
||||
<Compile Include="Capture\BitBltCapture.cs" />
|
||||
<Compile Include="Capture\CursorIconWatcher.cs" />
|
||||
<Compile Include="Capture\DXCapture.cs" />
|
||||
<Compile Include="Capture\WinVisualFx.cs" />
|
||||
<Compile Include="Input\WinInput.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
@ -289,8 +288,8 @@
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>if $(ConfigurationName) == Debug (
|
||||
if $(PlatformName) == Any CPU (
|
||||
md "$(SolutionDir)Agent\bin\Debug\netcoreapp2.2\ScreenCast\"
|
||||
copy /y "$(TargetDir)\*" "$(SolutionDir)Agent\bin\Debug\netcoreapp2.2\ScreenCast\"
|
||||
md "$(SolutionDir)Agent\bin\Debug\netcoreapp3.0\ScreenCast\"
|
||||
copy /y "$(TargetDir)\*" "$(SolutionDir)Agent\bin\Debug\netcoreapp3.0\ScreenCast\"
|
||||
)
|
||||
)</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
|
||||
@ -285,14 +285,14 @@ namespace Remotely.Server.Data
|
||||
// Users within the target device's organization, where user ID is in the list of IDs passed in, and
|
||||
// user is either an admin, the target device has no permissions assigned, or the target device is in a
|
||||
// permission group that the user is also in.
|
||||
var authorizedUsers = RemotelyContext.Users.Where(x =>
|
||||
var targetUsers = RemotelyContext.Users.Where(x =>
|
||||
x.OrganizationID == device.OrganizationID &&
|
||||
userIDs.Contains(x.Id) &&
|
||||
(
|
||||
x.IsAdministrator ||
|
||||
targetDevice.DevicePermissionLinks.Count == 0 ||
|
||||
targetDevice.DevicePermissionLinks.Any(y => y.PermissionGroup.UserPermissionLinks.Any(z=>z.RemotelyUserID == x.Id))
|
||||
));
|
||||
userIDs.Contains(x.Id)).ToList();
|
||||
|
||||
var authorizedUsers = targetUsers.Where(x =>
|
||||
x.IsAdministrator ||
|
||||
targetDevice.DevicePermissionLinks.Count == 0 ||
|
||||
targetDevice.DevicePermissionLinks.Any(y => y.PermissionGroup.UserPermissionLinks.Any(z => z.RemotelyUserID == x.Id)));
|
||||
|
||||
return authorizedUsers.ToList();
|
||||
}
|
||||
|
||||
@ -136,6 +136,7 @@ namespace Remotely.Server
|
||||
services.AddSignalR(options =>
|
||||
{
|
||||
options.EnableDetailedErrors = IsDev;
|
||||
options.MaximumReceiveMessageSize = 20000000;
|
||||
})
|
||||
.AddJsonProtocol(options =>
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user