Pas idiot ArK, ça me tente
.
Godrik
C'est gentil, mais j'ai trouvé comment faire grâce à une enum :
enum MessageType{CHARACTER, TRUC};
Un petit header quoi.
Après à la réception il me reste qu'à faire :
Character c;
Truc t;
int mt;
sf::Packet packet;
socket.receive(packet);
packet >> mt;
switch(mt) {
case CHARACTER:{
packet >> c;
cout << "CHARACTER !" << endl;
cout << c.name << endl;
}; break;
case TRUC:{
packet >> t;
cout << "TRUC !" << endl;
cout << t.id << " " << t.fl << endl;
}; break;
default:
break;
};
Et ça fonctionne très bien
.