[client] Decode InfoRequests

This commit is contained in:
Starbeamrainbowlabs 2017-04-21 14:36:48 +01:00
parent 9f0d82e695
commit bed9148075
2 changed files with 15 additions and 0 deletions

View file

@ -6,3 +6,17 @@
InfoRequestMessage::InfoRequestMessage() : PixelMessage()
{
}
InfoRequestMessage::InfoRequestMessage(byte* rawMessage) : PixelMessage(rawMessage)
{
// The position of the start of the message body
char* messageBodyPointer = static_cast<char*>(static_cast<void*>(rawMessage + PixelMessage::MESSAGE_HEADER_LENGTH));
Key = new char[strlen(messageBodyPointer) + sizeof(char)];
strcpy(Key, messageBodyPointer);
}
InfoRequestMessage::~InfoRequestMessage()
{
delete[] Key;
}

View file

@ -7,6 +7,7 @@ struct InfoRequestMessage : public PixelMessage {
public:
InfoRequestMessage();
~InfoRequestMessage();
InfoRequestMessage(byte* rawMessage);
char* Key;
};