3
« on: January 21, 2013, 11:55:58 am »
Client receive code:
sf::Packet receivePacket;
sf::IpAddress sender;
unsigned short senderPort;
if (socket.receive(receivePacket, sender, senderPort) != sf::Socket::Done)
return;
sf::Vector2i lVec[20];
int lRot[20];
sf::IpAddress lIP[20];
if (receivePacket >> lVec >> lRot >> lIP);
nextUpdateGame(lVec, lRot, lIP);
Error:
error: no match for 'operator>>' in 'receivePacket >> lVec'
Is this even possible? I'm banging my head against the wall trying to send 3 arrays from a SFML server:
Server code:
sf::Packet net_send;
net_send << pListVec << pListRot << pListIP;
if (socket.send(net_send, pListIP[i], port) != sf::Socket::Done)
return;
pListVec is a sf::Vector2i array.
pListRot is int array.
pListIP is sf::IpAddress array.
The server side of things is compiling properly but I'm having issues working out getting the clients to unpack these packets for use...
Any ideas?
Thanks in advance! ^^
As a note: This is all UDP networking. If you wish to see the rest for perspective, I'd be happy to upload but be warned... It isn't pretty as this is a 48h game jam project...