1
Network / Checking incoming data
« on: January 09, 2014, 04:10:45 am »
Currently I am using SFML to make a networking system for my game, and I have it set up with different structures that hold data and packet operator overloads for them for sending/receiving. I understand you can do
if(packet >> data)
to check if the data was extracted successfully, but could you also use that method to check incoming structure types? For example, Player player
if(packet >> player)
{
//Packet contained data for a 'Player' struct
}
?
if(packet >> player)
{
//Packet contained data for a 'Player' struct
}