mirror of
https://github.com/immense/Remotely.git
synced 2025-10-26 11:27:15 +00:00
Change Windows Session tweaks.
This commit is contained in:
parent
3ffe6de0be
commit
bdd9afcedb
@ -119,7 +119,7 @@ namespace Remotely.Agent.Services
|
||||
await hubConnection.SendAsync("DisplayMessage", "Remote control failed to start on target device.", "Failed to start remote control.", requesterID);
|
||||
}
|
||||
}
|
||||
public async Task RestartScreenCaster(List<string> viewerIDs, string serviceID, string requesterID, HubConnection hubConnection)
|
||||
public async Task RestartScreenCaster(List<string> viewerIDs, string serviceID, string requesterID, HubConnection hubConnection, int targetSessionID = -1)
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -139,8 +139,8 @@ namespace Remotely.Agent.Services
|
||||
await Task.Delay(1000);
|
||||
|
||||
var result = Win32Interop.OpenInteractiveProcess(rcBinaryPath + $" -mode Unattended -requester {requesterID} -serviceid {serviceID} -deviceid {ConnectionInfo.DeviceID} -host {ConnectionInfo.Host} -relaunch true -viewers {String.Join(",", viewerIDs)}",
|
||||
targetSessionId: -1,
|
||||
forceConsoleSession: Shlwapi.IsOS(OsType.OS_ANYSERVER) ? true : false,
|
||||
targetSessionId: targetSessionID,
|
||||
forceConsoleSession: Shlwapi.IsOS(OsType.OS_ANYSERVER) && targetSessionID == -1 ? true : false,
|
||||
desktopName: "default",
|
||||
hiddenWindow: true,
|
||||
out _);
|
||||
|
||||
@ -163,9 +163,9 @@ namespace Remotely.Agent.Services
|
||||
var fileIDs = JsonSerializer.Deserialize<string[]>(Encoding.UTF8.GetString(response));
|
||||
await HubConnection.SendAsync("DownloadFile", fileIDs[0], senderConnectionID);
|
||||
});
|
||||
HubConnection.On("ChangeWindowsSession", async (string serviceID, string requesterID, int sessionID) =>
|
||||
HubConnection.On("ChangeWindowsSession", async (string serviceID, string viewerID, int targetSessionID) =>
|
||||
{
|
||||
await AppLauncher.LaunchRemoteControl(sessionID, requesterID, serviceID, HubConnection);
|
||||
await AppLauncher.RestartScreenCaster(new List<string>() { viewerID }, serviceID, viewerID, HubConnection, targetSessionID);
|
||||
});
|
||||
HubConnection.On("ExecuteCommand", (async (string mode, string command, string commandID, string senderConnectionID) =>
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user