I need to read and write raw data. By raw data I mean reading/writing bytes as you would see them using a packet sniffer like
http://wpepro.net/To do this I understand that SFML reads/writes a character array/char*
However, when I try to receive a packet I do not think it is being read correctly because when I print it to the console I see gibberish.
This is what a piece of my code looks like:
if ( _authServer.Connect( _authIP, _authPort, 10.0f ) == sf::Socket::Done )
{
std::cout << "[SYSTEM] - CONNECTED TO AUTHENTICATION SERVER.\n";
char loginPacket[8] = { 0 };
std::size_t received;
_authServer.Receive( loginPacket, sizeof( loginPacket ), received );
_crypt.Decrypt( (unsigned char*)loginPacket, 8 );
for ( int i = 0; i < sizeof( loginPacket ); i++ )
{
std::cout << std::hex << loginPacket[i] << "\t";
}
std::cout << std::endl;
}