std::cout << "Sending the player id: " << c.id << std::endl; //prints 1
packet << ugid << pt::handshake << id;
socket.send(packet, sender, rport);
packet >> c.id >> c.id >> id;
std::cout << id << std::endl; //prints 0
I'm handing my client a unique ID which increments every connect. This is for my first client, the id variable is 1 and I pass it to my packet, but when opening the packet the id variable is 0. I'm using sf::UInt32. I'm opening the packet on the server side, but it is 0 on the client side too.
pt::handshake is an enum = 0.
Here are the links to my full server code:
http://pastebin.com/eChQu6fdhttp://pastebin.com/yMTLeHeV