|
|
@ -34,8 +34,13 @@ namespace PixelHub |
|
|
|
/// <summary>
|
|
|
|
/// Specifies a single command that is to be sent to a PixelBot.
|
|
|
|
/// </summary>
|
|
|
|
public class PixelCommand |
|
|
|
public abstract class PixelCommand |
|
|
|
{ |
|
|
|
/// <summary>
|
|
|
|
/// A random number generator. Useful for generating default message ids.
|
|
|
|
/// </summary>
|
|
|
|
private static Random rand = new Random(); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// The protocol version that this message is written in.
|
|
|
|
/// </summary>
|
|
|
@ -57,5 +62,21 @@ namespace PixelHub |
|
|
|
/// </summary>
|
|
|
|
public uint MessageLength = 0; |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// The payload of the message.
|
|
|
|
/// </summary>
|
|
|
|
public abstract byte[] Payload { get; } |
|
|
|
|
|
|
|
public PixelCommand() |
|
|
|
{ |
|
|
|
byte[] rawMessageId = new byte[sizeof(uint)]; |
|
|
|
rand.NextBytes(rawMessageId); |
|
|
|
MessageId = BitConverter.ToUInt32(rawMessageId, 0); |
|
|
|
} |
|
|
|
|
|
|
|
public byte[] AsCompiledCommand() |
|
|
|
{ |
|
|
|
throw new NotImplementedException(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |