mirror of
https://github.com/EnderIce2/SDR-RPC.git
synced 2025-07-12 12:49:13 +00:00
First commit
This commit is contained in:
35
DiscordAPI/RPC/Payload/IPayload.cs
Normal file
35
DiscordAPI/RPC/Payload/IPayload.cs
Normal 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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user