Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Checking incoming data  (Read 2018 times)

0 Members and 1 Guest are viewing this topic.

tcoy

  • Newbie
  • *
  • Posts: 1
    • View Profile
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
}
 
?

Omega

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: Checking incoming data
« Reply #1 on: January 09, 2014, 04:43:28 am »
I believe so, but you will need to provide your own overloaded insertion/extraction operators for your own types.

 

anything