Browse Source

[client] Decode InfoRequests

master
Starbeamrainbowlabs 4 years ago
parent
commit
bed9148075
2 changed files with 15 additions and 0 deletions
  1. +14
    -0
      PixelHub-Client/src/Messages/InfoRequestMessage.cpp
  2. +1
    -0
      PixelHub-Client/src/Messages/InfoRequestMessage.h

+ 14
- 0
PixelHub-Client/src/Messages/InfoRequestMessage.cpp 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;
}

+ 1
- 0
PixelHub-Client/src/Messages/InfoRequestMessage.h View File

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