Hello,
I intend to use SFML for the server side of my game and so far I've managed to register incoming clients etc. and it is working fine.
The next logical step would be sending real data between the server and the client but I am not using SFML for my client side. I wanted to use the SFML packets with TCP but I just read the following in the packets tutorial:
However, it has a drawback: to preserve message boundaries, sf::Packet has to send extra bytes with your data, which implies that you can only receive them with a sf::Packet if you want them to be properly decoded. In other words, you can't send a SFML packet to a custom recipient, it has to use a SFML packet too. Note that this applies to TCP only, UDP is fine since the protocol itself ensures message boundaries.
So as far as I understood, it is required to use SFML on both ends if I want to use the SFML packet structure, right? If this is the case, there surely is another way to "decode" the packet on the client side, can anyone point me to the code where the packet is encoded or has anyone ever written a function that would manually do this (C++ preferably)? I guess it would be easier to write something like that instead of wrapping my send functions to use byte arrays.
Thanks, Lys