I want after getting a packet check what is the type of the packet(a line, a guy entering lobby)
class MyPacket: public sf::Packet{
private :
virtual const char* OnSend(std::size_t& DataSize)
{
Append(type.c_str(),type.length());
DataSize = GetDataSize();
return this->GetData();
}
virtual void OnReceive(const char* Data, std::size_t DataSize)
{
//HERE
}
public:
string type;
};
How do i retrieve the type from const char* Data?