First commit

This commit is contained in:
EnderIce2
2020-10-25 16:19:43 +02:00
parent 9d78d84acb
commit b91db81473
73 changed files with 7634 additions and 0 deletions

View File

@ -0,0 +1,35 @@
using DiscordRPC.Converters;
using Newtonsoft.Json;
namespace DiscordRPC.RPC.Payload
{
/// <summary>
/// Base Payload that is received by both client and server
/// </summary>
internal abstract class IPayload
{
/// <summary>
/// The type of payload
/// </summary>
[JsonProperty("cmd"), JsonConverter(typeof(EnumSnakeCaseConverter))]
public Command Command { get; set; }
/// <summary>
/// A incremental value to help identify payloads
/// </summary>
[JsonProperty("nonce")]
public string Nonce { get; set; }
protected IPayload() { }
protected IPayload(long nonce)
{
Nonce = nonce.ToString();
}
public override string ToString()
{
return "Payload || Command: " + Command.ToString() + ", Nonce: " + (Nonce != null ? Nonce.ToString() : "NULL");
}
}
}