Hi, I have try to add multiplayer for 4 player on an game that im working with... But I can't get it to work.. or recv all the info if you know what i meen. the send part I send all the data over an struct look like this.
struct pData_Send
{
char message[128];
int id;
float xPos;
float zPos;
};
pData_Send pData;
sendto(Client.ClientSocket, (char*)&pData, sizeof(pData_Send), 0, (SOCKADDR *)&from, sizeof(SOCKADDR));
and the recv part looks like this..
struct pData_Recv
{
char message[128];
int id;
float xPos;
float zPos;
};
pData_Recv pData;
recvfrom(Client.ClientSocket, (char*)&pData, sizeof(pData_Recv), 0, (SOCKADDR *)&from, sizeof(SOCKADDR));
is this an good way to do it? or can you guys come up with some ohter solution? feel free to come with examples on how you make multiplayer consepts and how do make it work with 5 players. thx.