This is probably a very stupid question, but bear with me.
I'm trying to build my first ever network game. For this I need to be able to send many different kinds of "message" between the computers. For instance:
- connection request
- you have x time left before you lag-out
- object y is at position z
- object t has been created at position u
- etc
So I don't know what my packet will contain until I open it, but until I open it I don't know what it will contain
My idea was to give each packet a sort of "header" which lets the receiver know how to open it. The header would always be, say, a short unsigned integer.
I know this is possible if I'm just sending bytes but it would be rather fiddly. Is there a way of implementing this kind of stuff with SFML packets?
Thanks,
William